from typing import Optional import os try: # Pydantic v1 style from pydantic import BaseSettings except ImportError: # pragma: no cover - fallback for Pydantic v2 installs from pydantic_settings import BaseSettings # type: ignore class Settings(BaseSettings): """ Application configuration loaded from environment variables. """ DATABASE_URL: str = os.getenv( "DATABASE_URL", "sqlite:///./sundew_health.db", ) MODEL_WEIGHTS_PATH: Optional[str] = os.getenv("MODEL_WEIGHTS_PATH", "./checkpoints/ecg_classifier.pt") class Config: env_file = ".env" env_file_encoding = "utf-8" settings = Settings()