from pathlib import Path from pydantic import BaseModel, Field class ProjectPaths(BaseModel): """Defines the standard file paths for the project.""" root: Path = Path(__file__).parent.parent.parent models_dir: Path = Field(default_factory=lambda: Path(__file__).parent.parent.parent / "models") data_dir: Path = Field(default_factory=lambda: Path(__file__).parent.parent.parent / "data") @property def model_path(self) -> Path: # Default model name return self.models_dir / "Qwen2-VL-2B-Instruct-Q4_K_M.gguf" class PerceptionSettings(BaseModel): """Tunable parameters for the vision system.""" frame_interval: int = 2 # Process 1 frame every X seconds ssim_threshold: float = 0.90 # Similarity threshold to skip frames (0.0 - 1.0) class Config(BaseModel): """Global Application Configuration.""" paths: ProjectPaths = Field(default_factory=ProjectPaths) perception: PerceptionSettings = Field(default_factory=PerceptionSettings) class Config: arbitrary_types_allowed = True # Singleton instance settings = Config()