feat: 增强注册审核节点式结果输出

This commit is contained in:
2026-06-04 01:10:40 +08:00
parent aa0a24fe5a
commit 11caa6c908
2 changed files with 104 additions and 0 deletions

View File

@@ -305,3 +305,50 @@ def test_registration_risk_result_includes_owner_fields_and_notification_payload
def test_supported_output_types_include_word_export_and_feishu_notification():
assert "registration_word_export_report" in SUPPORTED_OUTPUT_TYPES
assert "feishu_notification_report" in SUPPORTED_OUTPUT_TYPES
def test_registration_risk_report_builds_eight_business_nodes():
scenario = {
"id": "document_review",
"name": "注册审核智能体",
"agent": {
"role": "注册审核助手",
"goal": "输出风险结果",
"instructions": ["输出结构化风险结果"],
},
"rag": {"enabled": False},
"tools": [],
"output": {"type": "registration_risk_report"},
}
provider_response = """
{
"summary": "存在高风险项,需人工复核。",
"highest_risk_level": "high",
"pass_status": "blocked",
"owner_roles": [],
"notify_reason": "task_completed"
}
"""
class FakeProvider:
def generate(self, messages, response_format=None):
from agent_core.llm_provider import LLMResponse
return LLMResponse(content=provider_response, model_name="demo-model", success=True)
result = run_agent(scenario, "请输出风险结果", options={"llm_provider": FakeProvider()})
assert len(result.node_results) == 8
assert [node["label"] for node in result.node_results] == [
"资料包导入",
"目录汇总",
"法规完整性检查",
"字段抽取",
"一致性核查",
"风险预警",
"Word 回填导出",
"飞书通知",
]
assert result.node_results[5]["status"] == "已阻断"
assert result.node_results[6]["status"] == "待处理"
assert result.node_results[7]["status"] == "待处理"