General purpose Discord bot to interact with LLMs.
- Install the required packages with
pip install -r requirements.txt
- Create a new
bot_settings.py(seebot_settings.py.examplefor an example). Provide a Backend, a Discord Bot token and an OpenAI token. - Run the bot with
python main.py
On Discord the following commands are available:
!threadto start a new thread for the bot to watch and respond to.!chatto give one-shot responses.
The bot can be configured to use different backends. Currently, the following backends are available:
GPTTurboBackend: Uses the OpenAI API to generate responses withgpt-3.5-turbo.
To define a backend, provide overrides for the following functions:
def get_response(self, message_log: MessageLog, bot_name: str) -> str:: Returns a response to the given prompt. You are provided a message log which contains the chronological history of messages in the thread. The bot name is provided to allow the backend to filter out messages from the bot itself.def get_summary(self, message_log: MessageLog) -> str:: Returns a summary of the given message log.
- Basic chatbot functionality
- Basic thread functionality
- Basic backend functionality
-
gpt-3.5-turbobackend. -
gpt-jbackend.