Skip to content

Python: Build an array schema for variadic tuple parameters - #14692

Open
Anish Mehta (anishmehta24) wants to merge 1 commit into
microsoft:mainfrom
anishmehta24:fix/schema-variadic-tuple
Open

Anish Mehta (anishmehta24) wants to merge 1 commit into
microsoft:mainfrom
anishmehta24:fix/schema-variadic-tuple

Conversation

@anishmehta24

Copy link
Copy Markdown

Motivation and Context

KernelJsonSchemaBuilder treats tuple[int, ...] as a two-item tuple whose second item is the Ellipsis, so a function parameter typed that way gets this schema:

{"type": "array", "items": [{"type": "integer"}, {"type": "object"}]}

The model is told the argument is exactly one integer followed by an object, instead of a list of integers.

Description

When the tuple's arguments are (X, Ellipsis), build {"type": "array", "items": <schema of X>}, the same as list[X]. Fixed-length tuples like tuple[int, str] keep their per-position items. Added tests for tuple[int, ...] and Optional[tuple[str, ...]]; both fail on main.

Contribution Checklist

Copilot AI balanced review requested due to automatic review settings October 30, 2026 13:59
@anishmehta24
Anish Mehta (anishmehta24) requested a review from a team as a code owner October 30, 2026 13:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@semantic-kernel-automation semantic-kernel-automation Bot added the python Pull requests for the Python Semantic Kernel label Oct 30, 2026

This branch was successfully deployed

1 active deployment
github-app-auth — 990c1b88 Deployed Oct 30, 2026 by anishmehta24 via add_label #29508
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

python Pull requests for the Python Semantic Kernel

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants