In this repo, we will create an anime girl imitator chatbot using ChatGPT and Python.
First, create an OpenAI API key from the OpenAI website. If you haven't installed poetry yet, please install it.
pip install poetry
After cloning this repository, install the packages with poetry.
poetry install --with dev
The following information is required for project configuration:
- OpenAI API key (Required): Can be obtained from the OpenAI website.
- OpenAI model name (Optional): Please select from the listed models. The default is gpt-3.5-turbo.
- Username (Optional): Chatbot's username (Enter along with the password)
- Password (Optional): Chatbot's password (Enter along with the username)
- Share key (Optional): Set to true if you want to make it public. The default is false.
If you want external people to access the chatbot, you can set the share key to true. However, the link created by gradio can only be used for 3 days. Please refer to the gradio documentation for details.
When running on a local computer, create a .config.toml file in the project root directory and fill it out as follows:
[project]
openai_api_key = "OpenAI API key"
openai_model = "Model name"
username = "Username"
password = "Password"
share = false
When deploying, you can use the environment variables set in config.py.
To use locally, run the following command:
poetry run chatbot
To run tests, execute the following command:
poetry run pytest