A Python Telegram bot powered by Google's gemini-pro
LLM API
This is a Python Telegram bot that uses Google's gemini-pro LLM API to generate creative text formats based on user input. It is customized by DJ Papzin to be a fun and interactive way to explore the possibilities of large language models.
- Generate creative text formats like poems, code, scripts, musical pieces, etc.
- Stream the generation process, so you can see the text unfold in real-time.
- Reply to your messages with creative output.
- Easy to use with simple commands:
/start
: Greet the bot and get started./help
: Get information about the bot's capabilities.
- Send any text message to trigger the generation process.
- Send any image with captions to generate responses based on the image. (Multi-modal support)
- User authentication to prevent unauthorized access by setting
AUTHORIZED_USERS
in the.env
file (optional).
- Python 3.10+
- Telegram Bot API token
- Google
gemini-pro
API key - dotenv (for environment variables)
- Clone this repository.
- Install the required dependencies:
pip install -r requirements.txt
- Create a
.env
file and add the following environment variables:BOT_TOKEN
: Your Telegram Bot API token. You can get one by talking to @BotFather.GOOGLE_API_KEY
: Your Google Bard API key. You can get one from Google AI Studio.AUTHORIZED_USERS
: A comma-separated list of Telegram usernames or user IDs that are authorized to access the bot. (optional) Example value:shonan23,1234567890
- Run the bot:
python main.py
- Start the bot by running the script.
python main.py
- Open the bot in your Telegram chat.
- Send any text message to the bot.
- The bot will generate creative text formats based on your input and stream the results back to you.
- If you want to restrict public access to the bot, you can set
AUTHORIZED_USERS
in the.env
file to a comma-separated list of Telegram user IDs. Only these users will be able to access the bot. Example:AUTHORIZED_USERS=shonan23,1234567890
Command | Description |
---|---|
/start |
Greet the bot and get started. |
/help |
Get information about the bot's capabilities. |
/new |
Start a new chat session. |
We welcome contributions to this project. Please feel free to fork the repository and submit pull requests.
This bot is still under development and may sometimes provide nonsensical or inappropriate responses. Use it responsibly and have fun!
This is a free and open-source project released under the MIT License. See the LICENSE file for details.