mirror of
https://github.com/ThearchyHelios/AgentLab.git
synced 2026-11-24 09:22:00 +00:00
合入 W2-c 前端:分析卡节点与分析项编辑器、报告节点两个新字段、设置「分析」一节、问数据时间线的分析步骤与出具横幅三项、运行对比的分析卡一区、证据面板与正文接上分析结论(六步出处链、闭合核对、两期可比性、说法违规标注、分析范围)、可验证报告核对页与分析样本页、口径账本摘要防 NaN;服务端补分析工具事件里的判定与分析结论的单独出处接口
# Conflicts: # backend/tests/test_eval_schedule.py
This commit is contained in:
@@ -55,6 +55,7 @@ from app.tools.analysis import (
|
||||
SCOPE_KEY as ANALYSIS_SCOPE_KEY,
|
||||
AnalysisScope,
|
||||
call_error_text,
|
||||
event_view,
|
||||
input_snapshot,
|
||||
is_analysis_tool,
|
||||
payload_of,
|
||||
@@ -550,8 +551,11 @@ async def run_agent(state: GraphState, ctx: NodeContext) -> dict[str, Any]:
|
||||
query = query_entry_fields(content) if evidence_on and ok and is_platform_query(name) else None
|
||||
if query and not await snapshot_owned(query["artifact"], ctx.run.run_id, name):
|
||||
query = None
|
||||
# 分析工具交回的结论工件:同查询快照,记进 tool.end(封存范围内),证据接口、时间线从这里认这一步的结论
|
||||
# 分析工具交回的结论工件:同查询快照,记进 tool.end(封存范围内),证据接口、时间线从这里认这一步的结论。另带一小段
|
||||
# 判定(event_view:编号、算子、判定码、判定语……):preview 只是结论的前一截,判定语多半被截掉。编号和记台账时
|
||||
# 交回模型的「【分析 An】」是同一个(_record_call 紧接着按同一个容器编),不记台账的执行没有编号
|
||||
analysis = payload_of(content) if ok and is_analysis_tool(name) else None
|
||||
alias = scope.next_alias() if analysis and scope is not None and evidence_on else None
|
||||
ctx.emit(
|
||||
EventType.TOOL_END if ok else EventType.TOOL_ERROR,
|
||||
tool=name,
|
||||
@@ -560,7 +564,8 @@ async def run_agent(state: GraphState, ctx: NodeContext) -> dict[str, Any]:
|
||||
preview=content[:2000],
|
||||
artifact=snapshot_id,
|
||||
**({"query_artifact": query["artifact"]} if query else {}),
|
||||
**({"analysis_artifact": analysis["artifact"]} if analysis else {}),
|
||||
**({"analysis_artifact": analysis["artifact"], "analysis": event_view(analysis["result"], alias)}
|
||||
if analysis else {}),
|
||||
# 查询当时数据源的表结构快照:和查询快照一样落在封存范围内,证据接口从这里认它
|
||||
**({"schema_artifact": query["schema_artifact"]} if query and query.get("schema_artifact") else {}),
|
||||
# 这次查询的 SQL 检查结果单独带上:preview 截到前 2000 个字符,checks 通常在截掉的那段里
|
||||
|
||||
@@ -38,6 +38,7 @@ from app.tools.analysis import (
|
||||
SCOPE_KEY as ANALYSIS_SCOPE_KEY,
|
||||
AnalysisScope,
|
||||
call_error_text,
|
||||
event_view,
|
||||
input_snapshot,
|
||||
is_analysis_tool,
|
||||
payload_of,
|
||||
@@ -461,7 +462,9 @@ async def run_supervisor(state: GraphState, ctx: NodeContext) -> dict[str, Any]:
|
||||
agent=name, call_id=cid, preview=content[:1500],
|
||||
duration_ms=int((time.perf_counter() - started) * 1000), **failure,
|
||||
**({"checks": checks} if checks else {}),
|
||||
**({"analysis_artifact": analysis["artifact"]} if analysis else {}))
|
||||
# 判定的那一小段同 Agent 节点(event_view);编号是成员自己的分析容器里的,紧接着 _numbered 按它编
|
||||
**({"analysis_artifact": analysis["artifact"],
|
||||
"analysis": event_view(analysis["result"], scope.next_alias())} if analysis else {}))
|
||||
if analysis is not None and analysis["result"].get("status") == "refused":
|
||||
ctx.emit(EventType.LOG, level="warn", code=ANALYSIS_REFUSED, agent=name, call_id=cid, tool=tname,
|
||||
reason_code=analysis["result"].get("reason_code"),
|
||||
|
||||
Reference in New Issue
Block a user