Skip to content

Conversation

@jinnigu
Copy link
Contributor

@jinnigu jinnigu commented Nov 21, 2025

Fixes #587

Summary

Adds support for using both output_schema and tools simultaneously in Java ADK. Previously, LlmAgent threw an error when both were configured together. This feature enables structured output alongside tool usage by automatically injecting a special SetModelResponseTool.

Changes

Core Implementation

  • A new tool SetModelResponseTool
  • LlmAgent injects SetModelResponseTool when output_schema and tools are both present
  • Basic.java sets output_schema only when toolsUnion is empty
  • Removed validation error which prevented output_schema and tools combination

This achieves parity with Python ADK: feat: Support both output_schema and tools at the same time in LlmAgent adk-python@af63567

Testing

  • Added 4 unit tests for SetModelResponseTool
  • Updated LlmAgentTest to verify SetModelResponseTool injection
  • All tests pass

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

adk-python parity: support output schema with tools for LlmAgent

1 participant