A bot works with OpenAI GPT models to provide insights for your Telegram info flows.
Insights Bot ships with a set of commands, you can use /help
to get a list of available commands when talking to the bot in Telegram.
Command: /smr
Arguments: URL
Usage:
/smr https://www.example.com
By sending /smr
command with a URL, the bot will try to summarize the webpage and return the result.
Command: /enable_recap
Arguments: None
/enable_recap
Note This command requires user to be an administrator of the chat.
Warning This command will also enable the bot to rapidly send a chat history recap automatically for each 6 hours.
By sending /enable_recap
command, the bot will start to capture the chat histories and try to summarize them when you send /recap
command afterwards.
Command: /disable_recap
Arguments: None
/disable_recap
Note This command requires user to be an administrator of the chat.
Warning This command will also disable the functionalities of
/recap
command
By sending /disable_recap
command, the bot will stop capturing the chat histories and no longer respond to /recap
command.
By sending /recap
command, the bot will try to summarize the chat histories and return the result you choose later. Such as:
/recap
docker run -it --rm -e TELEGRAM_BOT_TOKEN=<Telegram Bot API Token> -e OPENAI_API_SECRET=<OpenAI API Secret Key> -e DB_CONNECTION_STR="<PostgresSQL connection URL>" insights-bot ghcr.io/nekomeowww/insights-bot:latest
Remember to replace your OpenAI token and other environment variables in docker-compose.yml
, and then run:
docker-compose up -d
If you prefer run docker image from local codes, then run:
docker-compose --profile local up -d --build
go build -a -o "release/insights-bot" "github.com/nekomeowww/insights-bot/cmd/insights-bot"
docker buildx build --platform linux/arm64,linux/amd64 -t <tag> -f Dockerfile .
Name | Required | Default | Description |
---|---|---|---|
TELEGRAM_BOT_TOKEN |
true |
Telegram Bot API token, you can create one and obtain the token through @BotFather | |
OPENAI_API_SECRET |
true |
OpenAI API Secret Key that looks like sk-************************************************ , you can obtain one by signing in to OpenAI platform and create one at http://platform.openai.com/account/api-keys. |
|
DB_CONNECTION_STR |
true |
PostgreSQL database URL. Such as postgres://postgres:postgres@localhost:5432/postgres . You could also suffix with ?search_path=<schema name> if you want to specify a schema |
|
OPENAI_API_HOST |
false |
https://api.openai.com |
OpenAI API Host, you can specify one if you have a relay or reversed proxy configured. Such as https://openai.example.workers.dev |
SLACK_CLIENT_ID |
false |
Slack app client id, you can create a slack app and get it, see: tutorial | |
SLACK_CLIENT_SECRET |
false |
Slack app client secret, you can create a slack app and get it, see: tutorial | |
SLACK_WEBHOOK_PORT |
false |
7070 |
Port for webhook server |
CLOVER_DB_PATH |
false |
insights_bot_clover_data.db |
Deprecated. /var/lib/insights-bot/insights_bot_clover_data.db in Docker volume, you can override the defaults -e CLOVER_DB_PATH=<path> when executing docker run command or modify and prepend a new CLOVER_DB_PATH the docker-compose.yml file. |
- Project logo was generated by Midjourney
- OpenAI for providing the GPT series models