"""应用配置。 从环境变量读取配置,支持 .env 文件。 """ from pydantic_settings import BaseSettings class Settings(BaseSettings): """应用配置,从环境变量读取。""" # 应用 app_env: str = "development" app_debug: bool = True app_log_level: str = "info" # 数据库 database_url: str = "postgresql+asyncpg://postgres:postgres@localhost:5432/aiportpilot" # Redis redis_url: str = "redis://localhost:6379/0" # JWT jwt_secret_key: str = "change-me-in-production" jwt_algorithm: str = "HS256" jwt_access_token_ttl_minutes: int = 120 jwt_refresh_token_ttl_days: int = 7 # AI / LLM(千问 DashScope OpenAI 兼容模式) llm_api_key: str = "" llm_base_url: str = "https://dashscope.aliyuncs.com/compatible-mode/v1" llm_model: str = "qwen-plus" llm_timeout_seconds: int = 60 model_config = {"env_file": ".env", "env_file_encoding": "utf-8"} settings = Settings()