npm / @ai-sdk/google
@ai-sdk/google
What changed in @ai-sdk/google 3 to 4, from its official release notes, upgrade guides and advisories. Sources checked 2026-10-18.
4 breaking1 security39 new APIs and options7 behavior and defaults47 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli init@ai-sdk/google 487 changes
Breaking changes 3
Renames evaluate to decide.
Unsupported batch request types are now rejected.
Support for Imagen models and their integration was dropped following the API shutdown.
Security 1
Default Node.js downloads retain DNS validation and connection pinning when frameworks or instrumentation wrap global fetch before or after the SDK loads.
New APIs and options 39
Google language models can now use AUDIO response modalities.
Adds a provider option and provider metadata to resume responses that used up their maxOutputTokens budget.
Adds gemini-4-argon as a model id.
Exposes the first request's prompt token count in Google provider metadata.
Adds the gemini-nano-banana-2.1 model ID.
Adds the portable max reasoning level, widening LanguageModelV4CallOptions['reasoning'] and the derived ReasoningLevel type; exhaustive consumers must handle max.
Adds telemetry to speech generation and transcription, including provider usage propagation and experimental streaming lifecycle callbacks.
Adds Gemini 3.8 speech model IDs to Google and Gateway types.
Adds Gemini 3.8 TTS support with structured speech metadata and per-turn speaker and style controls for prebuilt voices.
Adds experimental Choice, Score, and Boolean evaluations through Gemini structured output, preserving provider thinking options and validating exact labels and score bounds. Boolean answers include prompted P(true) estimates validated to be in [0, 1], but are not guaranteed to be…
Adds an option that stamps behavior on every function declaration in the Live setup.
Forwards the Live server message as a custom event so applications can detect when a background-reasoning model is idle.
Adds thinkingLevel, thinkingBudget, and includeThoughts options, merged into the Live setup.generationConfig.
Forwards the Live server message as a custom event so applications can detect when a background-reasoning model is idle.
Image generation requests are now supported in batches.
Batch cancellation is now available.
Batch listing is now available.
Batch requests can now use per-request models.
Array outputs support the maxItems constraint.
Array outputs support the minItems constraint.
The Interactions API supports agentic video processing.
Adds the gemini-3.8-flash model for use with @ai-sdk/google.
Upload results now expose byteSize.
Adds createBinaryStreamResponseHandler to provider-utils.
Upload results now expose createdAt.
Adds deleteFromApi to provider-utils.
Upload results now expose expiresAt.
Adds abortSignal as a call option for FilesV4 operations.
Adds optional deleteFile support to the FilesV4 interface.
Adds optional streaming downloadFile support to the FilesV4 interface.
Adds optional getFileMetadata support to the FilesV4 interface.
Adds headers as a call option for FilesV4 operations.
Adds a { type: 'stream' } upload data variant.
Adds a helper for streaming multipart uploads with deterministic part ordering and failure-path stream teardown.
Batch now supports tool calling, allowing developers to use tools with batch requests.
Adds unary transcription via generateContent, with language detection, speaker diarization, word timestamps, and custom vocabulary.
Adds streaming transcription over the Live API WebSocket.
Adds VERBATIM and SMART transcription formatting modes for streaming transcription.
Adds support for the Gemini Batch API through experimental_startTextBatch.
Behavior and default changes 7
Requests that reach the per-request cap (CONTINUATION) continue automatically, with usage summed across requests.
With the Interactions API, polls background model calls until they finish.
Newer and custom model IDs default to structured speech, while Gemini 2.5 and 3.1 retain the legacy format.
Input usage now includes tool-use prompt tokens.
Google and Google Vertex prompt blocks are now marked as terminal.
The core uploadFile() helper now forwards abortSignal and headers.
Prompt-level Google safety blocks without candidates are surfaced as content-filter results with prompt feedback metadata.
Fixes and other changes 37
In-stream errors are now surfaced.
Regional Gemini model IDs are handled.
Valid thinking configurations are handled.
Google tool errors and denied executions are sent under functionResponse.response.error.
JSONL rows are limited to 64 MB during batch result downloads.
Custom metadata is now preserved in retrieved context grounding chunks.
Uses a JSON response tool for structured outputs when tool calling is enabled.
Uses a standards-compliant User-Agent header.
Realtime user utterances retain independent IDs and cumulative transcripts.
Response IDs advance after interruption.
Text-free transcription completion markers are honored.
Gemini Live now sends the default thinkingLevel when thinkingConfig sets neither thinkingLevel nor thinkingBudget, and no longer overwrites a raw generationConfig.thinkingConfig.
Supported Vertex tool result URLs are forwarded as function response file data.
Fixes serialization of JSON Schema references in function responses.
Native WAV responses are preserved without adding a second header; explicit raw PCM, mu-law, and A-law output are supported, and headerless audio formats are identified correctly.
Code execution parts are preserved when messages are replayed.
Calls with more than 100 values keep per-value multimodal content aligned across automatic batches, including text-only entries; content length and each batch's provider options are validated before requests are sent.
Shares transcript and custom-voice inspection through the Google provider internal export.
Empty speech transcripts are rejected before a request is sent.
Preserve opaque file URI strings during provider serialization.
Image candidate finish reasons are preserved in provider metadata.
The provider now advertises the supported Gemini image per-call limit, helping developers determine the limit for image requests.
Default prompt block reasons are ignored in non-streaming responses.
Prompt feedback and metadata are preserved across streaming chunks.
On background-reasoning Live models, the provider sends thinkingLevel: 'low' when neither thinkingLevel nor thinkingBudget is set, meeting the requirement to provide exactly one.
Wraps non-object realtime tool results under output; object results pass through unchanged, as required by Gemini's Struct field.
Preserves JSON Schema instead of converting it to OpenAPI schema.
Fixes downloading file URLs from tool results.
Unclassified empty image results are now retried.
The Google provider maps the code execution tool name correctly.
Gemini Interactions now support video response formats.
Google Files URLs are now recognized when using a baseUrl.
Frequency and presence penalties are omitted from Gemini 2.5 requests because they are unsupported; warnings are returned instead.
Raw usage results preserve complete Google Generative Language usage metadata.
Local JSON Schema references are inlined in Google tool and structured-output schemas.
Handles empty string tool call IDs.
Uses low as the minimum reasoning level for full Gemini Flash 3.7 and later.
@ai-sdk/google 311 changes
Breaking changes 1
generateText with the Interactions API now polls background model calls until they finish.
Fixes and other changes 10
For Vertex Gemini 3 and later, supported GCS tool result URLs are forwarded as function response file data for image, PDF, and text MIME types; HTTP(S) downloads remain supported on all Gemini generations.
Keeps per-value multimodal content aligned across automatic batches of more than 100 values, including text-only entries.
Validates content length before sending requests.
Validates each batch's provider options after middleware transforms them.
Default prompt block reasons are ignored in non-streaming responses.
Google content-filtered results are marked terminal, so they are not retried.
Unsupported frequency penalties are omitted from Gemini 2.5 requests, and a warning is returned.
Unsupported presence penalties are omitted from Gemini 2.5 requests, and a warning is returned.
Enum values are converted to the Gemini schema format.
Google model calls now preserve recursive tool input schemas instead of aborting.