Skip to content

ababaee1/LLM_API_Telegram_bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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 on Telegram, send /newbot, and follow the steps.
  • Copy your bot's token.

2. Get OpenAI API Key

  • Sign up at OpenAI and grab an API key from the API keys section. (there is a free trial credits I believe)

3. Clone This Project

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

About

Python Telegram bot with Large Language Models (OpenAI) integration for dynamic conversations.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages