from functools import lru_cache from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): model_config = SettingsConfigDict(env_file=".env", env_file_encoding="utf-8", extra="ignore") # Security secret_key: str internal_secret: str = "dev-change-me-in-production" # Shared secret for internal service-to-service calls jwt_algorithm: str = "HS256" access_token_expire_minutes: int = 60 # 1 hour # Database database_url: str # postgresql+asyncpg://... # Redis redis_url: str = "redis://localhost:6379/0" job_queue_key: str = "rh:jobs" # App domain: str = "localhost" debug: bool = False # Additional CORS origins (comma-separated) cors_origins: str = "" # Worker analysis_version: str = "1.0.0" @lru_cache def get_settings() -> Settings: return Settings() # type: ignore[call-arg]