统一:DSH 智能分析、Top100 与图表静默恢复
接入 DSH 专用运行时和对话界面,保留模型原始回答,支持会话分页、连续追问与显式报告。 补齐组合筛选、各维度 Top100、分组查询到排名图的转换,图表故障静默省略并基于保存数据自动恢复。 优化报告风格、图表顺序和表格换行,更新接入说明及构建输入。 验证:独立目录前后端构建通过;118 项 Java、102 项前端、102 项图表、14 项 DSH 应用和 13 项组合筛选检查通过。 仅提交相关源码、锁定依赖与测试;不包含凭据、会话、业务数据或本地产物。
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
"""Deliver the original model body when the user requests a report."""
|
||||
import re
|
||||
|
||||
_REQUEST = re.compile(
|
||||
r"(?:生成|输出|编写|撰写|写|制作|形成|起草|给我|提供|整理(?:为|成)|出)"
|
||||
r"[^。!?;\n]{0,38}(?:报告|简报|排查纪要)|(?:分析|对比|质量|复盘|管理|诊断)(?:报告|简报)\s*[。!!??]*$"
|
||||
)
|
||||
_SKIP = re.compile(r"(?:不用|不必|不要|无需|不需要|别|避免|不(?=(?:再)?(?:生成|输出|编写|撰写|写|制作|形成|起草|提供|出)))\s*(?:另行|另外|单独|再)?\s*[^。!?;\n]{0,18}(?:报告|简报|排查纪要)")
|
||||
|
||||
|
||||
def requested(question, task=None):
|
||||
if not isinstance(question, str) or _SKIP.search(question):
|
||||
return False
|
||||
selection = (task or {}).get("aggregateSelection") or {}
|
||||
return bool(_REQUEST.search(question) or _REQUEST.search(selection.get("requestQuestion", "")))
|
||||
|
||||
|
||||
def attach(event, question):
|
||||
"""Use the original assistant body for an explicitly requested deliverable."""
|
||||
event.pop("_verifiedReportNarrative", None)
|
||||
if event.get("type") != "result":
|
||||
return
|
||||
event.pop("reportMarkdown", None)
|
||||
if not requested(question, event.get("agentTask")):
|
||||
return
|
||||
answer = event.get("modelAnswer")
|
||||
if not isinstance(answer, str) or not answer:
|
||||
return
|
||||
event["reportMarkdown"] = answer
|
||||
if not event.get("reportTitle"):
|
||||
heading = re.search(r"^#{1,6} +([^\n]+)", answer, re.M)
|
||||
event["reportTitle"] = heading[1] if heading else "质量分析报告"
|
||||
Reference in New Issue
Block a user