2023-03-17 20:11:13 -06:00
|
|
|
# MatrixGPT
|
|
|
|
|
2024-04-07 22:44:27 -06:00
|
|
|
_Chatbots for Matrix._
|
2023-03-18 02:30:12 -06:00
|
|
|
|
2024-04-10 16:42:52 -06:00
|
|
|
This bot supports OpenAI, Anthropic, and locally hosted models that use an OpenAI-compatible endpoint. It can run
|
2024-04-10 18:16:36 -06:00
|
|
|
multiple different models using different triggers, such as `!c4` for GPT4 and `!ca` for Anthropic, all through the same bot.
|
2024-04-08 00:38:21 -06:00
|
|
|
|
2024-04-10 16:42:52 -06:00
|
|
|
**Supported Services**
|
|
|
|
|
|
|
|
- OpenAI (+ vision)
|
|
|
|
- Anthropic (+ vision)
|
|
|
|
- Anthropic
|
|
|
|
- Bing Copilot
|
|
|
|
- ~~Dalle-3~~ (TODO)
|
2024-04-09 19:26:44 -06:00
|
|
|
|
2024-04-08 00:38:21 -06:00
|
|
|
<br>
|
|
|
|
|
2023-03-18 02:14:45 -06:00
|
|
|
## Install
|
|
|
|
|
2024-04-07 22:44:27 -06:00
|
|
|
1. Install requirements:
|
|
|
|
```bash
|
|
|
|
sudo apt install libolm-dev gcc python3-dev
|
|
|
|
pip install -r requirements.txt
|
|
|
|
```
|
2024-04-10 16:42:52 -06:00
|
|
|
2. Copy `config.sample.yaml` to `config.yaml` and fill it out with the bot's Matrix authentication and your OpenAI
|
|
|
|
and/or Anthropic API keys.
|
2024-04-08 00:38:21 -06:00
|
|
|
3. Start the bot with `python3 main.py`
|
|
|
|
|
2024-04-10 22:47:15 -06:00
|
|
|
[Pantalaimon](https://github.com/matrix-org/pantalaimon) is **required** for the bot to be able to talk in encrypted rooms.
|
|
|
|
|
|
|
|
If you are using Copilot, please read the extra documentation: [docs/Copilot.md](docs/Copilot.md)
|
2024-04-08 00:38:21 -06:00
|
|
|
|
|
|
|
I included a sample Systemd service (`matrixgpt.service`).
|
2024-02-22 14:56:34 -07:00
|
|
|
|
2023-03-19 16:01:36 -06:00
|
|
|
## Use
|
|
|
|
|
2024-04-10 16:42:52 -06:00
|
|
|
First, invite your bot to a room. Then you can start a chat by prefixing your message with your trigger (for
|
2024-04-11 14:32:38 -06:00
|
|
|
example, `!c hello`). The bot will create a thread when it replies. You don't need to use the trigger in the thread.
|
2024-04-07 22:44:27 -06:00
|
|
|
|
2024-04-08 00:38:21 -06:00
|
|
|
Use `!matrixgpt` to view the bot's help. The bot also responds to `!bots`.
|
2023-03-19 16:01:36 -06:00
|
|
|
|
2024-04-08 00:38:21 -06:00
|
|
|
<br>
|
2023-03-19 16:01:36 -06:00
|
|
|
|
2024-04-08 00:38:21 -06:00
|
|
|
- Don't try to use two bots in the same thread.
|
2024-04-10 18:16:36 -06:00
|
|
|
- You can DM the bot for a private chat.
|
2024-04-08 12:13:36 -06:00
|
|
|
- The bot will move its read marker whenever a message is sent in the room.
|
2024-04-07 22:44:27 -06:00
|
|
|
|
2024-04-08 00:38:21 -06:00
|
|
|
<br>
|
2023-04-19 13:22:15 -06:00
|
|
|
|
2023-04-08 15:13:09 -06:00
|
|
|
The bot can give helpful reactions:
|
|
|
|
|
2024-04-08 00:38:21 -06:00
|
|
|
- 🚫 means permission denied (not allowed to chat with the bot).
|
|
|
|
- 🕒 means the API timed out.
|
|
|
|
- ❌ means the bot encountered an exception.
|
2023-04-08 15:13:09 -06:00
|
|
|
- ❌ 🔐 means there was a decryption failure.
|
2024-04-09 19:34:05 -06:00
|
|
|
|
|
|
|
## TODO
|
|
|
|
|
2024-04-10 22:47:15 -06:00
|
|
|
- [ ] Add our own context mechanism to Copilot
|
2024-04-09 19:34:05 -06:00
|
|
|
- [ ] Dalle bot
|
2024-04-10 18:16:36 -06:00
|
|
|
- [ ] Improve error messages sent with reactions to narrow down where the issue occurred.
|
|
|
|
- [ ] Allow replying to an image post which will give a vision model an image + text on the first message.
|
|
|
|
- [ ] Fix the typing indicator being removed when two responses are generating.
|
|
|
|
- [ ] ~~Add vision to Copilot~~ (not doing, API to unstable).
|