Talk to ChatGPT via any Matrix client!
Go to file
2023-01-29 19:35:17 +00:00
.github Update github actions to use cache and latest tag 2023-01-08 17:03:39 +00:00
img Add example screenshot 2022-12-09 21:09:14 +11:00
src Hotfix master 2023-01-28 13:04:56 +00:00
.env.example Update README 2023-01-27 21:01:40 +00:00
.gitignore Initial commit 2022-12-09 20:41:17 +11:00
.nvmrc Update and simplify Docker 2023-01-08 16:24:49 +00:00
Dockerfile Update Dockerfile 2023-01-19 17:43:55 +00:00
LICENSE Initial commit 2022-12-09 20:41:17 +11:00
package-lock.json Bump chatgpt from 3.3.13 to 3.5.1 2023-01-23 16:18:41 +00:00
package.json Bump version 2023-01-27 18:05:24 +00:00
README.md Update README.md 2023-01-29 19:35:17 +00:00
tsconfig.json Initial commit 2022-12-09 20:41:17 +11:00

Matrix ChatGPT Bot

Talk to ChatGPT via your favourite Matrix client!

Screenshot of Element iOS app showing conversation with bot

A Matrix bot that uses transitive-bullshit/chatgpt-api to access the unofficial ChatGPT API.

Usage

  1. Create a room
  2. Add the bot
  3. Start chatting away!

Features

  • Shows typing indicator as ChatGPT is thinking!
  • Supports encryption
  • Stores context for ChatGPT conversations

Configure

cp .env.example .env

You must adjust the settings in the .env file according to your needs.

Matrix

You need a Matrix account on Matrix.org (or any other server).

The bot outputs MATRIX_ACCESS_TOKEN to the console if it is not already set but MATRIX_BOT_USERNAME & MATRIX_BOT_PASSWORD are.

You must set MATRIX_ACCESS_TOKEN to use this token. Do not use it with any other client.

You no longer need MATRIX_BOT_PASSWORD set but you can leave it if you want.

OpenAI / ChatGPT

You must read the authentication instructions for chatgpt-api if you get stuck.

Using the same account at chat.openai.com may refresh tokens invalidating the bot's session.

Ensure your OpenAI account uses Google and set OPENAI_LOGIN_TYPE to google.

If the Google account uses 2FA it will fail but there is a workaround

Run

with Docker

This is the recommended way to run this project. It will use the latest stable release.

docker run -it -v storage:/storage --env-file=./.env --name matrix-chatgpt-bot ghcr.io/matrixgpt/matrix-chatgpt-bot:latest

or to build locally from the latest unstable release (only do this if you have a good reason):

docker build . -t matrix-chatgpt-bot
docker run -it -v storage:/storage --env-file=./.env --name matrix-chatgpt-bot matrix-chatgpt-bot

Note: Without -it flags in the command above you won't be able to stop the container using Ctrl-C

without Docker

It is strongly recommended you run this package under Docker.

  • yarn
  • yarn build
  • yarn start

in Development

You only need to do this if you want to contribute code to this package.

  • Run yarn
  • Run yarn build

Reporting issues

You must report issues via Github if you want support. The chat room is for discussion not first line tech support.

Discussion

Join #matrix-chatgpt-bot:matrix.org with any Matrix chat client or on the web!

If you've never set up a Matrix client before you can follow the prompts to get started.

Please use the search on Github and Matrix before asking for support.

License

GNU AGPLv3. See LICENSE