"""Central configuration for the webapp demo backend.

Deliberately does not import anything from the repo's agents/ or utils/
packages (see webapp/backend/query_parser.py for why) -- this module only
knows about plain paths and constants.
"""

from pathlib import Path

# webapp/backend/config.py -> backend -> webapp -> repo root
BASE_DIR = Path(__file__).resolve().parents[2]
WEBAPP_DIR = BASE_DIR / "webapp"

DATA_DIR = WEBAPP_DIR / "data"
FRONTEND_DIR = WEBAPP_DIR / "frontend"

DATASET_DIR = BASE_DIR / "dataset"
CT_LABELS_PATH = DATASET_DIR / "TotalSegmentator_v2.json"
MRI_LABELS_PATH = DATASET_DIR / "TotalSegmentator_MRI.json"

OAI_CONFIG_PATH = BASE_DIR / "OAI_CONFIG_LIST"

# Model used for query parsing and label disambiguation. Confirmed present
# and working in OAI_CONFIG_LIST during development of this app -- change
# here if the entry in OAI_CONFIG_LIST changes.
MODEL_NAME = "deepseek-v4-flash"

# TotalSegmentator quality mode. Fixed to fast (3mm) for demo responsiveness;
# no UI toggle by design (confirmed with the user).
FAST_MODE = True

# Reject uploads larger than this (bytes).
MAX_UPLOAD_BYTES = 1024 * 1024 * 1024  # 1 GiB

# Delete job directories older than this many seconds on each new request.
JOB_MAX_AGE_SECONDS = 60 * 60  # 1 hour

ALLOWED_UPLOAD_EXTENSIONS = (".nii.gz", ".nii")
