build: update dependency @ai-sdk/google to v4#289
Open
angular-robot wants to merge 1 commit into
Open
Conversation
See associated pull request for more information.
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.
This PR contains the following updates:
3.0.55→4.0.2Release Notes
vercel/ai (@ai-sdk/google)
v4.0.2Compare Source
Patch Changes
6a436e3]v4.0.1Compare Source
Patch Changes
ba6d510: chore: fix deprecated use of zod.passthrough()v4.0.0Compare Source
Major Changes
a3757d7: chore(provider/google): remove useless GenerativeAI affix from types and classes for consistencyf7d4f01: feat(provider): add support forreasoning-filetype for files that are part of reasoningef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only ("type": "module"). Consumers usingrequire()must switch to ESMimportsyntax.c29a26f: feat(provider): add support for provider references and uploading files as supported per provider3887c70: feat(provider): add new top-level reasoning parameter to spec and support it ingenerateTextandstreamText8359612: Start v7 pre-release04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbolsFor all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
Patch Changes
7f04802: feat(provider/google): add support for managed agents in the Interactions API38fc777: Add AI Gateway hint to provider READMEsb71c0d7: feat(provider/google): support Google search grounding when usinggenerateImagewith Gemini6190649: chore(provider/google): remove obsolete Google image model55db546: fix(provider/google): fix Gemini service tier enum after upstream update9a0a618: fix(google): fixserviceTierto be correctly formatted for Vertex API00a0f36: feat(google, google-vertex): addedgemini-embedding-2,deep-research-max-preview-04-2026anddeep-research-preview-04-20269715ec7: feat(provider/google): add support for service tier parameter41da50c: fix(provider/google): supportfunctionCall.idwhen returned by Gemini API and provide matchingfunctionResponse.idadd4326: fix(provider/google): correct JSDoc for multimodal embedding content optiona8d70b6: fix(google): auto-injectskip_thought_signature_validatorfor Gemini 3 tool-call replays without a signature947cdab: Add Google realtime Live Translation provider options forgemini-3.5-live-translate-preview.4e825f3: feat(google): update Interactions API implementation to cater for upstream breaking changes coming May 26b563707: feat(provider/google): add Gemini text-to-speech (speech) model supporta05109d: feat(provider/google): preserve per-modality token details in usage datacfca634: fix(google): emit Vertex no-args streaming tool calls and preserve thoughtSignatureVertex emits a no-args function call as a single chunk shaped
{ functionCall: { name: 'X' } }with noargs, nopartialArgs, and nowillContinue. The streaming parser had no branch for this shape, so the call was dropped along with anythoughtSignatureit carried. For Gemini 3 thinking models this caused the next multi-turn step to 400 withmissing thought_signature. The unary (doGenerate) path had the same drop.Both paths now emit the call as a complete tool call with
'{}'input and propagatethoughtSignatureprovider metadata.Fixes #14847.
c9c4661: fix(provider/google): preserve groundingMetadata and urlContextMetadata when they arrive in a stream chunk before the finishReason chunk045d2e8: fix(google): readserviceTierfromusageMetadata.serviceTierin both generate and stream pathsThe previous implementation read
serviceTierfrom thex-gemini-service-tierresponse header, which is only populated on non-streaming responses. Gemini
streaming includes the value in
usageMetadata.serviceTieron every chunk, soproviderMetadata.google.serviceTierwas alwaysnullfor streams. Read fromusageMetadatafor both paths instead.19b95f9: fix(google): use VALIDATED function calling mode when any tool has strict:true2ce3c65: feat(provider/google-vertex): add Gemini text-to-speech (speech) model support5878b40: fix(google): prevent prototype pollution when streaming tool args46d1149: chore(provider-utils,google): fix grammar errors in error and warning messages6a26901: feat(google): addfileDatasupport to embedding model01fa606: feat(provider/google): support combining built-in tools with function calling on Gemini 35036db8: feat(google-vertex): add support for streaming tool arguments input9f0e36c: trigger release for all packages after provenance setupa2609df: fix(google): fix streaming tool call argsab43029: feat(provider/google): support multimodal content parts in embedding provider options82288b0: feat(provider/google): addgemini-embedding-2-previewand fix multimodal embedding support withembedManyb04e23e: feat(provider/google): add support for the Gemini Interactions API58a2ad7: fix: more precise default message for tool execution deniale59176c: chore(google): update v3 specs to v4ebbb0f2: fix(provider/google): fix lack of image consistency when using Interactions API in stateless modeaeda373: fix: only send provider credentials to same-origin response-supplied URLsSeveral provider clients followed a URL taken from the provider's API response (a polling/status URL or a final media URL such as
polling_url,urls.get,result_url,result.sample, orvideo.uri) and reused the authenticated headers — or appended?key=<API_KEY>— on that request. Because the host of the response-supplied URL was never validated, the long-lived API key was sent to whatever host the response named (a CDN in the benign case, or an attacker-chosen host if the provider response was tampered with), allowing credential exfiltration.A new
isSameOriginhelper is added to@ai-sdk/provider-utils, and the affected fetches in@ai-sdk/black-forest-labs,@ai-sdk/fireworks,@ai-sdk/replicate,@ai-sdk/gladia,@ai-sdk/fal, and@ai-sdk/googlenow attach credentials only when the followed URL is same-origin with the provider's configured API origin. Requests to a foreign origin are made without the credential.7fc6bd6: Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.0c4c275: trigger initial canary releasebdb9ea1: chore(google): remove now obsolete Interactions APIApi-Revisionheaderdb394ab: feat(provider/google): support cancelling long-running Interactions API agents via AbortSignal, and process their intermittent streamce769dd: feat(provider): add experimental Realtime API support for voice conversationsAdds first-class support for realtime (speech-to-speech) APIs:
Experimental_RealtimeModelV4spec in@ai-sdk/providerwith normalized event types and factoryopenai.experimental_realtime()/google.experimental_realtime()/xai.experimental_realtime()work in both server and browser.getToken()static method on each provider for server-side ephemeral token creationexperimental_getRealtimeToolDefinitionshelper for provider session tool definitionsexperimental_useRealtimehook in@ai-sdk/reactreturningUIMessage[](aligned withuseChat), withonToolCallandaddToolOutputfor client-driven tool executioninputAudioTranscriptionsession config for showing transcribed user audio messages when supported by the provider5b7e7c2: fix(google-vertex): don't send streamFunctionCallArguments for unary API calls and change default to false2edd14e: fix(provider/google): correctly mark reasoning files as such and fix related multi-turn errors9bd6512: feat(provider): change file part data property to be tagged with a type and remove the image part type258c093: chore: ensure consistent import handling and avoid import duplicates or cycles546cefe: feat(provider/google): addgemini-3.5-flash5463d0d: feat(provider): align tool result output content file part types with top-level message file part types55f0938: chore(provider/google): update available modelsb8396f0: trigger initial beta release84f36e0: fix(google): omit passing includeServerSideToolInvocations for Vertex tool_config90e2d8a: chore: fix unused vars not being flagged by our lint tooling4dac142: feat(google): add new finishMessage field in providerMetadataaeea161: feat(google): readserviceTierfromx-gemini-service-tierresponse header in Gemini API and use PayGo for Vertex18c1970: feat(provider/google): Add multimodal tool-result support for Google function responses.Tool results with
output.type = 'content'now map media parts intofunctionResponse.partsfor Google models, includingimage-data,file-data, and base64data:URLs in URL-style content parts.Remote HTTP(S) URLs in URL-style tool-result parts are not supported.
b3976a2: Add workflow serialization support to all provider models.@ai-sdk/provider-utils: NewserializeModel()helper that extracts only serializable properties from a model instance, filtering out functions and objects containing functions. Third-party provider authors can use this to add workflow support to their own models.All providers:
headersis now optional in provider config types. This is non-breaking — existing code that passesheaderscontinues to work. Custom provider implementations that construct model configs manually can now omitheaders, which is useful when models are deserialized from a workflow step boundary where auth is provided separately.All provider model classes now include
WORKFLOW_SERIALIZEandWORKFLOW_DESERIALIZEstatic methods, enabling them to cross workflow step boundaries without serialization errors.ff5eba1: feat: rollimage-*tool output types into their equivalentfile-*typesv3.0.86Compare Source
Patch Changes
b30e43a]v3.0.85Compare Source
Patch Changes
f19334d]v3.0.84Compare Source
Patch Changes
1b40ac7: Publish all packages under the@ai-v6dist tag.1b40ac7]v3.0.83Compare Source
Patch Changes
779f5cd]v3.0.82Patch Changes
3258f22: fix(google): prevent prototype pollution when streaming tool argsbfa5864: fix: only send provider credentials to same-origin response-supplied URLsSeveral provider clients followed a URL taken from the provider's API response (a polling/status URL or a final media URL such as
polling_url,urls.get,result_url,result.sample, orvideo.uri) and reused the authenticated headers — or appended?key=<API_KEY>— on that request. Because the host of the response-supplied URL was never validated, the long-lived API key was sent to whatever host the response named (a CDN in the benign case, or an attacker-chosen host if the provider response was tampered with), allowing credential exfiltration.A new
isSameOriginhelper is added to@ai-sdk/provider-utils, and the affected fetches in@ai-sdk/black-forest-labs,@ai-sdk/fireworks,@ai-sdk/replicate,@ai-sdk/gladia,@ai-sdk/fal, and@ai-sdk/googlenow attach credentials only when the followed URL is same-origin with the provider's configured API origin. Requests to a foreign origin are made without the credential.Updated dependencies [
bfa5864]Updated dependencies [
f42aa79]v3.0.80Compare Source
Patch Changes
f62ffe0: fix(google): auto-injectskip_thought_signature_validatorfor Gemini 3 tool-call replays without a signatureGemini 3 models reject requests when an assistant
functionCallpart lacks athoughtSignaturewith HTTP 400"Function call is missing a thought_signature in functionCall parts."This is easy to hit when application code persists/serializes messages and dropsproviderOptions.google.thoughtSignature(custom DB schemas,useChatserver routes that rebuild messages, synthetic tool-call injection).The provider now detects this case (Gemini 3 model + missing signature under
google,googleVertex, andvertexnamespaces) and injects the documentedskip_thought_signature_validatorsentinel into the outboundfunctionCall, plus surfaces a one-shot warning per request listing the affected tool names so the developer can find and fix the upstream serialization. Non-Gemini-3 models are unaffected, and real signatures take precedence when present.v3.0.79Compare Source
Patch Changes
cfa0cb2: feat(provider/google): support Google search grounding when usinggenerateImagewith Geminiv3.0.78Compare Source
Patch Changes
cf63828: fix(google): readserviceTierfromusageMetadata.serviceTierin both generate and stream pathsThe previous implementation read
serviceTierfrom thex-gemini-service-tierresponse header, which is only populated on non-streaming responses. Gemini
streaming includes the value in
usageMetadata.serviceTieron every chunk, soproviderMetadata.google.serviceTierwas alwaysnullfor streams. Read fromusageMetadatafor both paths instead.v3.0.77Compare Source
Patch Changes
0f9f9bf: feat(google): readserviceTierfromx-gemini-service-tierresponse header in Gemini API and use PayGo for Vertexv3.0.75Compare Source
Patch Changes
ab15576: feat(google): update Interactions API implementation to cater for upstream breaking changes coming May 26v3.0.74Compare Source
Patch Changes
3ca0daa: fix(provider/google): supportfunctionCall.idwhen returned by Gemini API and provide matchingfunctionResponse.idv3.0.73Compare Source
Patch Changes
bb1eb98: feat(google): addfileDatasupport to embedding modelv3.0.72Compare Source
Patch Changes
b3642fe: feat(provider/google): support cancelling long-running Interactions API agents via AbortSignal, and process their intermittent streamv3.0.71Compare Source
Patch Changes
59530cf: fix(google): emit Vertex no-args streaming tool calls and preserve thoughtSignatureVertex emits a no-args function call as a single chunk shaped
{ functionCall: { name: 'X' } }with noargs, nopartialArgs, and nowillContinue. The streaming parser had no branch for this shape, so the call was dropped along with anythoughtSignatureit carried. For Gemini 3 thinking models this caused the next multi-turn step to 400 withmissing thought_signature. The unary (doGenerate) path had the same drop.Both paths now emit the call as a complete tool call with
'{}'input and propagatethoughtSignatureprovider metadata.Fixes #14847.
v3.0.70Compare Source
Patch Changes
4f3f564: fix(provider/google): fix lack of image consistency when using Interactions API in stateless modev3.0.68Compare Source
Patch Changes
e0f8c9e: feat(provider/google): add support for the Gemini Interactions APIv3.0.67Compare Source
Patch Changes
7beadf0]v3.0.66Compare Source
Patch Changes
a727da4: chore: ensure consistent import handling and avoid import duplicates or cyclesa727da4]v3.0.65Compare Source
Patch Changes
a7f3c72: trigger release for all packages after provenance setupa7f3c72]v3.0.64Compare Source
Patch Changes
71c52e0: chore(provider/google): update available modelsv3.0.63Compare Source
Patch Changes
1e1a5ab: fix(google): fixserviceTierto be correctly formatted for Vertex APIv3.0.62Compare Source
Patch Changes
46a3584: fix(google-vertex): don't send streamFunctionCallArguments for unary API calls and change default to falsev3.0.61Compare Source
Patch Changes
03a04f6: feat(google-vertex): add support for streaming tool arguments inputv3.0.60Compare Source
Patch Changes
d42076d: Add AI Gateway hint to provider READMEsv3.0.59Compare Source
Patch Changes
6247886: chore(provider-utils,google): fix grammar errors in error and warning messages6247886]v3.0.58Compare Source
Patch Changes
f20ba77: feat(provider/google): preserve per-modality token details in usage datav3.0.57Compare Source
Patch Changes
0f2b2f1: fix(provider/google): fix Gemini service tier enum after upstream updatev3.0.56Compare Source
Patch Changes
0469aed]