- 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
- Adjust VARS inside .env
- Start
run_aio.py
/help
- Send a document on Telegram Chat
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.
- 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.
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.
- Clone the repository to your local machine:
git clone https://github.com/lemassykoi/ollama_telegram_bot.git
- Navigate to the project directory:
cd ollama_telegram_bot
- Install required Python packages:
pip install -r requirements.txt
- Open
.env
and fill in your Telegram bot token, username, and other necessary details. - Run the script using the following command:
python run_aio.py
Contributions are welcome! If you have any improvements or new features to suggest, please open an issue or submit a pull request.
This project is licensed under the MIT License - see the LICENSE file for details.
- 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