feat: 实装AI改写结局功能 - 接入DeepSeek API - AI动态生成新结局名称 - 新增rewrite类型结局样式 - 修复请求超时问题

This commit is contained in:
2026-03-05 15:57:51 +08:00
parent 89b5a3b658
commit d47ccd7039
11 changed files with 513 additions and 15 deletions

View File

@@ -19,10 +19,23 @@ class Settings(BaseSettings):
server_port: int = 3000
debug: bool = True
# AI服务配置(预留)
# AI 服务配置
ai_service_enabled: bool = True
ai_provider: str = "deepseek"
# DeepSeek 配置
deepseek_api_key: str = ""
deepseek_base_url: str = "https://api.deepseek.com/v1"
deepseek_model: str = "deepseek-chat"
# OpenAI 配置(备用)
openai_api_key: str = ""
openai_base_url: str = "https://api.openai.com/v1"
# 微信小游戏配置(预留)
wx_appid: str = ""
wx_secret: str = ""
@property
def database_url(self) -> str:
return f"mysql+aiomysql://{self.db_user}:{self.db_password}@{self.db_host}:{self.db_port}/{self.db_name}"