Skip to content

Fix AgentWorkflow agent-level structured output#22163

Closed
Kevin-Li-2025 wants to merge 1 commit into
run-llama:mainfrom
Kevin-Li-2025:kevin/agentworkflow-agent-structured-output
Closed

Fix AgentWorkflow agent-level structured output#22163
Kevin-Li-2025 wants to merge 1 commit into
run-llama:mainfrom
Kevin-Li-2025:kevin/agentworkflow-agent-structured-output

Conversation

@Kevin-Li-2025

@Kevin-Li-2025 Kevin-Li-2025 commented Jun 27, 2026

Copy link
Copy Markdown

Summary

  • preserve an agent's structured_output_fn / output_cls when the agent is run through AgentWorkflow
  • keep workflow-level structured output configuration taking precedence
  • add a regression test for FunctionAgent(structured_output_fn=...) inside AgentWorkflow

Fixes #22159.

Tests

  • uv run --group dev pytest tests/agent/workflow/test_agent_with_structured_output.py::test_agent_structured_output_fn_agentworkflow tests/agent/workflow/test_agent_with_structured_output.py::test_structured_output_fn_agentworkflow tests/agent/workflow/test_agent_with_structured_output.py::test_structured_output_agentworkflow -q
  • uv run --group dev pytest tests/agent/workflow/test_agent_with_structured_output.py -q
  • uv run --group dev ruff check llama_index/core/agent/workflow/multi_agent_workflow.py tests/agent/workflow/test_agent_with_structured_output.py

@dosubot dosubot Bot added the size:S This PR changes 10-29 lines, ignoring generated files. label Jun 27, 2026
@Kevin-Li-2025

Copy link
Copy Markdown
Author

Closing this as a duplicate of #22162, which covers the same AgentWorkflow structured output fix and was opened first.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:S This PR changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: FunctionAgent.structured_output_fn is ignored when executed via AgentWorkflow

1 participant