Skip to content

A Telegram bot that interacts with a language model to process user messages. The bot maintains a dialogue context, and also resets the dialogue context at the click of a button.

Notifications You must be signed in to change notification settings

Adjacentai/TelegramAiChatbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI-Powered Telegram Bot

Description

This project is a Telegram bot integrated with a local AI model launched on Olama. The bot accepts user messages, processes them using AI, and returns intelligent responses. It supports dialog context management and includes a reset feature through a button.

Features

  1. Message processing and analysis via AI.
  2. Dialog context management.
  3. Integration with a local AI model running on Olama.
  4. Reset button for clearing dialog context.
  5. Message length validation.

Installation

  1. Clone the repository and install dependencies:
git clone <URL>
cd <project-directory>
pip install -r requirements.txt
  1. Set up a .env file with your API keys and the AI server URL:
TG_API=<Your Telegram bot token>
OPENAI_API=<Your OpenAI API key>
MODEL_URL=<URL of your local AI server>
MODEL_NAME=<Name of the model on your server>

Launch the local AI server using Olama.

Run the bot:

python main.py

Main Files

aibot.py: Handles interaction with the local AI model. bot.py: Sets up and runs the Telegram bot. commands.py: Processes commands and user messages.

About

A Telegram bot that interacts with a language model to process user messages. The bot maintains a dialogue context, and also resets the dialogue context at the click of a button.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages