forked from rimu/Python-Flask-Chatbot-Quickstart
Use OpenAI API to build a chatbot with a custom system prompt.
- Python 48.5%
- HTML 39.4%
- CSS 12.1%
|
|
||
|---|---|---|
| static | add settings page for model and key | |
| templates | parse bot response as markdown | |
| .env.example | initial commit | |
| .gitignore | initial commit | |
| app.py | parse bot response as markdown | |
| LICENSE | initial commit | |
| README.md | update readme | |
| requirements.txt | parse bot response as markdown | |
| Screenshot.png | initial commit | |
ChatBot Quickstart
This is a minimalist starting point for a chat bot, written in Python. It uses the OpenAI API. Easily edit the system prompt to create a unique AI personality or function.
Setup
-
If you don’t have Python installed, install it from here.
-
Clone this repository.
-
Navigate into the project directory:
$ cd Python-Flask-Chatbot-Quickstart -
Create a new virtual environment:
$ python3 -m venv venv $ . venv/bin/activate -
Install the requirements:
$ pip install -r requirements.txt -
Make a copy of the example environment variables file:
$ cp .env.example .env -
Add your API key to the newly created
.envfile. -
Tell the AI how to behave by editing the file templates/system_prompt.txt.
-
Run the app:
$ flask run
You should now be able to access the app at http://localhost:5000! To learn more, check out the Open AI tutorial.