No description
Find a file
2023-04-16 14:29:28 +00:00
.gitignore Initial working version 2023-04-16 14:08:57 +00:00
config.dist.ini Initial working version 2023-04-16 14:08:57 +00:00
gptbot.py Fix 2023-04-16 14:29:28 +00:00
LICENSE Initial working version 2023-04-16 14:08:57 +00:00
README.md Fix 2023-04-16 14:29:28 +00:00
requirements.txt Initial working version 2023-04-16 14:08:57 +00:00

GPTbot

GPTbot is a simple bot that uses the OpenAI ChatCompletion API to generate responses to messages in a Matrix room.

It will also save a log of the spent tokens to a sqlite database (token_usage.db in the working directory).

Installation

Simply clone this repository and install the requirements.

Requirements

  • Python 3.8 or later
  • Requirements from requirements.txt (install with pip install -r requirements.txt in a venv)

Configuration

The bot requires a configuration file to be present in the working directory. Copy the provided config.dist.ini to config.ini and edit it to your needs.

Running

The bot can be run with python -m gptbot. If required, activate a venv first.

You may want to run the bot in a screen or tmux session, or use a process manager like systemd.

Once it is running, just invite it to a room and it will start responding to messages.

License

This project is licensed under the terms of the MIT license.