feat(google-vertex): add support for streaming tool arguments input#13929
Merged
aayush-kapoor merged 34 commits intomainfrom Apr 9, 2026
Merged
feat(google-vertex): add support for streaming tool arguments input#13929aayush-kapoor merged 34 commits intomainfrom
aayush-kapoor merged 34 commits intomainfrom
Conversation
aayush-kapoor
commented
Mar 30, 2026
lgrammel
reviewed
Mar 31, 2026
lgrammel
reviewed
Mar 31, 2026
packages/google/src/google-generative-ai-language-model.test.ts
Outdated
Show resolved
Hide resolved
lgrammel
reviewed
Apr 1, 2026
lgrammel
reviewed
Apr 1, 2026
packages/google/src/google-generative-ai-language-model.test.ts
Outdated
Show resolved
Hide resolved
lgrammel
reviewed
Apr 8, 2026
packages/google/src/__snapshots__/google-generative-ai-language-model.test.ts.snap
Outdated
Show resolved
Hide resolved
lgrammel
approved these changes
Apr 9, 2026
Contributor
|
|
Contributor
|
🚀 Published in:
|
aayush-kapoor
added a commit
that referenced
this pull request
Apr 9, 2026
…ts input (#14267) This is an automated backport of #13929 to the release-v6.0 branch. FYI @aayush-kapoor This backport has conflicts that need to be resolved manually. ### `git cherry-pick` output ``` Auto-merging packages/google/src/google-generative-ai-language-model.test.ts Auto-merging packages/google/src/google-generative-ai-language-model.ts CONFLICT (content): Merge conflict in packages/google/src/google-generative-ai-language-model.ts Auto-merging packages/google/src/google-prepare-tools.ts error: could not apply 5036db8... feat(google-vertex): add support for streaming tool arguments input (#13929) hint: After resolving the conflicts, mark them with hint: "git add/rm <pathspec>", then run hint: "git cherry-pick --continue". hint: You can instead skip this commit with "git cherry-pick --skip". hint: To abort and get back to the state before "git cherry-pick", hint: run "git cherry-pick --abort". hint: Disable this message with "git config set advice.mergeConflict false" ``` --------- Co-authored-by: Aayush Kapoor <83492835+aayush-kapoor@users.noreply.github.com> Co-authored-by: Aayush Kapoor <aayushkapoor34@gmail.com>
4 tasks
aayush-kapoor
added a commit
that referenced
this pull request
Apr 11, 2026
… doGenerate (#14352) ## Background #14314 introduced in #13929, we added support for streaming tool call arguments for the vertex provider. but the check for passing that parameter seeped through for doGenerate as well, producing an API error (the generate endpoint rejects that option) ## Summary - add a check to only pass `streamFunctionCallArguments` for doStream ## Manual Verification verified by running the example `examples/ai-functions/src/generate-text/google/vertex-grounding.ts` before and after the fix. before, it gave the api error. after: it resolves and produces an answer ## Checklist - [x] Tests have been added / updated (for bug fixes / features) - [x] Documentation has been added / updated (for bug fixes / features) - [x] A _patch_ changeset for relevant packages has been added (for bug fixes / features - run `pnpm changeset` in the project root) - [x] I have reviewed this pull request (self-review) ## Related Issues fixes #14314
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
google vertex announced that models on vertex can stream the arguments of a single function call in multiple parts/contents/responses. the aisdk supports this via
tool-input-deltabut google vertex needed more plumbing#11126
Summary
partialArgsobjects with typed values and JSON paths{ "jsonPath": "$.location", "stringValue": "Boston", "willContinue": true } { "jsonPath": "$.location", "stringValue": ", MA" } { "jsonPath": "$.brightness", "numberValue": 50 }which needs to be concatenated across chunks. and hence we need a tracking state in
accumulatedArgsapplyPartialArgsfunction to do the conversion fortool-input-deltaexpecting a string instead of an objectname+willContinue: trueand end with an empty functionCall: {}Manual Verification
verified by running
examples/ai-functions/src/stream-text/google/vertex-stream-function-call-args.tswith and without the providerOption definedbefore
Recording_2026-03-30_14.20.53.mp4
after
Recording_2026-03-30_14.21.13.mp4
Checklist
pnpm changesetin the project root)Related Issues
fixes #11126