feat(commentary): 双 provider 评论 — Angel(Agnes) + 美团大模型(LongCat)
- 新增 articles.commentary_meituan{_status,_model,_error} 4 列 + commentary_engine
- LlmSetting 加 meituan_api_key/base_url/chat_model/interval_sec/enabled/commentary_prompt
- 新 app/services/llm/providers.py 工厂,支持多 provider 客户端
- enrichment 流程改为 commentary_angel + commentary_meituan 并行(asyncio.gather),
任一 provider 失败不影响另一个
- enrichment_loop 状态判定:任一 provider 状态不是 ok 都视为待 enrich
- alembic 0004_dual_commentary 迁移
- 前端 Feed 卡片 + ArticleDetail 详情页各加一条'美团评论'卡
- AdminLlmSettings 加美团 provider 配置卡(独立 api_key 编辑器,不回显明文)
- LlmSettingOut.meituan_api_key_set (bool) 替代直接回传 key
- 默认 URL https://api.longcat.chat/openai/v1 / 默认模型 LongCat-2.0-Preview
This commit is contained in:
@@ -133,6 +133,14 @@ class Settings(BaseSettings):
|
||||
# 全局 LLM 调用间隔(秒),避免被限流
|
||||
llm_interval_sec: float = 2.0
|
||||
|
||||
# ===== 美团大模型 LongCat(双 provider 评论的第二个)=====
|
||||
# OpenAI 兼容端点;与 Agnes 并列,各自跑各自的 prompt,结果存到 articles 各自列
|
||||
# 留空 api_key = 不启用美团 provider(Angel 仍正常工作)
|
||||
meituan_api_key: str = ""
|
||||
meituan_base_url: str = "https://api.longcat.chat/openai/v1"
|
||||
meituan_chat_model: str = "LongCat-2.0-Preview"
|
||||
meituan_interval_sec: float = 2.0
|
||||
|
||||
# ===== 内部路径(部署后可调) =====
|
||||
project_root: Path = Path(__file__).resolve().parents[2]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user