How kharepratyush/telegram_food_bot works
Project type and purpose
• This is a full-stack “bot” application that integrates with Telegram’s API to provide diabetic-friendly meal planning, food logging, and shopping list management.
• It leverages LLMs (OpenAI or Ollama) for conversational meal planning and uses SQLite for persistence.
File structure
• Top-level files:
• bot_v2.py – main entrypoint
• run.sh / supervisord.conf – scripts and configs for startup and auto-restart
• requirements*.txt – dependencies
• src/agents/ – encapsulates LLM agent logic:
• food_agent.py – domain logic for meals
• llm.py – LLM abstraction (OpenAI/Ollama selector)
• prompts.py, tools.py – prompt templates and helper functions
• utils/ – configuration and low-level DB helpers
• workflow/ – orchestrator for multi-step tasks
• src/telegram_bot/ – Telegram integration layer:
• config.py – environment and token loading
• handlers/ – per-command/message handlers (start, help, save, shopping_list, etc.)
• utils/ – DB access, table rendering, Telegram API wrappers
• tests/ – unit tests covering agents, handlers, and utilities
README for additional insights
• Supervisor integration: supervisord.conf for process management
• SQLite database under data/ (excluded from tree but referenced)
• Uses markdown and table rendering for responses
• Future extensibility points: GI API, knowledge base