Spaces:
Sleeping
Sleeping
File size: 2,564 Bytes
408b7e6 | 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 57 58 59 60 61 62 63 64 65 66 67 68 69 | import os
from dotenv import load_dotenv
# Load the .env file from the project root
load_dotenv()
LOG_LEVEL = os.getenv("LOG_LEVEL", "INFO")
# --- 📂 DIRECTORY CONFIGURATION ---
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
TEMP_DIR = os.path.join(BASE_DIR, "temp_reports")
# Ensure storage exists for PDF and Audio processing on startup
os.makedirs(TEMP_DIR, exist_ok=True)
# --- 🌍 REGIONAL & APP CONFIGURATION ---
# The request 'locale' takes priority, but this is the safety fallback
DEFAULT_REGION = os.getenv("DEFAULT_REGION", "IN_NEP")
APP_NAME = os.getenv("APP_NAME", "LearningView Pro")
# --- 📧 SMTP CREDENTIALS (RAILWAY OPTIMIZED) ---
SMTP_SERVER = os.getenv("SMTP_SERVER", "smtp.gmail.com")
SMTP_PORT = int(os.getenv("SMTP_PORT", 465)) # Port 465 for SMTP_SSL
SMTP_USER = os.getenv("SENDER_EMAIL", "arrowinthedust@gmail.com")
SMTP_PASSWORD = os.getenv("SENDER_PASSWORD")
# --- 🛡️ SECURITY & CORS ---
CORS_ORIGINS = [
"http://localhost:5173",
"http://127.0.0.1:5173",
"https://learningview.vercel.app",
"https://learningview-pro.vercel.app"
]
# --- 📖 ASSESSMENT PROMPTS (The Clinical Source of Truth) ---
# Any changes here will reflect across the UI and PDF transcription audit
ASSESSMENT_PROMPTS = {
"beginner": (
"The sun was very bright today. A small cat sat on the green grass. "
"It watched a blue bird fly high in the sky. Soon, it was time for lunch."
),
"intermediate": (
"During the summer holidays, we decided to explore the ancient forest "
"behind our grandmother's house. The trees were tall and the air was cool."
),
"advanced": (
"The intricate relationship between neurological development and linguistic "
"acquisition remains a primary focus of modern cognitive science."
)
}
# config.py update
WRITING_PROMPTS = {
"beginner": "The quick brown fox jumps over the lazy dog.", # Covers all alphabet letters
"intermediate": "A bright blue bird sang a song in the tall green tree.",
}
# --- 🧪 SCANNER & CLINICAL THRESHOLDS ---
DATA_PURGE_DELAY = 180 # 3-minute Zero-Persistence window
MIN_FPS_THRESHOLD = 28.0 # Minimum frame rate for reliable ocular sync
# Biometric Distance (in MediaPipe normalized units)
CLINICAL_DISTANCE_MIN = 0.075 # Too far
CLINICAL_DISTANCE_MAX = 0.13 # Too close
# Speech & Phonetic Timing
WHISPER_MODEL_SIZE = "base"
PHONETIC_GAP_THRESHOLD = 1.5 # Seconds of silence to trigger a "block"
STATIONARY_FRAME_THRESHOLD = 25 # Frames of eye-fixation to count a block |