from pydantic_settings import BaseSettings from functools import lru_cache class Settings(BaseSettings): # Database database_url: str = "postgresql://trivia:trivia@localhost:5432/trivia" # Redis redis_url: str = "redis://localhost:6379" # JWT jwt_secret: str = "dev-secret-key-change-in-production" jwt_algorithm: str = "HS256" jwt_expire_minutes: int = 1440 # 24 hours # Anthropic anthropic_api_key: str = "" # Game settings default_times: dict = { 1: 15, # 100 pts 2: 20, # 200 pts 3: 25, # 300 pts 4: 35, # 400 pts 5: 45, # 500 pts } default_points: dict = { 1: 100, 2: 200, 3: 300, 4: 400, 5: 500, } steal_penalty_multiplier: float = 0.5 steal_time_multiplier: float = 0.5 class Config: env_file = ".env" extra = "ignore" @lru_cache() def get_settings() -> Settings: return Settings()