GithubHelp home page GithubHelp logo

ollama-telegram-rag's Introduction

For Windows (not tested on Linux)

You need Ollama

Then :

  • Adjust VARS inside script
  • Start 1.upload.py to create a TXT file which will be parsed for RAG
  • After successful uploading, start run.py

Or :

  • Adjust VARS inside .env
  • Start run_aio.py
  • /help
  • Send a document on Telegram Chat

README - Ollama Telegram Bot Script

Overview

This Python script is designed to create an interactive Telegram bot that interacts with the Ollama API. The bot can handle text messages and documents such as PDFs, TXT, CSV, HTML, and JSON files for processing. It provides functionalities like RAG (Retrieval-Augmented Generation) mode and document embedding.

Features

  • Interaction with Telegram users through text messages and document uploads.
  • Handling various document types such as PDF, TXT, CSV, HTML, and JSON.
  • Retrieval-Augmented Generation (RAG) mode for contextual understanding of queries.
  • Document embedding feature for efficient processing of documents.

Prerequisites

Before running the script, ensure you have the following:

  • Python 3.6 or above.
  • A Telegram bot token and a valid username.
  • An active Ollama server with appropriate models configured.
  • Libraries specified in requirements.txt installed.

Installation & Usage

  1. Clone the repository to your local machine:
    git clone https://github.com/lemassykoi/ollama_telegram_bot.git
  2. Navigate to the project directory:
    cd ollama_telegram_bot
  3. Install required Python packages:
    pip install -r requirements.txt
  4. Open .env and fill in your Telegram bot token, username, and other necessary details.
  5. Run the script using the following command:
    python run_aio.py
    

Contributing

Contributions are welcome! If you have any improvements or new features to suggest, please open an issue or submit a pull request.

License

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

Acknowledgements

  • Thanks to the creators of Ollama and Telegram APIs for providing excellent tools.
  • Inspiration from various open-source projects in the AI and telegram bot communities.

Forked from https://github.com/AllAboutAI-YT/easy-local-rag and https://github.com/ruecat/ollama-telegram

ollama-telegram-rag's People

Contributors

lemassykoi avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.