This is a Telegram bot that receives an image and replies with a description of the image using OpenAI's GPT-4 Vision model.
- Receives images from users via Telegram.
- Uses the GPT-4 Vision model to generate a textual description of the images.
- Responds to users with the description of the images.
- Python 3.9 or higher
- Install required Python packages:
pip install python-telegram-bot httpx python-dotenv
-
Clone the repository:
git clone <repository-url>
-
Navigate to the project directory:
cd telegram-gpt4-vision-bot
-
Install dependencies:
pip install -r requirements.txt
- Create a Telegram Bot:
- Create a new bot on Telegram by following the instructions here.
- Note down the API token provided by BotFather.
- Create a
.env
file in the project directory: Add your Telegram API token to the.env
file:
TELEGRAM_API_KEY=<your-telegram-api-token>
Run the bot script:
python3.9 vision-gpt-telegram.py
- Start a conversation with your bot on Telegram and send an image to receive a description.
You can deploy this bot on cloud platforms like Heroku, AWS, or Google Cloud Platform for continuous operation.
Contributions are welcome! Feel free to submit issues or pull requests.
Make sure to replace with the actual URL of your repository and with your Telegram API token. Feel free to modify it according to your project's requirements.