Gemini Pro: An AI-powered Telegram bot script for generating text and image-based responses using Gemini AI
- 🍪 Text Prompt Response: Accepts text prompts and generates text.
- 🖼️ Image Recognition: Can read and interpret images.
Before you begin, ensure you have met the following requirements:
- Python 3.9 or higher.
pyrofork
,google-generativeai
andpillow
libraries.- A Telegram bot token (you can get one from @BotFather on Telegram).
- API ID and Hash: You can get these by creating an application on my.telegram.org.
- To Get
GOOGLE_API_KEY
Open GOOGLE_API_KEY.
To install pyrofork
, google-generativeai
and pillow
, run the following command:
pip install pyrofork google-generativeai pillow
Note: If you previously installed pyrogram
, uninstall it before installing pyrofork
.
- Open the
config.py
file in your favorite text editor. - Replace the placeholders for
API_ID
,API_HASH
,GOOGLE_API_KEY
, andBOT_TOKEN
with your actual values:API_ID
: Your API ID from my.telegram.org.API_HASH
: Your API Hash from my.telegram.org.GOOGLE_API_KEY
: To get google api key Click Here.BOT_TOKEN
: The token you obtained from @BotFather.
git clone https://github.com/bisnuray/GeminiProBot
cd GeminiProBot
python gemini.py
The bot supports the following commands:
/gem <prompt>
: Generates a response based on a provided text prompt./imgai <optional prompt>
: Generates a response based on an image. Ensure you reply to an image with the /imgai command. Optionally, you can provide a prompt along with the command, like/imgai What is this?
, while replying to a photo to get a more specific response.
- Name: Bisnu Ray
- Telegram: @SmartBisnuBio
Feel free to reach out if you have any questions or feedback.