Giter Site home page Giter Site logo

chat-bot's Introduction

chat-bot

Chatbot Takehome Assessment

Setup

  • python3 -m venv venv
  • source venv/bin/activate
  • make / python manage.py runserver

Using the app

The first time you run the make command the init.sql and create.sql don't work very well. I've tried improving it for a while. Running make for a second time, fixes this issue.

If you now send a POST request with the following inside the body:

{
    "id": 1,
    "userid": "1",
    "conversationid": "1",
    "optionpicked": "1",
    "state": "1"
}

You should get the following successfull response:

{
    "status": "success",
    "message": "Conversation data saved successfully"
}

If you want to see the data in the DB:

  • Use docker ps to get the CONTAINER_ID
  • Run docker exec -it <CONTAINER_ID> /bin/bash to access the containers shell
  • psql -U user -d chatbot should give you access to the postgres console, having already selected chatbot as the database we want to use
  • SELECT * FROM myapp_conversation; should be empty if you haven't sent a POST request and received the successfull response as seen above.
    chatbot=# SELECT * FROM myapp_conversation;
    id | userid | conversationid | optionpicked | state 
    ----+--------+----------------+--------------+-------
    (0 rows)
OR
    chatbot=# SELECT * FROM myapp_conversation;
    id | userid | conversationid | optionpicked | state 
    ----+--------+----------------+--------------+-------
    1 | 1      | 1              | 1            | state
    (1 row)

chat-bot's People

Contributors

hallocoos avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.