art by Yookie
Summarize recent messages sent in a group chat.
Defaults to a neutral style, but a custom style can be provided:
/summarize_chat
as a script for a podcast hosted by talking dogs
Attempts to summarize the main content of a web page.
Defaults to a neutral style, but a custom style can be provided:
/summarize_url
https://example.com/news_article
as though it's being presented as evidence in a court case
EXHIBIT A: E. coli Outbreak Linked to McDonald's Quarter Pounders
SUMMARY OF KEY FINDINGS
- Outbreak Overview: An E. coli outbreak linked to McDonald's Quarter Pounders has led to at least 49 illnesses across 10 states, including one death.
- Source of Contamination: A specific ingredient has not been confirmed as the source of the outbreak,
...
Analyze chat members' moods
• Summit: 💻 📊 🤖 / inquisitive, methodical, redundant
• SomeUser: 😍 ✨ 💖 / enamored, zealous, effusive
• AnotherUser: 😩 📉 😒 / despondent, lethargic, irritable
•...
Translates the text to requested language, or English by default.
Alternatively, just reply to any message from the chat and type /translate
to translate that message.
Supported languages (using suggested model Aya-23):
Arabic, Chinese (simplified & traditional), Czech, Dutch, English, French, German, Greek, Hebrew, Hindi, Indonesian, Italian, Japanese, Korean, Persian, Polish, Portuguese, Romanian, Russian, Spanish, Turkish, Ukrainian, and Vietnamese
Print statistics about the chat (only knows about stuff that's happened since bot was added to room)
📊 Chat Stats
• Total Messages: 100
• Last 2 days: 40 (40%)
🗣 Top Yappers - 2 days
1. SomeUser / 30 msgs (75%)
2. Summit / 10 msgs (25%)
⭐ Top Yappers - all time
1. Summit / 70 msgs (70%)
2. SomeUser / 30 msgs (30%)
- LLM chatroom summarization
- Aware of reply threads
- Aware of media presence (photo/video/etc) & captions on media
- Aware of current date/time and times of chat messages
- "Vibe check" summary of users' moods
- Translate messages & replied messages between different languages
- Summarize URLs
- If
/summarize_url
command is followed by a URL - or
/summarize_url
command is a reply to another msg containing a URL
- If
- Talk to the bot - send a message tagging bot using
@itsUsername
- Aware of current date/time and times of chat messages
- Nightly auto-delete of all chat data > 2 days old
- Automatically transcribe all voice messages sent in the chat & translate to English
- User settings/personalization
- Allow users to add a very short "bio" to be included with their messages in prompts so LLM functions use correct pronouns etc.
- Jannie features
- Granular authorization: only admins/mods can execute commands, etc.
- Customizable old-message-deletion timeframe
Designed to be deployed on Heroku with HuggingFace as the LLM API provider, but should be adaptable to anything.
- Handles 8000+ messages/day on 1x basic dyno with the cheapest Postgres ($7/month and $5/month respectively).
- HuggingFace Pro offers an OpenAI-compatible API for $9/month.
- Copy the master key encrypting your rails prod credentials config/credentials/production.key and make it available on your server as an environment variable
RAILS_MASTER_KEY
. - You can also set
RAILS_SERVE_STATIC_FILES
todisabled
if you want. - Set up nightly data auto-delete:
A rake task rake nightly_data_purge
is set up to purge old messages & other data from the DB. This is intended to be run nightly by a Heroku Scheduler task, but you could use any task scheduling system to run it.
Add the free Heroku Scheduler addon to your app and then configure it with:
- Run every day at 12:00am UTC (or whenever)
- Run command:
rake nightly_data_purge
- Install postgres, ruby, bundler, heroku CLI.
bundle install
- Setup database or whatever.
- Configure options in rails credentials (example: credentials.sample.yml).
- App expects two credentials files:
config/credentials/production.yml.enc
(config/credentials/production.key
) is for production onlyconfig/credentials.yml.enc
(config/master.key
) is for dev & test
-
just run
aka
-
heroku local --procfile=Procfile.dev
Only use this if you want to locally test the webhooks mode used in production for some reason (requires ngrok).
- Add your
ngrok_url
andtelegram_secret_token
to rails development credentials. - Start server with
rails s
. - After you're done, run
Telegram.bot.delete_webhook
in arails c
console to delete the webhook so poll mode works again.
-
just test
(aka
rubocop
andrspec
in parallel)