| 123456789101112131415161718192021222324252627282930 |
- from pydantic_settings import BaseSettings
- from functools import lru_cache
- class Settings(BaseSettings):
- """Application settings loaded from environment variables."""
- # Audiobookshelf Configuration
- abs_url: str
- abs_api_token: str
- # AI Configuration
- anthropic_api_key: str | None = None
- openai_api_key: str | None = None
- # Application Configuration
- database_url: str = "sqlite:///./absrecommend.db"
- secret_key: str = "change-me-in-production"
- host: str = "0.0.0.0"
- port: int = 8000
- class Config:
- env_file = ".env"
- case_sensitive = False
- @lru_cache()
- def get_settings() -> Settings:
- """Get cached settings instance."""
- return Settings()
|