Welcome to the Multimodal AI Telegram Bot project! This bot integrates multiple AI models to provide rich interactions via text and images on Telegram.
- Features
- Prerequisites
- Installation
- Configuration
- Usage
- Commands
- Project Structure
- Contributing
- License
- Multi-Model Support: Switch between AI models like Google Gemini, GPT-3.5, LLaMA 2, and Mistral AI.
- Multimodal Interaction: Send text or images, and the bot will analyze and respond accordingly.
- Contextual Conversations: Maintains conversation history for contextual interactions.
- Edited Message Handling: Responds to edited messages and updates previous bot messages.
- Group Chat Friendly: Works seamlessly in both private and group chats.
- Node.js: Version 14 or higher
- Telegram Bot Token: Obtain from @BotFather
- API Keys: Depending on the models you plan to use:
- OpenAI API Key
- Google Gemini API Key
- NVIDIA API Key
- Mistral AI API Key
- Hugging Face Token
-
Clone the Repository
git clone https://github.com/your-username/multimodal-ai-telegram-bot.git cd multimodal-ai-telegram-bot -
Install Dependencies
npm install
-
Create a
.envFileCreate a
.envfile in the root directory and add your API keys:TELEGRAM_BOT_TOKEN=your-telegram-bot-token OPENAI_API_KEY=your-openai-api-key GEMINI_API_KEY=your-gemini-api-key NVIDIA_API_KEY=your-nvidia-api-key MISTRAL_API_KEY=your-mistral-api-key HUGGINGFACE_TOKEN=your-huggingface-token
-
Configure
src/config.js: The configuration is handled by thesrc/config.jsfile, which reads from the.envfile.
-
Development Mode
npm run dev
-
Production Mode
npm start
You can interact with the bot on Telegram:
Bot Link: Phoenix Ai
- Private Chat: Start a conversation with your bot on Telegram.
- Group Chat: Add the bot to a group. Use commands and mention the bot in messages to interact.
-
General Commands
/start- Start the bot and display the welcome message./help- Display help information./clear- Clear the conversation history.
-
Model Selection Commands
/gemini- Switch to Google Gemini model./gpt- Switch to GPT-3.5 model./llama- Switch to LLaMA 2 model./mistral- Switch to Mistral AI model.
-
Image Generation
/imagine Your prompt here- Generate an image based on the prompt.
multimodal-ai-telegram-bot/
├── .env
├── .gitignore
├── package.json
├── package-lock.json
├── src/
│ ├── bot.js
│ ├── config.js
│ ├── services/
│ │ ├── gemini.js
│ │ ├── llama.js
│ │ ├── mistral.js
│ │ ├── openai.js
│ │ └── stablediffusion.js
│ └── utils/
│ ├── botmenu.js
│ ├── history.js
│ ├── input_constraints.js
│ └── output_message_format.js
src/bot.js: Main bot logic and message handlers.src/config.js: Configuration file handling environment variables.src/services: Contains API integration for different AI models.src/utils: Utility functions for command setup, conversation history, message formatting, and input constraints.
Contributions are welcome! Please follow these steps:
-
Fork the Repository
-
Create a Feature Branch
git checkout -b feature/your-feature-name
-
Commit Your Changes
git commit -m "Add your message" -
Push to the Branch
git push origin feature/your-feature-name
-
Open a Pull Request
This project is licensed under the MIT License.
Feel free to open an issue or pull request for any improvements or suggestions.