mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-15 05:04:27 +08:00
Refa: follow-up expose agent structured outputs in non-stream completions (#13524)
### What problem does this PR solve? Follow-up expose agent structured outputs in non-stream completions #13389. ### Type of change - [x] Documentation Update - [x] Refactoring --------- Co-authored-by: writinwaters <cai.keith@gmail.com>
This commit is contained in:
@@ -597,11 +597,12 @@ async def agent_completions(tenant_id, agent_id):
|
||||
reference.update(ans["data"]["reference"])
|
||||
|
||||
if ans.get("event") == "node_finished":
|
||||
node_out = ans.get("data", {}).get("outputs", {})
|
||||
if node_out.get("structured"):
|
||||
structured_output = node_out["structured"]
|
||||
data = ans.get("data", {})
|
||||
node_out = data.get("outputs", {})
|
||||
component_id = data.get("component_id")
|
||||
if component_id is not None and "structured" in node_out:
|
||||
structured_output[component_id] = copy.deepcopy(node_out["structured"])
|
||||
if return_trace:
|
||||
data = ans.get("data", {})
|
||||
trace_items.append(
|
||||
{
|
||||
"component_id": data.get("component_id"),
|
||||
|
||||
Reference in New Issue
Block a user