Spaces:
Runtime error
Runtime error
metadata
title: Telegram Test
emoji: 🤖
colorFrom: blue
colorTo: green
sdk: docker
pinned: false
🤖 Telegram Test Bot
A simple Telegram bot for testing Gemini AI integration with LangChain.
Features
- Basic Telegram bot integration
- Google Gemini AI responses
- LangChain conversation management
- MongoDB conversation storage
Environment Variables
Required secrets in HuggingFace Space settings:
TELEGRAM_BOT_TOKEN=your_telegram_bot_token
GOOGLE_API_KEY=your_google_api_key
MONGODB_URI=your_mongodb_connection_string
Local Development
pip install -r requirements.txt
python bot.py
Getting a Telegram Bot Token
- Open Telegram and search for @BotFather
- Send
/newbotcommand - Follow the instructions to create your bot
- Copy the bot token provided
- Add it as
TELEGRAM_BOT_TOKENsecret in HuggingFace Space settings
Technologies
- python-telegram-bot: Telegram Bot API wrapper
- LangChain: LLM orchestration framework
- Google Gemini: AI language model (gemini-2.0-flash-exp)
- MongoDB: Conversation history storage