首次提交
This commit is contained in:
30
app/config.py
Normal file
30
app/config.py
Normal 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()
|
||||
Reference in New Issue
Block a user