Ehrlich means "honest" in german, and it also happens to be my last name. This project is 100% for fun, so try not to take it too seriously.
This is a discord bot that uses OpenAI's GPT-3 API to generate responses to messages in a discord server.
It has several interesting features:
- Modifies its own prompt based on the context of the conversation
- Progressively summarized short term memory
- Long term memory summarization and storage
- Embedding based long term memory lookup
- Rudimentary ability to search the web for information
- gpt-4 support
TODOs (also see contributing):
- Voice integration
- DALL-E integration
- Come up with a more objective way to measure progress improving the prompt
I'm calling this good because the recollection went well. gpt-3.5-turbo still hallucinated that Aaron Burr was president, but that really is what we'd talked about before. It successfully looked up the weather from the internet a couple of times, but then came to the wrong conclusion about the temperature.
gpt-3.5-turbo seems to have completely ignored the first question. But when asked about it was eventually able to answer. What I really want to highlight is the summary taking a long time - improvements needed here.
If you want to help see the contributing
Copy .env.dist to .env and fill in variables with a valid DISCORD_BOT_TOKEN and OPENAI_API_KEY
Follow the steps found here https://python-poetry.org/docs/#installation to install poetry on your system.
-
Add the poetry dotenv plugin
poetry self add poetry-dotenv-plugin
-
Verify plugin is installed
poetry self show plugins
You should see something similar to the following:
poetry-dotenv-plugin (0.1.0) A Poetry plugin to automatically load environment variables from .env files 1 application plugin Dependencies - poetry (>=1.2.0a1) - python-dotenv (>=0.10.0) poetry-plugin-export (1.3.0) Poetry plugin to export the dependencies to various formats 1 application plugin Dependencies - poetry (>=1.3.0,<2.0.0) - poetry-core (>=1.3.0,<2.0.0)
-
Install project dependencies
poetry install
-
Run program
poetry run python main.py
-
Build the image
docker build . -t <imagename>:<tag>
-
Create a volume to persist conversations
docker volume create <some_vol_name>
-
Run program
docker run --env-file .env -v <some_vol_name>:/app/conversations <imagename>:<tag>
wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
# Install dependencies probably
sudo apt-get install -f
sudo dpkg -i google-chrome-stable_current_amd64.deb
sudo apt install chromium-chromedriver
sudo ln -s /usr/lib/chromium-browser/chromedriver /usr/local/bin/chromedriver