Skip to content

AI-powered Telegram bot for voice transcription and summarization

Notifications You must be signed in to change notification settings

LeeseTheFox/Sumvoice

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sumvoice

A powerful Telegram bot that transcribes and summarizes voice messages and audio files using Groq's AI models. Users can then ask questions about the transcribed content for interactive conversations.

🎯 Features

  • Voice & Audio Transcription: Supports voice messages and audio files
  • AI-Powered Summaries: Provides concise summaries in multiple languages (English, Russian, Ukrainian)
  • Interactive Q&A: Ask questions about transcribed content
  • Whitelist System: Optional user access control with admin management
  • Multi-Language Support: Responds in the same language as the input
  • Auto .env Creation: Automatically creates configuration files

🚀 Quick start

Prerequisites

Installation

  1. Download ZIP or Git clone the repo
  1. Install dependencies

    pip install -r requirements.txt
  2. Run the bot

    python sumvoice_bot.py
  3. Configure your tokens and admin

    • The bot will automatically create a .env file on first run
    • Edit the .env file and add your actual configuration:
    TELEGRAM_TOKEN=your_actual_telegram_token
    GROQ_API_KEY=your_actual_groq_api_key
    ADMIN_ID=your_telegram_user_id
  4. Restart the bot

    python sumvoice_bot.py

⚙️ Configuration

Environment variables

The bot uses a .env file for configuration:

# Telegram Bot Configuration
TELEGRAM_TOKEN=your_telegram_token_here
GROQ_API_KEY=your_groq_api_key_here
ADMIN_ID=your_telegram_user_id_here

# Whitelist Configuration
WHITELIST_ENABLED=false
WHITELIST_IDS=123456789,987654321
Variable Description Default
TELEGRAM_TOKEN Your Telegram bot token Required
GROQ_API_KEY Your Groq API key Required
ADMIN_ID Your Telegram User ID (for admin privileges) Required
WHITELIST_ENABLED Enable/disable user whitelist false
WHITELIST_IDS Comma-separated list of allowed user IDs Empty

Finding your Telegram User ID

To set yourself as admin, you need your Telegram User ID:

  1. Message @userinfobot on Telegram
  2. Copy your User ID (numeric value)
  3. Add it to your .env file:
    ADMIN_ID=123456789

📱 How to Use

For regular users

  1. Send a voice message or audio file to the bot
  2. Get an AI summary of the content
  3. Ask questions about the transcribed content
  4. Start fresh by sending a new voice/audio file

Example workflow

🎤 [Send voice message: "Today I learned about machine learning..."]
🤖 Bot: "AI summary: Discussion about machine learning concepts and applications."

💬 You: "What specific topics were mentioned?"
🤖 Bot: "The audio mentioned neural networks, supervised learning, and data preprocessing techniques."

💬 You: "Can you explain more about neural networks?"
🤖 Bot: "Based on the audio, neural networks were described as..."

🛠️ Available commands

User commands

Command Description
/start Start the bot and get welcome message
/help Show help information

Admin commands

Command Description
/whitelist [user_id] Add a user to the whitelist
/toggle_whitelist Enable/disable the whitelist system

🔒 Whitelist system

The bot includes an optional whitelist system:

  • Disabled by default: Bot responds to everyone
  • Easy toggle: Admins can enable/disable with /toggle_whitelist
  • Persistent: Settings saved automatically to .env file
  • Silent filtering: Non-whitelisted users are simply ignored

Managing the whitelist

  1. Enable whitelist: /toggle_whitelist
  2. Add users: /whitelist 123456789
  3. Check status: /help (shows current state for admins)

🌍 Language support

The bot automatically detects and responds in:

  • English
  • Russian
  • Ukrainian

For other languages, responses default to English.

🔧 Technical details

Dependencies

  • python-telegram-bot - Telegram Bot API wrapper
  • groq - Groq AI API client
  • python-dotenv - Environment variable management
  • requests - HTTP requests for audio processing

AI models used

  • Transcription: whisper-large-v3-turbo
  • Summarization & Q&A: meta-llama/llama-4-maverick-17b-128e-instruct

File processing

  • Supports voice messages (.ogg format)
  • Supports audio files (various formats)
  • Temporary file handling with automatic cleanup
  • Direct API integration with Groq's transcription service

About

AI-powered Telegram bot for voice transcription and summarization

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages