by GentleLemon This project uses the new gpt-3.5-turbo model API from OpenAI and a Django webserver to make a simple chatbot frontend to run it locally, consuming your own OpenAI credits by using your API Key.
Currently there are no models, just using the simplicity of Django as a webserver and using the OpenAI API to generate responses from prompts and a simple frontend to interact with the bot.
I've added Bootstrap to the frontend to make it look a bit nicer.
- Make sure you have a working account on OpenAI and have created an API key. Save it.
- Add the API key to the
OPENAI_API_KEY
environment variable.vi .env
- Install the requirements with
pip install -r requirements.txt
or alternatively create a virtual environment and install the requirements there. Make sure the environment variable is present in the virtual environment. - Run the server with
python manage.py runserver
. - Go to
http://127.0.0.1:8000/
to interact with the bot.
- 云部署请联系我