feat: 增强审核智能体页Word导出能力卡展示
This commit is contained in:
@@ -85,6 +85,7 @@ def detail(request, conversation_id: str):
|
||||
active_node = "risk"
|
||||
conversation.refresh_from_db()
|
||||
workspace_summary = _build_workspace_summary(conversation, batch)
|
||||
export_card = _build_export_card(result, conversation)
|
||||
|
||||
return render(
|
||||
request,
|
||||
@@ -103,6 +104,7 @@ def detail(request, conversation_id: str):
|
||||
"active_node": active_node,
|
||||
"workspace_summary": workspace_summary,
|
||||
"upload_form": upload_form,
|
||||
"export_card": export_card,
|
||||
},
|
||||
)
|
||||
|
||||
@@ -240,6 +242,29 @@ def _build_workspace_summary(conversation: Conversation, batch: SubmissionBatch
|
||||
}
|
||||
|
||||
|
||||
def _build_export_card(result: AgentResult | None, conversation: Conversation) -> dict:
|
||||
"""
|
||||
统一组装 Word 导出能力卡上下文。
|
||||
|
||||
优先使用本次执行结果;若本次未执行,则回退到会话最新摘要。
|
||||
"""
|
||||
structured_output = {}
|
||||
if result and result.structured_output:
|
||||
structured_output = result.structured_output
|
||||
else:
|
||||
structured_output = (conversation.latest_summary or {}).get("structured_output") or {}
|
||||
if structured_output.get("output_type") != "registration_word_export_report":
|
||||
return {}
|
||||
return {
|
||||
"template_name": structured_output.get("template_name", ""),
|
||||
"template_version": structured_output.get("template_version", ""),
|
||||
"export_status": structured_output.get("export_status", ""),
|
||||
"filled_fields": structured_output.get("filled_fields") or [],
|
||||
"blocked_fields": structured_output.get("blocked_fields") or [],
|
||||
"download_url": structured_output.get("download_url", ""),
|
||||
}
|
||||
|
||||
|
||||
def _apply_agent_result_to_conversation(conversation: Conversation, result: AgentResult) -> None:
|
||||
conversation.task_status = result.status
|
||||
if result.node_results:
|
||||
|
||||
Reference in New Issue
Block a user