POD 趋势感知 Agent:缓存热点模式 + 三图合成 + 热点去重/风格去重 + review 兜底

- 缓存热点批量流程(有采集缓存不触发 Google)
- 简报不足直接从采集缓存生成(轻量补齐)
- 三图合成(模特/印花/底图)+ 底图压缩 <2MB
- 热点去重→风格去重自动切换 + 不适合类目 review 兜底
- 透明背景(background=transparent)+ 提示词清洗(敏感词/背景描述)
- 任务前 basemap 校验 + 模板国家校验 + 模特任务级分配
This commit is contained in:
2026-08-22 14:14:01 +08:00
commit f493bde8a9
98 changed files with 10280 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
"""节点 3/6:打分(score)。
归一化(按 source/kind 分组 min-max-> 跨源融合(combine-> 综合分阈值预筛。
纯逻辑节点,with_fallback 兜底。
"""
from typing import Any, Dict, List
from graph.scoring import combine, normalize
from graph.validate import with_fallback
@with_fallback("score")
def score_node(state: Dict[str, Any]) -> Dict[str, Any]:
rows: List[Dict[str, Any]] = state.get("filtered_rows") or []
config = state["config"]
weights = config.get("weights") or {}
llm_cfg = config.get("llm_screen") or {}
min_score = float(llm_cfg.get("min_score", 0.0))
normalize(rows)
combined = combine(rows, weights)
combined = [c for c in combined if float(c.get("score", 0)) >= min_score]
stats = dict(state.get("stats") or {})
stats["score"] = {"combined": len(combined)}
return {"scored_rows": combined, "stats": stats}