30 lines
725 B
Python
30 lines
725 B
Python
from pydantic_settings import BaseSettings
|
|
from functools import lru_cache
|
|
|
|
|
|
class Settings(BaseSettings):
|
|
"""Application settings loaded from environment variables."""
|
|
|
|
# Database Configuration
|
|
DATABASE_URL: str = "postgresql+asyncpg://myuser:mypassword@127.0.0.1:5432/mydatabase"
|
|
|
|
# LLM API Configuration
|
|
LLM_API_KEY: str
|
|
LLM_API_BASE: str = "https://api.openai.com/v1"
|
|
LLM_DEFAULT_MODEL: str = "openai/gpt-4o"
|
|
|
|
# App Configuration
|
|
DEFAULT_APP_NAME: str = "adk_chat_app"
|
|
|
|
class Config:
|
|
env_file = ".env"
|
|
extra = "ignore"
|
|
|
|
|
|
@lru_cache
|
|
def get_settings() -> Settings:
|
|
"""Get cached settings instance."""
|
|
return Settings()
|
|
|
|
|
|
settings = get_settings() |