@ai-sdk/google
4.0.122 · 17 Nov 2026Apache-2.014.6M / weekRepositoryHomepagenpmAtom feed
4.0.122 is the newest release of 4.x.
In short
8 breaking1 security25 new19 fixed7 internal
- Breaking
provider/google: Remove useless GenerativeAI affix from types and classes for consistency
- Breaking
provider: Add support for
reasoning-filetype for files that are part of reasoning - Breaking
Remove CommonJS exports from all packages. All packages are now ESM-only (
"type": "module"). Consumers usingrequire()must switch to ESMimportsyntax. - Breaking
provider: Add support for provider references and uploading files as supported per provider
- Breaking
provider: Add new top-level reasoning parameter to spec and support it in
generateTextandstreamText - Breaking
Start v7 pre-release
- Breaking
Make provider implementations code patterns more consistent, including renaming certain exported symbols
- Breaking
Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.
Release note
Major Changes
- Breaking
provider/google: Remove useless GenerativeAI affix from types and classes for consistency
- Breaking
provider: Add support for
reasoning-filetype for files that are part of reasoning - Breaking
Remove CommonJS exports from all packages. All packages are now ESM-only (
"type": "module"). Consumers usingrequire()must switch to ESMimportsyntax. - Breaking
provider: Add support for provider references and uploading files as supported per provider
- Breaking
provider: Add new top-level reasoning parameter to spec and support it in
generateTextandstreamText - Breaking
Start v7 pre-release
- Breaking
Make provider implementations code patterns more consistent, including renaming certain exported symbols
For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
Patch Changes
provider/google: Add support for managed agents in the Interactions API
Add AI Gateway hint to provider READMEs
provider/google: Support Google search grounding when using
generateImagewith Geminiprovider/google: Fix Gemini service tier enum after upstream update
google: Fix
serviceTierto be correctly formatted for Vertex APIgoogle, google-vertex: Added
gemini-embedding-2,deep-research-max-preview-04-2026anddeep-research-preview-04-2026provider/google: Add support for service tier parameter
provider/google: Support
functionCall.idwhen returned by Gemini API and provide matchingfunctionResponse.idprovider/google: Correct JSDoc for multimodal embedding content option
google: auto-inject
skip_thought_signature_validatorfor Gemini 3 tool-call replays without a signatureAdd Google realtime Live Translation provider options for
gemini-3.5-live-translate-preview.google: Update Interactions API implementation to cater for upstream breaking changes coming May 26
provider/google: Add Gemini text-to-speech (speech) model support
provider/google: Preserve per-modality token details in usage data
google: Emit Vertex no-args streaming tool calls and preserve thoughtSignature
Vertex 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.
provider/google: Preserve groundingMetadata and urlContextMetadata when they arrive in a stream chunk before the finishReason chunk
google: Read
serviceTierfromusageMetadata.serviceTierin both generate and stream pathsThe previous implementation read
serviceTierfrom thex-gemini-service-tier
response header, which is only populated on non-streaming responses. Gemini
streaming includes the value inusageMetadata.serviceTieron every chunk, soproviderMetadata.google.serviceTierwas alwaysnullfor streams. Read fromusageMetadatafor both paths instead.google: Use VALIDATED function calling mode when any tool has strict:true
provider/google-vertex: Add Gemini text-to-speech (speech) model support
- Security
google: Prevent prototype pollution when streaming tool args
google: Add
fileDatasupport to embedding modelprovider/google: Support combining built-in tools with function calling on Gemini 3
google-vertex: Add support for streaming tool arguments input
Trigger release for all packages after provenance setup
google: Fix streaming tool call args
provider/google: Support multimodal content parts in embedding provider options
provider/google: Add
gemini-embedding-2-previewand fix multimodal embedding support withembedManyprovider/google: Add support for the Gemini Interactions API
More precise default message for tool execution denial
provider/google: Fix lack of image consistency when using Interactions API in stateless mode
Only send provider credentials to same-origin response-supplied URLs
Several 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.- Breaking
Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.
Trigger initial canary release
provider/google: Support cancelling long-running Interactions API agents via AbortSignal, and process their intermittent stream
provider: Add experimental Realtime API support for voice conversations
Adds first-class support for realtime (speech-to-speech) APIs:
Experimental_RealtimeModelV4spec in@ai-sdk/providerwith normalized event types and factoryOpenAI, Google, and xAI realtime provider implementations
openai.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 provider
google-vertex: Don't send streamFunctionCallArguments for unary API calls and change default to false
provider/google: Correctly mark reasoning files as such and fix related multi-turn errors
provider: Change file part data property to be tagged with a type and remove the image part type
provider/google: Add
gemini-3.5-flashprovider: Align tool result output content file part types with top-level message file part types
Trigger initial beta release
google: Omit passing includeServerSideToolInvocations for Vertex tool_config
google: Add new finishMessage field in providerMetadata
google: Read
serviceTierfromx-gemini-service-tierresponse header in Gemini API and use PayGo for Vertexprovider/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.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.Roll
image-*tool output types into their equivalentfile-*types
A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.