Skip to content

Latest commit

 

History

History

gptbot

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

GPT chat bot engine

A simple GPT bot which, when asked directly, participates in the conversation using previous messages in the conversation as context. The bot is built using the OpenAI Python library.

IMPORTANT: The bot sends the last few messages in the conversation (for up to 30 minutes in the past by default) to OpenAI to generate a response. Please make sure you are aware of any privacy implications of that.

Once invited to a channel, the bot keeps track of the current conversation. When it encounters a message mentioning it, it responds using GPT to generate the response.

Note that while the bot keeps track of the current conversation even if it is not directly mentioned in the messages, it does NOT send anything to OpenAI until it is specifically menioned in the conversation.

gptbot1.mov

Dependencies

Installation

make install

This copies the bot's config as well as the bot script to the default config directory: ~/botmand-engines.

Edit ~/botmand-engines/gptbot.yaml and set the OPENAI_API_KEY variable. Check OpenAI documentation on signing up for the API and retrieving your API key.

If botmand is already running, make it reload its engines:

pkill -HUP botmand

Usage

At any point in any channel the bot is listening in (by default, #general), send a message to the bot by @mentioning it and ask it any question. The bot uses the last few messages in the conversation along with the question and uses OpenAI to generate a response.