Files
muyingbaogaojiedu/后端-孕期报告解读-api/app/config.py
shutiaozhao127-boop cfdeeb5e41 chore: 初始化项目结构并添加基础配置文件
添加后端API和前端项目的初始目录结构,包括应用层模块、工具模块和模型定义
配置前后端的.dockerignore文件以排除开发环境文件
添加前端样式文件,包括字体、Tailwind CSS和主题配置
初始化Python虚拟环境中的类型标记文件
2026-04-01 16:55:24 +08:00

40 lines
1.0 KiB
Python

from pydantic_settings import BaseSettings
class Settings(BaseSettings):
# MongoDB
mongodb_url: str = "mongodb://localhost:27017"
mongodb_db_name: str = "pregnancy_report"
# JWT
jwt_secret_key: str = "change-this-secret-key"
jwt_algorithm: str = "HS256"
jwt_expire_minutes: int = 10080 # 7 days
# WeChat
wechat_app_id: str = ""
wechat_app_secret: str = ""
# AI API (OpenAI 兼容接口,如硅基流动)
ai_api_key: str = ""
ai_base_url: str = "https://api.siliconflow.cn/v1"
ai_vision_model: str = "Qwen/Qwen2.5-VL-72B-Instruct"
ai_text_model: str = "Qwen/Qwen2.5-72B-Instruct" # 使用更快的72B模型
# Upload
upload_dir: str = "./uploads"
max_file_size: int = 10 * 1024 * 1024 # 10MB
# CORS
cors_origins: str = "*" # 多个域名用逗号分隔,如 https://a.com,https://b.com
# Server
host: str = "0.0.0.0"
port: int = 8000
debug: bool = True
model_config = {"env_file": ".env", "env_file_encoding": "utf-8"}
settings = Settings()