chatgpt-telegram-bot  by n3d1117

Telegram bot integrating OpenAI APIs

created 2 years ago
3,319 stars

Top 15.0% on sourcepulse

GitHubView on GitHub
Project Summary

This project provides a feature-rich Telegram bot that integrates with OpenAI's ChatGPT, DALL·E, and Whisper APIs, enabling users to interact with advanced AI models directly from Telegram. It targets Telegram users seeking a convenient interface for AI-powered text generation, image creation, and audio transcription, offering features like conversation summarization, token usage tracking, and plugin support for extended functionality.

How It Works

The bot leverages the python-telegram-bot library to handle Telegram interactions and the official OpenAI API client for AI model communication. It supports streaming responses, conversation history management with summarization to control token usage, and a plugin system that allows integration with external services like weather, Spotify, and web search. The architecture is designed for flexibility, allowing configuration of various OpenAI models (including GPT-4o, GPT-4 Turbo, DALL·E 3), proxies, and user access controls.

Quick Start & Requirements

  • Install: pip install -r requirements.txt or use Docker (docker compose up).
  • Prerequisites: Python 3.9+, OpenAI API key, Telegram Bot Token. Optional: ffmpeg for audio/video transcription.
  • Configuration: Copy .env.example to .env and fill in OPENAI_API_KEY and TELEGRAM_BOT_TOKEN.
  • Docs: OpenAI API Reference, Budget Manual, Translations Manual.

Highlighted Details

  • Supports latest OpenAI models including GPT-4o, GPT-4 Turbo, DALL·E 3, and Vision capabilities.
  • Extensible via a plugin system for weather, web search, Spotify, and more.
  • Features user-specific budgets, token usage tracking, and automatic conversation summarization.
  • Includes image generation (DALL·E), audio/video transcription (Whisper), and text-to-speech.
  • Offers Docker support for easier deployment and proxy configuration for network flexibility.

Maintenance & Community

The project has active contributions from multiple users, indicated by author tags next to new features. Community engagement is encouraged via issues and pull requests.

Licensing & Compatibility

Released under the GPL 2.0 license. This is a copyleft license, meaning derivative works must also be licensed under GPL 2.0. Commercial use or linking with closed-source applications may be restricted due to the GPL 2.0 license.

Limitations & Caveats

The GPL 2.0 license may impose restrictions on commercial use or integration into proprietary software. Some features, like streaming, are noted as incompatible with multiple response choices. The README mentions preliminary support for o1 and o1-mini models, suggesting potential instability or incomplete implementation for these.

Health Check
Last commit

2 months ago

Responsiveness

Inactive

Pull Requests (30d)
2
Issues (30d)
0
Star History
70 stars in the last 90 days

Explore Similar Projects

Feedback? Help us improve.