@ai-sdk/google 3.0.75 → 3.0.77

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 3.0.77
4
+
5
+ ### Patch Changes
6
+
7
+ - 0f9f9bf: feat(google): read `serviceTier` from `x-gemini-service-tier` response header in Gemini API and use PayGo for Vertex
8
+
9
+ ## 3.0.76
10
+
11
+ ### Patch Changes
12
+
13
+ - f259bd1: fix(google): fix streaming tool call args
14
+ - 756fec1: feat(provider/google): add `gemini-3.5-flash`
15
+
3
16
  ## 3.0.75
4
17
 
5
18
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -11,7 +11,7 @@ declare const googleErrorDataSchema: _ai_sdk_provider_utils.LazySchema<{
11
11
  }>;
12
12
  type GoogleErrorData = InferSchema<typeof googleErrorDataSchema>;
13
13
 
14
- type GoogleGenerativeAIModelId = 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-flash-lite-001' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro-preview-tts' | 'gemini-2.5-flash-native-audio-latest' | 'gemini-2.5-flash-native-audio-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-pro-preview-customtools' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'deep-research-pro-preview-12-2025' | 'nano-banana-pro-preview' | 'aqa' | 'gemini-robotics-er-1.5-preview' | 'gemma-3-1b-it' | 'gemma-3-4b-it' | 'gemma-3n-e4b-it' | 'gemma-3n-e2b-it' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
14
+ type GoogleGenerativeAIModelId = 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-flash-lite-001' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro-preview-tts' | 'gemini-2.5-flash-native-audio-latest' | 'gemini-2.5-flash-native-audio-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-pro-preview-customtools' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'gemini-3.5-flash' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'deep-research-pro-preview-12-2025' | 'nano-banana-pro-preview' | 'aqa' | 'gemini-robotics-er-1.5-preview' | 'gemma-3-1b-it' | 'gemma-3-4b-it' | 'gemma-3n-e4b-it' | 'gemma-3n-e2b-it' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
15
15
  declare const googleLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
16
16
  responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
17
17
  thinkingConfig?: {
@@ -41,6 +41,8 @@ declare const googleLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
41
41
  } | undefined;
42
42
  streamFunctionCallArguments?: boolean | undefined;
43
43
  serviceTier?: "standard" | "flex" | "priority" | undefined;
44
+ sharedRequestType?: "standard" | "flex" | "priority" | undefined;
45
+ requestType?: "shared" | undefined;
44
46
  }>;
45
47
  type GoogleLanguageModelOptions = InferSchema<typeof googleLanguageModelOptions>;
46
48
 
@@ -189,7 +191,6 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
189
191
  blocked?: boolean | null | undefined;
190
192
  }[] | null | undefined;
191
193
  } | null | undefined;
192
- serviceTier?: string | null | undefined;
193
194
  }>;
194
195
  type GroundingMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['groundingMetadata']>;
195
196
  type UrlContextMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['urlContextMetadata']>;
@@ -269,7 +270,7 @@ type GoogleVideoModelOptions = {
269
270
  * the two surfaces (`:generateContent` vs `/interactions`) are independent and
270
271
  * may diverge over time.
271
272
  */
272
- type GoogleInteractionsModelId = 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-flash-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-pro-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
273
+ type GoogleInteractionsModelId = 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-flash-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-pro-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'gemini-3.5-flash' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
273
274
  /**
274
275
  * Provider-options schema for `google.interactions(...)` calls. Read from the
275
276
  * shared `providerOptions.google.*` namespace (per PRD); per-call options that
@@ -319,6 +320,29 @@ declare const googleInteractionsLanguageModelOptions: _ai_sdk_provider_utils.Laz
319
320
  signature?: string | null | undefined;
320
321
  interactionId?: string | null | undefined;
321
322
  pollingTimeoutMs?: number | null | undefined;
323
+ background?: boolean | null | undefined;
324
+ environment?: string | {
325
+ type: "remote";
326
+ sources?: ({
327
+ type: "gcs";
328
+ source: string;
329
+ target?: string | null | undefined;
330
+ } | {
331
+ type: "repository";
332
+ source: string;
333
+ target?: string | null | undefined;
334
+ } | {
335
+ type: "inline";
336
+ content: string;
337
+ target: string;
338
+ })[] | null | undefined;
339
+ network?: "disabled" | {
340
+ allowlist: {
341
+ domain: string;
342
+ transform?: Record<string, string>[] | null | undefined;
343
+ }[];
344
+ } | null | undefined;
345
+ } | null | undefined;
322
346
  }>;
323
347
  type GoogleLanguageModelInteractionsOptions = InferSchema<typeof googleInteractionsLanguageModelOptions>;
324
348
 
@@ -348,14 +372,12 @@ type GoogleInteractionsProviderMetadata = {
348
372
  * Type-only module: declares the union of supported Gemini Interactions agent
349
373
  * names. Used by the `google.interactions({ agent })` factory branch.
350
374
  *
351
- * Sourced from `googleapis/js-genai` `src/interactions/resources/interactions.ts`
352
- * (`Interaction.agent` enum). Subject to expansion as Google adds new agents.
353
- *
354
- * This is a strict string-literal union (no `string` escape hatch) so that
355
- * passing an unknown agent name is a compile-time error. Add new agents here
356
- * as Google publishes them.
375
+ * Strict string-literal union: unknown agent names are a compile-time error.
376
+ * User-defined agents (created via the `/agents` endpoint) are addressed by
377
+ * a separate `{ managedAgent: string }` factory shape — see
378
+ * `GoogleInteractionsModelInput`.
357
379
  */
358
- type GoogleInteractionsAgentName = 'deep-research-pro-preview-12-2025' | 'deep-research-preview-04-2026' | 'deep-research-max-preview-04-2026';
380
+ type GoogleInteractionsAgentName = 'deep-research-pro-preview-12-2025' | 'deep-research-preview-04-2026' | 'deep-research-max-preview-04-2026' | 'antigravity-preview-05-2026';
359
381
 
360
382
  declare const googleTools: {
361
383
  /**
@@ -478,11 +500,16 @@ interface GoogleGenerativeAIProvider extends ProviderV3 {
478
500
  videoModel(modelId: GoogleGenerativeAIVideoModelId): Experimental_VideoModelV3;
479
501
  /**
480
502
  * Creates a language model targeting the Gemini Interactions API
481
- * (`POST /v1beta/interactions`). Pass either a model ID (string) or
482
- * `{ agent: <name> }` to use a Gemini agent preset.
503
+ * (`POST /v1beta/interactions`). Pass:
504
+ * - a model ID (string),
505
+ * - `{ agent: <name> }` to use a known Gemini agent preset, or
506
+ * - `{ managedAgent: <name> }` to use a user-defined agent created via
507
+ * the `/v1beta/agents` endpoint.
483
508
  */
484
509
  interactions(modelIdOrAgent: GoogleInteractionsModelId | {
485
510
  agent: GoogleInteractionsAgentName;
511
+ } | {
512
+ managedAgent: string;
486
513
  }): LanguageModelV3;
487
514
  tools: typeof googleTools;
488
515
  }
package/dist/index.d.ts CHANGED
@@ -11,7 +11,7 @@ declare const googleErrorDataSchema: _ai_sdk_provider_utils.LazySchema<{
11
11
  }>;
12
12
  type GoogleErrorData = InferSchema<typeof googleErrorDataSchema>;
13
13
 
14
- type GoogleGenerativeAIModelId = 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-flash-lite-001' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro-preview-tts' | 'gemini-2.5-flash-native-audio-latest' | 'gemini-2.5-flash-native-audio-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-pro-preview-customtools' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'deep-research-pro-preview-12-2025' | 'nano-banana-pro-preview' | 'aqa' | 'gemini-robotics-er-1.5-preview' | 'gemma-3-1b-it' | 'gemma-3-4b-it' | 'gemma-3n-e4b-it' | 'gemma-3n-e2b-it' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
14
+ type GoogleGenerativeAIModelId = 'gemini-2.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-flash-lite-001' | 'gemini-2.5-pro' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro-preview-tts' | 'gemini-2.5-flash-native-audio-latest' | 'gemini-2.5-flash-native-audio-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-3-pro-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-flash-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-pro-preview-customtools' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'gemini-3.5-flash' | 'gemini-pro-latest' | 'gemini-flash-latest' | 'gemini-flash-lite-latest' | 'deep-research-pro-preview-12-2025' | 'nano-banana-pro-preview' | 'aqa' | 'gemini-robotics-er-1.5-preview' | 'gemma-3-1b-it' | 'gemma-3-4b-it' | 'gemma-3n-e4b-it' | 'gemma-3n-e2b-it' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
15
15
  declare const googleLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
16
16
  responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
17
17
  thinkingConfig?: {
@@ -41,6 +41,8 @@ declare const googleLanguageModelOptions: _ai_sdk_provider_utils.LazySchema<{
41
41
  } | undefined;
42
42
  streamFunctionCallArguments?: boolean | undefined;
43
43
  serviceTier?: "standard" | "flex" | "priority" | undefined;
44
+ sharedRequestType?: "standard" | "flex" | "priority" | undefined;
45
+ requestType?: "shared" | undefined;
44
46
  }>;
45
47
  type GoogleLanguageModelOptions = InferSchema<typeof googleLanguageModelOptions>;
46
48
 
@@ -189,7 +191,6 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
189
191
  blocked?: boolean | null | undefined;
190
192
  }[] | null | undefined;
191
193
  } | null | undefined;
192
- serviceTier?: string | null | undefined;
193
194
  }>;
194
195
  type GroundingMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['groundingMetadata']>;
195
196
  type UrlContextMetadataSchema = NonNullable<InferSchema<typeof responseSchema>['candidates'][number]['urlContextMetadata']>;
@@ -269,7 +270,7 @@ type GoogleVideoModelOptions = {
269
270
  * the two surfaces (`:generateContent` vs `/interactions`) are independent and
270
271
  * may diverge over time.
271
272
  */
272
- type GoogleInteractionsModelId = 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-flash-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-pro-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
273
+ type GoogleInteractionsModelId = 'gemini-2.5-computer-use-preview-10-2025' | 'gemini-2.5-flash' | 'gemini-2.5-flash-image' | 'gemini-2.5-flash-lite' | 'gemini-2.5-flash-lite-preview-09-2025' | 'gemini-2.5-flash-native-audio-preview-12-2025' | 'gemini-2.5-flash-preview-09-2025' | 'gemini-2.5-flash-preview-tts' | 'gemini-2.5-pro' | 'gemini-2.5-pro-preview-tts' | 'gemini-3-flash-preview' | 'gemini-3-pro-image-preview' | 'gemini-3-pro-preview' | 'gemini-3.1-pro-preview' | 'gemini-3.1-flash-image-preview' | 'gemini-3.1-flash-lite-preview' | 'gemini-3.1-flash-tts-preview' | 'gemini-3.5-flash' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
273
274
  /**
274
275
  * Provider-options schema for `google.interactions(...)` calls. Read from the
275
276
  * shared `providerOptions.google.*` namespace (per PRD); per-call options that
@@ -319,6 +320,29 @@ declare const googleInteractionsLanguageModelOptions: _ai_sdk_provider_utils.Laz
319
320
  signature?: string | null | undefined;
320
321
  interactionId?: string | null | undefined;
321
322
  pollingTimeoutMs?: number | null | undefined;
323
+ background?: boolean | null | undefined;
324
+ environment?: string | {
325
+ type: "remote";
326
+ sources?: ({
327
+ type: "gcs";
328
+ source: string;
329
+ target?: string | null | undefined;
330
+ } | {
331
+ type: "repository";
332
+ source: string;
333
+ target?: string | null | undefined;
334
+ } | {
335
+ type: "inline";
336
+ content: string;
337
+ target: string;
338
+ })[] | null | undefined;
339
+ network?: "disabled" | {
340
+ allowlist: {
341
+ domain: string;
342
+ transform?: Record<string, string>[] | null | undefined;
343
+ }[];
344
+ } | null | undefined;
345
+ } | null | undefined;
322
346
  }>;
323
347
  type GoogleLanguageModelInteractionsOptions = InferSchema<typeof googleInteractionsLanguageModelOptions>;
324
348
 
@@ -348,14 +372,12 @@ type GoogleInteractionsProviderMetadata = {
348
372
  * Type-only module: declares the union of supported Gemini Interactions agent
349
373
  * names. Used by the `google.interactions({ agent })` factory branch.
350
374
  *
351
- * Sourced from `googleapis/js-genai` `src/interactions/resources/interactions.ts`
352
- * (`Interaction.agent` enum). Subject to expansion as Google adds new agents.
353
- *
354
- * This is a strict string-literal union (no `string` escape hatch) so that
355
- * passing an unknown agent name is a compile-time error. Add new agents here
356
- * as Google publishes them.
375
+ * Strict string-literal union: unknown agent names are a compile-time error.
376
+ * User-defined agents (created via the `/agents` endpoint) are addressed by
377
+ * a separate `{ managedAgent: string }` factory shape — see
378
+ * `GoogleInteractionsModelInput`.
357
379
  */
358
- type GoogleInteractionsAgentName = 'deep-research-pro-preview-12-2025' | 'deep-research-preview-04-2026' | 'deep-research-max-preview-04-2026';
380
+ type GoogleInteractionsAgentName = 'deep-research-pro-preview-12-2025' | 'deep-research-preview-04-2026' | 'deep-research-max-preview-04-2026' | 'antigravity-preview-05-2026';
359
381
 
360
382
  declare const googleTools: {
361
383
  /**
@@ -478,11 +500,16 @@ interface GoogleGenerativeAIProvider extends ProviderV3 {
478
500
  videoModel(modelId: GoogleGenerativeAIVideoModelId): Experimental_VideoModelV3;
479
501
  /**
480
502
  * Creates a language model targeting the Gemini Interactions API
481
- * (`POST /v1beta/interactions`). Pass either a model ID (string) or
482
- * `{ agent: <name> }` to use a Gemini agent preset.
503
+ * (`POST /v1beta/interactions`). Pass:
504
+ * - a model ID (string),
505
+ * - `{ agent: <name> }` to use a known Gemini agent preset, or
506
+ * - `{ managedAgent: <name> }` to use a user-defined agent created via
507
+ * the `/v1beta/agents` endpoint.
483
508
  */
484
509
  interactions(modelIdOrAgent: GoogleInteractionsModelId | {
485
510
  agent: GoogleInteractionsAgentName;
511
+ } | {
512
+ managedAgent: string;
486
513
  }): LanguageModelV3;
487
514
  tools: typeof googleTools;
488
515
  }