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:
xiaji
2026-06-12 19:00:00 +08:00
parent 3ab6e4c7d0
commit bc36a1fc38
15 changed files with 2746 additions and 48 deletions

View File

@@ -126,9 +126,12 @@ async def list_articles(
published_at=art.published_at,
fetched_at=art.fetched_at,
image_url=art.image_url,
# 列表预览钩子:分类 + LLM 点评 + AI 插图 缩略图
# 列表预览钩子:分类 + LLM 点评(双 provider) + AI 插图 缩略图
commentary=art.commentary,
commentary_status=art.commentary_status,
commentary_meituan=art.commentary_meituan,
commentary_meituan_status=art.commentary_meituan_status,
commentary_engine=art.commentary_engine,
image_ai_url=art.image_ai_url,
is_starred=art.id in starred_ids,
)
@@ -190,8 +193,14 @@ async def get_article(
format_status=article.format_status,
classify_status=article.classify_status,
image_ai_status=article.image_ai_status,
# 双 provider 评论
commentary_status=article.commentary_status,
commentary=article.commentary,
commentary_engine=article.commentary_engine,
commentary_meituan_status=article.commentary_meituan_status,
commentary_meituan=article.commentary_meituan,
commentary_meituan_model=article.commentary_meituan_model,
commentary_meituan_error=article.commentary_meituan_error,
entities=article.entities,
sentiment=article.sentiment,
duplicate_of=article.duplicate_of,