中文 | English
The objective of this project is to utilize OpenAI's API to create a chatbot that possesses unique characteristics and integrate it into an RPG game.
Currently, the project features two built characters, Li Ming and Avery Kim, whom you can interact with under the roleplay section of the demo. To participate, make sure to obtain your own OpenAI KPI and input it in the provided field at the bottom left. It's essential to note that the demo is a silent website without a backend, so your OpenAI API won't be transmitted to anyone. In addition to the two characters, you can also communicate with the basic chatgpt via the chat section.
Note: You can sign up for an API key from OpenAI. Generate an API key for OpenAI's service by following the instructions on the OpenAI website for free.
? demo




python3 -m venv venv to create a new virtual environment named "venv".source venv/bin/activate. On Windows, use .venvScriptsactivate instead.requirements.txt file using pip install -r requirements.txt in your terminal.config.py under the chatbot folder with name mine_config.py.python manage.py generate_secret_key in your terminal. Replace the SECRET_KEY in mine_config.py under the chatbot folder with the key that you generated.OPENAI_API_KEY in mine_config.py under the chatbot folder with your own key.Note: If you set up a virtual environment in step 2 you will need to activate it before running any commands related to the project. To activate the virtual environment, run source env/bin/activate. To deactivate it, simply run the deactivate command.
Before start the server, navigate to the root folder of the project in your terminal and run the command python manage.py migrate to apply the database migrations.
To run the chatbot, run the command python manage.py runserver. Then open your web browser and go to http://localhost:8000 to access the chatbot application.
This project provides an example of how to build a chatbot application using OpenAI's gpt-3.5-turbo. Feel free to modify the code to suit your needs, and don't forget to create your own secret key and API key when running the application.
This project is released under the MIT License.