Skip to content

A text based Telegram Bot on python using gemini 1.5 pro model api which can remember previous 30 messages from individual users on telegram using a queue data structure

License

Notifications You must be signed in to change notification settings

ImonChakraborty/jynxer-text

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Jynxer-Bot-Gemini-Context

Jynxer is a Python-based Telegram bot that provides text-based responses using gemini 1.5 pro while remembering the context of the last 30 messages. It's designed to enhance conversational interactions in Telegram chats.

Features

  • Contextual Responses: The bot maintains context by remembering the previous messages, allowing for more natural and context-aware replies.
  • Text-Based Interaction: Jynxer Bot responds to user messages with text-based replies.
  • Telegram Integration: The bot interacts with users via the Telegram API.
  • Memory Management: The bot keeps track of the last 30 messages to maintain context.

Setup

Before getting started, a few things needs to be set up as follows

  1. Getting the telegram bot API from @BotFather in telegram.

    • Write /start and select /newbot.
    • Now enter the name, in my case it is Jynxer, then enter a username for the bot, for me it is JynxerBOT.
    • Once you have done everything, botfather will provide you with your telegram bot API key (store it safely and securely and avoid sharing it with anyone).
  2. Getting the Gemini API key

Getting Started

  1. Installation:

    • Clone this repository:-
      git clone https://github.com/ImonChakraborty/jynxer-text.git
      
    • Install dependencies:-
      pip install -r requirements.txt
      
  2. Open JynxerTEXT.py on an editor and add your API keys:

    • The Telegram Bot API key here:-

      image

    • The Gemini API key here:-

      image

  3. Run the Bot:

    python JynxerTEXT.py
    

Usage

  • Start interacting with the bot, and it will maintain context for up to 30 messages and then start dequeuing process to maintain latest context.

Contributing

Contributions are welcome! Feel free to open issues or submit pull requests. Just make sure to provide proper explanation and documentation.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Releases

No releases published

Packages

No packages published

Languages