discovery-by-llm/backend/app/config.py
2026-08-10 11:31:06 +02:00

29 lines
834 B
Python

"""Typed application settings: the only reader of environment variables."""
from enum import StrEnum
from pydantic_settings import BaseSettings, SettingsConfigDict
class AppMode(StrEnum):
"""Runtime mode: live Spotify + Anthropic, or fixture-replay demo."""
LIVE = "live"
DEMO = "demo"
class Settings(BaseSettings):
"""Application settings, loaded from the environment or a .env file."""
model_config = SettingsConfigDict(env_file=".env", extra="ignore")
app_mode: AppMode = AppMode.DEMO
spotify_client_id: str = ""
spotify_redirect_uri: str = "http://127.0.0.1:8888/callback"
spotify_api_base_url: str = "https://api.spotify.com/v1"
spotify_timeout_seconds: float = 10.0
spotify_retry_after_cap_seconds: float = 5.0
session_cookie_secure: bool = False
settings = Settings()