Files
demo2-qwen/app/config.py

39 lines
698 B
Python
Raw Permalink Normal View History

2026-03-04 13:56:08 +08:00
"""
app/config.py - 应用配置管理
"""
from pydantic_settings import BaseSettings
from functools import lru_cache
class Settings(BaseSettings):
"""应用配置"""
# API 配置
api_key: str
2026-03-04 17:50:32 +08:00
model: str
base_url: str
2026-03-04 13:56:08 +08:00
# FastAPI 配置
fastapi_host: str = "0.0.0.0"
fastapi_port: int = 8000
fastapi_debug: bool = True
# LangGraph 配置
langgraph_debug: bool = False
# 项目信息
project_name: str = "AI Agent Project"
project_version: str = "0.1.0"
class Config:
env_file = ".env"
case_sensitive = False
@lru_cache()
def get_settings() -> Settings:
"""获取应用配置的单例"""
return Settings()