You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

43 lines
1.2 KiB

2 years ago
# Requirements
`python3.7 -m pip install openai`
2 years ago
2 years ago
`python3.7 -m pip install dotenv-python`
2 years ago
2 years ago
`python3.7 -m pip install discord` (This should be the discord.py rewrite, not the pycord library)
OpenAI API Key (https://beta.openai.com/docs/api-reference/introduction)
2 years ago
2 years ago
Discord Bot Token (https://discord.com/developers/applications)
2 years ago
You can learn how to add the discord bot to your server via https://www.ionos.co.uk/digitalguide/server/know-how/creating-discord-bot/
2 years ago
Both the OpenAI API key and the Discord bot token needed to be loaded into a .env file in the same local directory as the bot file.
2 years ago
2 years ago
```
OPENAI_TOKEN="TOKEN"
2 years ago
2 years ago
DISCORD_TOKEN="TOKEN"
```
# Usage
2 years ago
2 years ago
`python3.7 bot.py`
# Commands
2 years ago
2 years ago
`!g` - Display help text for the bot
2 years ago
2 years ago
`!g converse` - Start a conversation with the bot, like ChatGPT
`!g end` - End a conversation with the bot.
2 years ago
`!gp` - Display settings for the model (temperature, top_p, etc)
2 years ago
2 years ago
`!gs <setting> <value>` - Change a model setting to a new value
2 years ago
2 years ago
`!g <prompt>` Ask the GPT3 Davinci 003 model a question.
2 years ago
`!gu` Estimate current usage details (based on davinci)
`!gs low_usage_mode True/False` Turn low usage mode on and off. If on, it will use the curie-001 model, and if off, it will use the davinci-003 model.