feat(meituan): 政治类文章拦截 + 写'无可奉告' + Angel 并发 3→1
- llm_settings 加 meituan_blocked_topics / blocked_keywords / no_comment_text - alembic 0006 迁移,默认 topics=[时政/国际/军事/政治/战争/冲突/制裁/选举], 默认文案='无可奉告' - enrichment._is_meituan_blocked 预检:category 命中 topic 或 关键词 → 直接写'无可奉告',不调美团 API - 命中后 commentary_meituan_model='policy-block' 标识非真实生成 - enrichment_loop Semaphore(3)→(1),Agnes 免费 plan 不再 429 - 前端 AdminLlmSettings 美团卡片加 3 字段 UI(主题/关键词/固定文案)
This commit is contained in:
@@ -32,6 +32,10 @@ class LlmSettingOut(BaseModel):
|
||||
meituan_interval_sec: float = 2.0
|
||||
meituan_enabled: bool = True
|
||||
meituan_commentary_prompt: str | None = None
|
||||
# 美团"无可奉告"主题清单(命中则不调美团 API,直接写固定文案)
|
||||
meituan_blocked_topics: list[str] = []
|
||||
meituan_blocked_keywords: list[str] = []
|
||||
meituan_no_comment_text: str = "无可奉告"
|
||||
updated_at: datetime | None = None
|
||||
|
||||
@classmethod
|
||||
@@ -57,6 +61,9 @@ class LlmSettingOut(BaseModel):
|
||||
meituan_interval_sec=row.meituan_interval_sec,
|
||||
meituan_enabled=row.meituan_enabled,
|
||||
meituan_commentary_prompt=row.meituan_commentary_prompt,
|
||||
meituan_blocked_topics=row.meituan_blocked_topics or [],
|
||||
meituan_blocked_keywords=row.meituan_blocked_keywords or [],
|
||||
meituan_no_comment_text=row.meituan_no_comment_text or "无可奉告",
|
||||
updated_at=row.updated_at,
|
||||
)
|
||||
|
||||
@@ -84,6 +91,9 @@ class LlmSettingUpdate(BaseModel):
|
||||
meituan_interval_sec: float | None = Field(default=None, ge=0.0, le=60.0)
|
||||
meituan_enabled: bool | None = None
|
||||
meituan_commentary_prompt: str | None = None
|
||||
meituan_blocked_topics: list[str] | None = None
|
||||
meituan_blocked_keywords: list[str] | None = None
|
||||
meituan_no_comment_text: str | None = None
|
||||
|
||||
|
||||
# === 默认提示词(模板,用户可改)===
|
||||
|
||||
Reference in New Issue
Block a user