Skip to content

Support additionalProperties in open api schema #5626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

tjenkinson
Copy link

@tjenkinson tjenkinson commented Apr 9, 2025

z.record(z.string()) as a property in tool parameters currently gets converted to undefined, which is invalid and causes an error from vertex ai.

This now gets converted to { type: 'object', additionalProperties: { type: 'string' } }, which works

fixes #5628

@tjenkinson tjenkinson force-pushed the support-additional-properties-open-api-schema branch from 3687f14 to bd8bc17 Compare April 9, 2025 11:17
@tjenkinson tjenkinson marked this pull request as ready for review April 9, 2025 11:23
`z.record(z.string())` currently gets converted to `undefined`, which is invalid and causes an error from vertex ai.

This now gets converted to `{ type: 'object', additionalProperties: { type: "string" } }`
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.

Requests to vertex ai fail if z.record(z.string()) used in tool schema
1 participant