Follow these steps to set up and run the Telegram bot:
- Ensure you have Python 3.x installed. You can download it from python.org.
- Install
pip
andvirtualenv
if they are not already installed.
-
Clone the repository
git clone <repository-url> cd devweek
-
Create and activate a virtual environment
python3 -m venv venv source venv/bin/activate
-
Install dependencies
pip install -r requirements.txt
-
Set up environment variables
- Create a
.env
file in the root directory and add your Telegram bot token:TG_BOT_TOKEN=your-telegram-b 6776 ot-token DEEPSKEE_API_KEY=your-deepkseek-api-key (optional)
- Create a
-
Start the bot
cd app && python main.py
- Deactivate the virtual environment
deactivate
src/
-- app/
---- bot/
------ handlers.py
------ keyboards.py
------ main.py
------ states.py
------ utils.py
---- ml/
------ db/
-------- df_embed_frida.pkl
-------- embed.pkl
...
------ scripts/
-------- rag_new.ipynb
...
------ llm/
-------- local_deepseek.py
-------- cloud_deepseek.py
-------- llm_factory.py
------ ocr/
-------- ocr.py
------ rag/
-------- issue_processor.py
-------- rag_faq.py
The ml
folder contains several submodules:
rag
-- contains the main logic of the issue processorocr
-- extracts text from uploaded imagesllm
-- contains llm instances and their configurations used in the project.scripts
-- contains independent scripts for data processing and database generationdb
-- contains embeddings for the knowledge-bases in pikle format
To build the project running on a local llm use
make local
To run the project with a cloud llm use
make cloud
Provide the DEEPSEEK_API_KEY
variable in the .env
config.