GithubHelp home page GithubHelp logo

flask-backend's Introduction

server

Flask server with our conversation endpoints, hosted on railways.

local development

Ensure that you have pyenv set up so that we can all use the same python version. Then run

pyenv install 3.9.<whatever>
python --version
# make sure its 3.9

python -m venv venv
# Make sure to add MONGODB_URL and OPENAI_API_KEY to the environment
# by accessing your venv/bin/activate file via nano and adding the export __=___ lines to the end of the file.
source venv/bin/activate
pip install -r requirements.txt

yarn dev

redirects

Requests are redirected to this server by vercel while undergoing local development. See vercel.dev.json for all redirected routes. More info can be found here

installing deps

The script ./bin/pip_install_and_save.sh installs a dependency and saves it to requirements.txt, please do this so that prod knows what to install. For brevity run

yarn pip-install <...stuff>

testing and debugging

You can run this to test backend functions when it's running

Example:

curl -d '{"question":"hello can you help?","domain":"Article"}' -H 'Content-Type: application/json' http://127.0.0.1:5000/initialize_convo_python

Returns: {"message": " Hi there! I'm a customer service chatbot for Playground. How can I help you today?", "id": "63b61a0f61724f40bf230164"}

curl -d '{"question":"hello can you help me sign in?","conversation_id":"63b61a0f61724f40bf230164"}' -H 'Content-Type: application/json' http://127.0.0.1:5000/generate_response_python

Returns: {"message": " Absolutely! To sign in to the Playground app, download either the iPhone or Android app and enter your login credentials. If you get an error, double check that the email is correctly formatted and that the password is correct. If you forgot your password, check our guide on resetting it.", "id": "63b61a0f61724f40bf230164"}

flask-backend's People

Contributors

michael-lutz avatar coffee-cup avatar railway-bot 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.