"""应用配置。 从环境变量读取配置,支持 .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 / Ollama ollama_base_url: str = "http://localhost:11434" ollama_model: str = "qwen2.5:7b" model_config = {"env_file": ".env", "env_file_encoding": "utf-8"} settings = Settings()