Skip to content

feat(tools): Support tuple tool parameters#6076

Open
RaghunandanKumar wants to merge 3 commits into
google:mainfrom
RaghunandanKumar:fix/issue-3575
Open

feat(tools): Support tuple tool parameters#6076
RaghunandanKumar wants to merge 3 commits into
google:mainfrom
RaghunandanKumar:fix/issue-3575

Conversation

@RaghunandanKumar

Copy link
Copy Markdown

Summary

  • Support homogeneous tuple annotations such as tuple[float, float] and tuple[str, ...] in automatic function declarations.
  • Parse supported tuples as array schemas instead of falling back to Pydantic JSON schema fields that google.genai.types.Schema rejects.
  • Add regression coverage for tuple tool parameters and optional tuple parameters.

Fixes #3575

Verification

  • uv run pytest tests/unittests/tools/test_from_function_with_options.py -q
  • uv run pytest tests/unittests/tools -q
  • uv run pre-commit run --files src/google/adk/tools/_function_parameter_parse_util.py tests/unittests/tools/test_from_function_with_options.py

Parse homogeneous tuple annotations as array schemas for automatic function declarations instead of falling back to Pydantic JSON schema output that GenAI Schema rejects.

Fixes google#3575
@adk-bot adk-bot added the tools [Component] This issue is related to tools label Jun 11, 2026
@RaghunandanKumar RaghunandanKumar marked this pull request as ready for review June 11, 2026 02:55
@rohityan rohityan self-assigned this Jun 11, 2026
@rohityan rohityan added the request clarification [Status] The maintainer need clarification or more information from the author label Jun 11, 2026
@rohityan

Copy link
Copy Markdown
Collaborator

Hi @RaghunandanKumar , Thank you for your contribution! We appreciate you taking the time to submit this pull request. Can you please fix the failing mypy-diff tests before we can proceed with the review.

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

Labels

request clarification [Status] The maintainer need clarification or more information from the author tools [Component] This issue is related to tools

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Tuple for function tool signature

3 participants