Spaces:
Running

File size: 3,065 Bytes
94b42f2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
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