@ai-sdk/google 3.0.129 → 3.0.131

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.
@@ -3,7 +3,7 @@ import { Resolvable, FetchFunction, InferSchema } from '@ai-sdk/provider-utils';
3
3
  import { LanguageModelV3, LanguageModelV3CallOptions, LanguageModelV3GenerateResult, LanguageModelV3StreamResult } from '@ai-sdk/provider';
4
4
  import { z } from 'zod/v4';
5
5
 
6
- 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-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-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 & {});
6
+ 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-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-nano-banana-2.1' | '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 & {});
7
7
 
8
8
  type GoogleGenerativeAIConfig = {
9
9
  provider: string;
@@ -51,6 +51,14 @@ declare const getGroundingMetadataSchema: () => z.ZodObject<{
51
51
  title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
52
  text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
53
  fileSearchStore: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ customMetadata: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
55
+ key: z.ZodString;
56
+ stringValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
+ numericValue: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
58
+ stringListValue: z.ZodOptional<z.ZodNullable<z.ZodObject<{
59
+ values: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
60
+ }, z.core.$strip>>>;
61
+ }, z.core.$strip>>>>;
54
62
  }, z.core.$strip>>>;
55
63
  maps: z.ZodOptional<z.ZodNullable<z.ZodObject<{
56
64
  uri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -169,6 +177,14 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
169
177
  title?: string | null | undefined;
170
178
  text?: string | null | undefined;
171
179
  fileSearchStore?: string | null | undefined;
180
+ customMetadata?: {
181
+ key: string;
182
+ stringValue?: string | null | undefined;
183
+ numericValue?: number | null | undefined;
184
+ stringListValue?: {
185
+ values?: string[] | null | undefined;
186
+ } | null | undefined;
187
+ }[] | null | undefined;
172
188
  } | null | undefined;
173
189
  maps?: {
174
190
  uri?: string | null | undefined;
@@ -342,7 +358,7 @@ declare const googleTools: {
342
358
  * the two surfaces (`:generateContent` vs `/interactions`) are independent and
343
359
  * may diverge over time.
344
360
  */
345
- 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' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
361
+ 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' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-nano-banana-2.1' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
346
362
 
347
363
  type GoogleInteractionsConfig = {
348
364
  provider: string;
@@ -3,7 +3,7 @@ import { Resolvable, FetchFunction, InferSchema } from '@ai-sdk/provider-utils';
3
3
  import { LanguageModelV3, LanguageModelV3CallOptions, LanguageModelV3GenerateResult, LanguageModelV3StreamResult } from '@ai-sdk/provider';
4
4
  import { z } from 'zod/v4';
5
5
 
6
- 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-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-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 & {});
6
+ 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-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-nano-banana-2.1' | '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 & {});
7
7
 
8
8
  type GoogleGenerativeAIConfig = {
9
9
  provider: string;
@@ -51,6 +51,14 @@ declare const getGroundingMetadataSchema: () => z.ZodObject<{
51
51
  title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
52
52
  text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
53
53
  fileSearchStore: z.ZodOptional<z.ZodNullable<z.ZodString>>;
54
+ customMetadata: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
55
+ key: z.ZodString;
56
+ stringValue: z.ZodOptional<z.ZodNullable<z.ZodString>>;
57
+ numericValue: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
58
+ stringListValue: z.ZodOptional<z.ZodNullable<z.ZodObject<{
59
+ values: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
60
+ }, z.core.$strip>>>;
61
+ }, z.core.$strip>>>>;
54
62
  }, z.core.$strip>>>;
55
63
  maps: z.ZodOptional<z.ZodNullable<z.ZodObject<{
56
64
  uri: z.ZodOptional<z.ZodNullable<z.ZodString>>;
@@ -169,6 +177,14 @@ declare const responseSchema: _ai_sdk_provider_utils.LazySchema<{
169
177
  title?: string | null | undefined;
170
178
  text?: string | null | undefined;
171
179
  fileSearchStore?: string | null | undefined;
180
+ customMetadata?: {
181
+ key: string;
182
+ stringValue?: string | null | undefined;
183
+ numericValue?: number | null | undefined;
184
+ stringListValue?: {
185
+ values?: string[] | null | undefined;
186
+ } | null | undefined;
187
+ }[] | null | undefined;
172
188
  } | null | undefined;
173
189
  maps?: {
174
190
  uri?: string | null | undefined;
@@ -342,7 +358,7 @@ declare const googleTools: {
342
358
  * the two surfaces (`:generateContent` vs `/interactions`) are independent and
343
359
  * may diverge over time.
344
360
  */
345
- 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' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
361
+ 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' | 'gemini-3.5-flash-lite' | 'gemini-3.6-flash' | 'gemini-3.7-flash' | 'gemini-3.8-flash' | 'gemini-nano-banana-2.1' | 'lyria-3-clip-preview' | 'lyria-3-pro-preview' | (string & {});
346
362
 
347
363
  type GoogleInteractionsConfig = {
348
364
  provider: string;
@@ -2516,7 +2516,15 @@ var getGroundingMetadataSchema = () => import_v43.z.object({
2516
2516
  uri: import_v43.z.string().nullish(),
2517
2517
  title: import_v43.z.string().nullish(),
2518
2518
  text: import_v43.z.string().nullish(),
2519
- fileSearchStore: import_v43.z.string().nullish()
2519
+ fileSearchStore: import_v43.z.string().nullish(),
2520
+ customMetadata: import_v43.z.array(
2521
+ import_v43.z.object({
2522
+ key: import_v43.z.string(),
2523
+ stringValue: import_v43.z.string().nullish(),
2524
+ numericValue: import_v43.z.number().nullish(),
2525
+ stringListValue: import_v43.z.object({ values: import_v43.z.array(import_v43.z.string()).nullish() }).nullish()
2526
+ })
2527
+ ).nullish()
2520
2528
  }).nullish(),
2521
2529
  maps: import_v43.z.object({
2522
2530
  uri: import_v43.z.string().nullish(),