https://github.com/ababaee1/llm_api_telegram_bot
Python Telegram bot with Large Language Models (OpenAI) integration for dynamic conversations.
https://github.com/ababaee1/llm_api_telegram_bot
large-language-models openai python-bot telegram-bot-api
Last synced: about 2 months ago
JSON representation
Python Telegram bot with Large Language Models (OpenAI) integration for dynamic conversations.
- Host: GitHub
- URL: https://github.com/ababaee1/llm_api_telegram_bot
- Owner: ababaee1
- License: mit
- Created: 2024-10-08T19:53:09.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-08T22:04:00.000Z (about 1 year ago)
- Last Synced: 2025-01-15T05:45:01.315Z (11 months ago)
- Topics: large-language-models, openai, python-bot, telegram-bot-api
- Language: Python
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Telegram Bot with OpenAI
A simple Telegram bot that chats using OpenAI's Large language model (LLM) ! THe code can be also used for any other LLM like claude or gemini ai with slight changes.
Follow these steps to set it up and start chatting.
## 🚀 Features
- Connects directly to OpenAI's API for dynamic responses.
- Easy setup with minimal configuration.
## 🛠Setup
### 1. Create Your Telegram Bot
- Message [BotFather](https://core.telegram.org/bots#botfather) on Telegram, send `/newbot`, and follow the steps.
- Copy your bot's token.
### 2. Get OpenAI API Key
- Sign up at [OpenAI](https://openai.com/) and grab an API key from the API keys section. (there is a free trial credits I believe)
### 3. Clone This Project
```bash
git clone https://github.com/ababaee1/LLM_API_Telegram_bot.git
cd LLM_API_Telegram_bot
```
### 4. Install Requirements
pip install -r requirements.txt
### 5. Set Up Environment Variables
enter the token values.
TELEGRAM_BOT_TOKEN=your_telegram_token
OPENAI_API_KEY=your_openai_key
### 6. 🚲 Run the Bot
python bot.py