"""应用配置(env 解析)。提供商注册/档位默认见后续阶段。""" from __future__ import annotations from functools import lru_cache from pydantic_settings import BaseSettings, SettingsConfigDict class Settings(BaseSettings): model_config = SettingsConfigDict(env_file=".env", extra="ignore") app_env: str = "dev" log_json: bool = False database_url: str = "postgresql+asyncpg://writer:writer@localhost:5432/writer" database_url_sync: str = "postgresql+psycopg://writer:writer@localhost:5432/writer" credential_enc_key: str = "" # 档位默认(writer/analyst/light)——具体 provider:model 经 tier_routing 覆盖 tier_defaults: dict[str, str] = { "writer": "deepseek:deepseek-chat", "analyst": "deepseek:deepseek-chat", "light": "deepseek:deepseek-chat", } @lru_cache def get_settings() -> Settings: return Settings()