Skip to content

Carry JSON Schema type for optional tool fields - #8248

Open
Ege (ege-arhan) wants to merge 1 commit into
microsoft:mainfrom
ege-arhan:fix-6848-gemini-optional-schema
Open

Ege (ege-arhan) wants to merge 1 commit into
microsoft:mainfrom
ege-arhan:fix-6848-gemini-optional-schema

Conversation

@ege-arhan

Copy link
Copy Markdown

Ran into this while looking at #6848 — optional tool args like country: Optional[str] = None come out of BaseTool.schema without a top-level type, just anyOf. Some providers (Gemini in that report) reject the declaration because a property has no type field.

This just copies the non-null branch's type up when there's exactly one, so anyOf stays untouched and everything else renders the same as before.

Checked test_tools.py locally, 39 passed.

@ege-arhan

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

This branch has not been deployed

No deployments
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.

1 participant