Gemi is a Telegram chat bot that leverages the gemini-pro
API for text-based message generation and Bing for image generation. It is designed to interact with users by processing text and image inputs and responding appropriately.
gemini-pro
generative model.Use the button below to deploy your own Gemi bot on Render.
Note: You need a Render account to use this. Or, create your free account here.
To get started with Gemi chat bot, follow these steps:
gemini-pro
from hereBing AI
from here, used for image generation (optional)git clone https://github.com/Akash98Sky/gemi-chat-bot.git
cd gemi-chat-bot
pip install -r requirements.txt
Create a .env file at the root of the project directory with the following environment variables:
BOT_TOKEN=<your_telegram_bot_token>
GOOGLE_API_KEY=<your_gemini_pro_api_key>
BING_COOKIE=<your_bing_auth_cookie>
# Webhook settings to wake up the bot (optional) - required only if your service spins down while idle (e.g.: Heroku, Render)
APP_HOSTNAME=<your_webhook_host> (e.g.: abc.xyz.com)
WEBHOOK_SECRET=<your_webhook_secret>
# Voice API settings
VOICE_API_URL=<your_voice_api_url>
TTS_VOICE=festival:cmu_us_slt_arctic_hts
STT_ENGINE=vosk
Use gunicorn to launch the application:
gunicorn main:web_app --bind 0.0.0.0:8080 -k aiohttp.GunicornWebWorker
Replace 8080 with the port you want to run your web server on.
If you want to use the Gemi voice API, follow the instructions below:
git clone https://github.com/Akash98Sky/gemi-voice.git
cd gemi-voice && pip install -r requirements.txt
uvicorn main:app --host 0.0.0.0 --port 2024
VOICE_API_URL=http://0.0.0.0:2024
TTS_VOICE=edge:en-IN-NeerjaExpressiveNeural
STT_ENGINE=vosk
Have ngrok
installed on your local machine. If you don't have it installed, download it from ngrok's website and follow their installation instructions.
Ensure your local server is ready to receive webhooks.
Steps
Start Your Local Server Ensure that your local server is running on a specific port. For example, if you're using a Node.js Express server, it might be running on port 8080.
Run Ngrok
Open a new terminal window and run ngrok to expose your local server to the internet. Replace 8080
with the port number your local server is using.
ngrok http 8080
For more details on how to use and extend the bot, refer to the inline documentation within the code and the official aiogram and google-generativeai libraries documentation.
Contributions are welcome. Please submit pull requests or create issues for any features or fixes.
This project is open-sourced under the MIT License.