首次提交

This commit is contained in:
lhr
2026-01-19 22:04:54 +08:00
parent 1fa5a4947a
commit 12ef0292b7
16 changed files with 1147 additions and 0 deletions

30
app/config.py Normal file
View File

@@ -0,0 +1,30 @@
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()