-
Notifications
You must be signed in to change notification settings - Fork 941
fix(ai): typings for functionDeclaration.parameters. #8948
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
base: main
Are you sure you want to change the base?
Conversation
🦋 Changeset detectedLatest commit: d2010c4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Vertex AI Mock Responses Check
|
Size Report 1Affected ProductsNo changes between base commit (30de503) and merge commit (d2730bf).Test Logs |
Size Analysis Report 1Affected ProductsNo changes between base commit (30de503) and merge commit (d2730bf).Test Logs |
24d05ab
to
562735c
Compare
Changeset File Check ✅
|
Fixes #8944
This fix allows passing an
ObjectSchema
created bySchema.object()
tofunctionDeclaration.parameters
without any TS errors. It also forbids passing a plain JSON object tofunctionDeclaration.parameters
if it has anoptionalProperties
property, as that is a convenience input method and should not be passed to the backend request. Users can still use therequired
property.I experimented with intercepting plain JSON objects passed to
functionDeclaration.parameters
and processing theoptionalProperties
into arequired
array but concluded there are too many places this needs to be done (on getGenerativeModel and on each of its methods, possibly on getImagenModel and others in the future) and it adds a lot of unneeded code for a case that can be handled simply by usingSchema.object()
or manually filling out therequired
field.