Call the API of open ai to build your own chatbot
- create .env file and add your api key to the newly created
.env
file.
FLASK_APP=app
FLASK_ENV=development
# Once you add your API key below, make sure to not share it with anyone! The API key should remain private.
OPENAI_API_KEY=
-
Create a new virtual environment:
$ python -m venv venv $ . venv/bin/activate
-
install flask-cors
$ pip install Flask flask-cors openai
-
install python-dotenv
$ pip install python-dotenv
-
run the app
$ flask run