Telegram-Bot / config.py
H3y-sam's picture
Upload 54 files
94b42f2 verified
Raw History Blame Contribute Delete
3.07 kB
import os
from dotenv import load_dotenv
load_dotenv()
# ─────────────────────────────────────────────
# REQUIRED - Loads from .env file
# ─────────────────────────────────────────────
BOT_TOKEN = os.getenv("BOT_TOKEN", "") # From @BotFather
GROQ_API_KEY = os.getenv("GROQ_API_KEY", "") # From console.groq.com
GIST_ID = os.getenv("GIST_ID", "") # GitHub Gist ID
GIST_TOKEN = os.getenv("GIST_TOKEN", "") # GitHub Personal Access Token
GEMINI_API_KEY = os.getenv("GEMINI_API_KEY", "")
# Parse comma-separated list of IDs from .env
_admin_ids_raw = os.getenv("ADMIN_USER_IDS", "123456789")
ADMIN_USER_IDS = [int(uid.strip()) for uid in _admin_ids_raw.split(",") if uid.strip().isdigit()]
# ─────────────────────────────────────────────
# REPEAT PREVENTION
# ─────────────────────────────────────────────
HISTORY_DEPTH = 60
HISTORY_FILE = "data/content_history.json"
HISTORY_FILE_NAME = "content_history.json"
# ─────────────────────────────────────────────
# DYNAMIC CONFIGURATION (IMPORT INSTANCE DIRECTLY)
# ─────────────────────────────────────────────
from content.config_manager import config_manager
from content.syllabus_manager import syllabus_manager
# ─────────────────────────────────────────────
# SUBJECTS & CHAPTER POOL
# ─────────────────────────────────────────────
# The SUBJECTS dictionary is now handled dynamically by SyllabusManager via data/syllabus.json.
SUBJECT_ROTATION = {
"Monday": ["physics", "maths"],
"Tuesday": ["chemistry", "biology"],
"Wednesday": ["physics", "chemistry"],
"Thursday": ["maths", "biology"],
"Friday": ["physics", "chemistry", "maths"],
"Saturday": ["biology", "chemistry"],
"Sunday": ["physics", "maths", "biology"],
}
# ─────────────────────────────────────────────
# GEMINI SETTINGS
# ─────────────────────────────────────────────
GEMINI_MODEL = "gemini-2.0-flash"
GEMINI_MAX_TOKENS = 4500 # Sufficient for large MCQ sessions with detailed explanations
GEMINI_TEMPERATURE = 0.7