Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/marcoworms/prismagenius
Telegram bot that answers questions by sourcing answers from docs and codebases
https://github.com/marcoworms/prismagenius
Last synced: 27 days ago
JSON representation
Telegram bot that answers questions by sourcing answers from docs and codebases
- Host: GitHub
- URL: https://github.com/marcoworms/prismagenius
- Owner: MarcoWorms
- Created: 2024-01-03T16:04:44.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-25T19:55:18.000Z (12 months ago)
- Last Synced: 2024-04-14T01:58:04.298Z (9 months ago)
- Language: Python
- Size: 76.2 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PrismaGenius
## Running your own bot
### 1. Replace [`knowledge-base.txt`](./knowledge-base.txt) with your own knowledge-base
- Delete the existing .ext
- Add your stuff in [`knowledge-base`](./knowledge-base)
- Run `python concat.py` to compile the above folder into [`knowledge-base.txt`](./knowledge-base.txt)### 2. Set `OPENAI_API_KEY` and `TELEGRAM_TOKEN` environment variables.
- `OPENAI_API_KEY`: https://platform.openai.com/api-keys
- `TELEGRAM_TOKEN`: https://t.me/BotFather> You can test requests using `python request.py` without a telegram token
### 3. Override instructions and `owner_id` to fit your usage.
- You can find your owner id at https://t.me/username_to_id_bot
### 4. Run or deploy to cloud
- run locally with docker, or: `pip install -r "requirements.txt"` then `python bot.py`
- or deploy to cloud with https://fly.io: `flyctl deploy --ha=false` (atm the script only supports 1 machine, check the example [`fly.toml`](./fly.toml))
- add bot in a group and use `/add_group groupid` to whitelist it and the bot is ready to answer questions with `/prompt` whenever you want### 5. Configure the bot
- `/add_admin your_id` to add yourself as an admin
- `/add_group group_id` to add a new group with rate limiting of 10 messages/day