A simple ChatGPT using OpenAI's API:
- Original code: https://github.com/openai/gpt-discord-bot.
- Yes, I know how to make a fork but I don't want to.
- This bot is not supposed to remember context, too lazy to implement.
- This code removed all the moderation layer.
- Use at your own risk, no credit needed lol.
-
Copy
.env.example
to.env
and start filling in the values as detailed below. -
Go to https://beta.openai.com/account/api-keys, create a new API key, and fill in
OPENAI_API_KEY
. -
Open
config/config.yaml
to customize the bot prompt and add some example conversation. (Visit this repo for prompt idea: https://github.com/f/awesome-chatgpt-prompts). -
Or if you're too lazy to do step 3, just delete the
config.yaml
and renameconfig_*.yaml
intoconfig.yaml
-
Install dependencies
pip install -r requirements.txt
-
Run
python -m src.ui
to run the web UI.
- A new implementation of this using the new API can be found at: new-api branch
- There is some censored, moderator build in for that API, so it's not suitable for workflow that involve adult, violence stuffs lol
- Sometimes I wish AI should not tell us what is moral and what is ethical lol.
- This bot does not remember the context of past conversations. To implement this, you can include past conversations into the request.
- Too lazy to do that so I included the guide here, PR are welcomed.