@ai-sdk/google 2.0.0-canary.12 → 2.0.0-canary.13

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,16 @@
1
1
  # @ai-sdk/google
2
2
 
3
+ ## 2.0.0-canary.13
4
+
5
+ ### Patch Changes
6
+
7
+ - 7378473: chore(providers/google): switch to providerOptions
8
+ - Updated dependencies [9bf7291]
9
+ - Updated dependencies [4617fab]
10
+ - Updated dependencies [e030615]
11
+ - @ai-sdk/provider@2.0.0-canary.11
12
+ - @ai-sdk/provider-utils@3.0.0-canary.12
13
+
3
14
  ## 2.0.0-canary.12
4
15
 
5
16
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -32,24 +32,21 @@ declare const googleErrorDataSchema: z.ZodObject<{
32
32
  type GoogleErrorData = z.infer<typeof googleErrorDataSchema>;
33
33
 
34
34
  type GoogleGenerativeAIModelId = 'gemini-2.0-flash-001' | 'gemini-1.5-flash' | 'gemini-1.5-flash-latest' | 'gemini-1.5-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-8b' | 'gemini-1.5-flash-8b-latest' | 'gemini-1.5-flash-8b-001' | 'gemini-1.5-pro' | 'gemini-1.5-pro-latest' | 'gemini-1.5-pro-001' | 'gemini-1.5-pro-002' | 'gemini-2.5-pro-exp-03-25' | 'gemini-2.0-flash-lite-preview-02-05' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21' | 'gemini-2.0-flash-exp' | 'gemini-exp-1206' | 'gemma-3-27b-it' | 'learnlm-1.5-pro-experimental' | (string & {});
35
- interface DynamicRetrievalConfig {
36
- /**
37
- * The mode of the predictor to be used in dynamic retrieval.
38
- */
39
- mode?: 'MODE_UNSPECIFIED' | 'MODE_DYNAMIC';
40
- /**
41
- * The threshold to be used in dynamic retrieval. If not set, a system default
42
- * value is used.
43
- */
44
- dynamicThreshold?: number;
45
- }
46
- interface GoogleGenerativeAISettings {
35
+ declare const googleGenerativeAIProviderOptions: z.ZodObject<{
36
+ responseModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<["TEXT", "IMAGE"]>, "many">>;
37
+ thinkingConfig: z.ZodOptional<z.ZodObject<{
38
+ thinkingBudget: z.ZodOptional<z.ZodNumber>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ thinkingBudget?: number | undefined;
41
+ }, {
42
+ thinkingBudget?: number | undefined;
43
+ }>>;
47
44
  /**
48
45
  Optional.
49
46
  The name of the cached content used as context to serve the prediction.
50
47
  Format: cachedContents/{cachedContent}
51
48
  */
52
- cachedContent?: string;
49
+ cachedContent: z.ZodOptional<z.ZodString>;
53
50
  /**
54
51
  * Optional. Enable structured output. Default is true.
55
52
  *
@@ -58,35 +55,95 @@ interface GoogleGenerativeAISettings {
58
55
  * Google Generative AI uses. You can use this to disable
59
56
  * structured outputs if you need to.
60
57
  */
61
- structuredOutputs?: boolean;
58
+ structuredOutputs: z.ZodOptional<z.ZodBoolean>;
62
59
  /**
63
60
  Optional. A list of unique safety settings for blocking unsafe content.
64
- */
65
- safetySettings?: Array<{
66
- category: 'HARM_CATEGORY_UNSPECIFIED' | 'HARM_CATEGORY_HATE_SPEECH' | 'HARM_CATEGORY_DANGEROUS_CONTENT' | 'HARM_CATEGORY_HARASSMENT' | 'HARM_CATEGORY_SEXUALLY_EXPLICIT' | 'HARM_CATEGORY_CIVIC_INTEGRITY';
67
- threshold: 'HARM_BLOCK_THRESHOLD_UNSPECIFIED' | 'BLOCK_LOW_AND_ABOVE' | 'BLOCK_MEDIUM_AND_ABOVE' | 'BLOCK_ONLY_HIGH' | 'BLOCK_NONE' | 'OFF';
68
- }>;
61
+ */
62
+ safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
63
+ category: z.ZodEnum<["HARM_CATEGORY_UNSPECIFIED", "HARM_CATEGORY_HATE_SPEECH", "HARM_CATEGORY_DANGEROUS_CONTENT", "HARM_CATEGORY_HARASSMENT", "HARM_CATEGORY_SEXUALLY_EXPLICIT", "HARM_CATEGORY_CIVIC_INTEGRITY"]>;
64
+ threshold: z.ZodEnum<["HARM_BLOCK_THRESHOLD_UNSPECIFIED", "BLOCK_LOW_AND_ABOVE", "BLOCK_MEDIUM_AND_ABOVE", "BLOCK_ONLY_HIGH", "BLOCK_NONE", "OFF"]>;
65
+ }, "strip", z.ZodTypeAny, {
66
+ category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
67
+ threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
68
+ }, {
69
+ category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
70
+ threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
71
+ }>, "many">>;
72
+ threshold: z.ZodOptional<z.ZodEnum<["HARM_BLOCK_THRESHOLD_UNSPECIFIED", "BLOCK_LOW_AND_ABOVE", "BLOCK_MEDIUM_AND_ABOVE", "BLOCK_ONLY_HIGH", "BLOCK_NONE", "OFF"]>>;
69
73
  /**
70
74
  * Optional. Enables timestamp understanding for audio-only files.
71
75
  *
72
76
  * https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
73
77
  */
74
- audioTimestamp?: boolean;
78
+ audioTimestamp: z.ZodOptional<z.ZodBoolean>;
75
79
  /**
76
80
  Optional. When enabled, the model will use Google search to ground the response.
77
81
 
78
82
  @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/overview
79
- */
80
- useSearchGrounding?: boolean;
83
+ */
84
+ useSearchGrounding: z.ZodOptional<z.ZodBoolean>;
81
85
  /**
82
86
  Optional. Specifies the dynamic retrieval configuration.
83
87
 
84
88
  @note Dynamic retrieval is only compatible with Gemini 1.5 Flash.
85
89
 
86
90
  @see https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/ground-with-google-search#dynamic-retrieval
87
- */
88
- dynamicRetrievalConfig?: DynamicRetrievalConfig;
89
- }
91
+ */
92
+ dynamicRetrievalConfig: z.ZodOptional<z.ZodObject<{
93
+ /**
94
+ * The mode of the predictor to be used in dynamic retrieval.
95
+ */
96
+ mode: z.ZodOptional<z.ZodEnum<["MODE_UNSPECIFIED", "MODE_DYNAMIC"]>>;
97
+ /**
98
+ * The threshold to be used in dynamic retrieval. If not set, a system default
99
+ * value is used.
100
+ */
101
+ dynamicThreshold: z.ZodOptional<z.ZodNumber>;
102
+ }, "strip", z.ZodTypeAny, {
103
+ mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | undefined;
104
+ dynamicThreshold?: number | undefined;
105
+ }, {
106
+ mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | undefined;
107
+ dynamicThreshold?: number | undefined;
108
+ }>>;
109
+ }, "strip", z.ZodTypeAny, {
110
+ responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
111
+ thinkingConfig?: {
112
+ thinkingBudget?: number | undefined;
113
+ } | undefined;
114
+ cachedContent?: string | undefined;
115
+ structuredOutputs?: boolean | undefined;
116
+ threshold?: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF" | undefined;
117
+ safetySettings?: {
118
+ category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
119
+ threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
120
+ }[] | undefined;
121
+ audioTimestamp?: boolean | undefined;
122
+ useSearchGrounding?: boolean | undefined;
123
+ dynamicRetrievalConfig?: {
124
+ mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | undefined;
125
+ dynamicThreshold?: number | undefined;
126
+ } | undefined;
127
+ }, {
128
+ responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
129
+ thinkingConfig?: {
130
+ thinkingBudget?: number | undefined;
131
+ } | undefined;
132
+ cachedContent?: string | undefined;
133
+ structuredOutputs?: boolean | undefined;
134
+ threshold?: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF" | undefined;
135
+ safetySettings?: {
136
+ category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
137
+ threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
138
+ }[] | undefined;
139
+ audioTimestamp?: boolean | undefined;
140
+ useSearchGrounding?: boolean | undefined;
141
+ dynamicRetrievalConfig?: {
142
+ mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | undefined;
143
+ dynamicThreshold?: number | undefined;
144
+ } | undefined;
145
+ }>;
146
+ type GoogleGenerativeAIProviderOptions = z.infer<typeof googleGenerativeAIProviderOptions>;
90
147
 
91
148
  declare const groundingMetadataSchema: z.ZodObject<{
92
149
  webSearchQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
@@ -144,13 +201,13 @@ declare const groundingMetadataSchema: z.ZodObject<{
144
201
  endIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
145
202
  text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
146
203
  }, "strip", z.ZodTypeAny, {
204
+ text?: string | null | undefined;
147
205
  startIndex?: number | null | undefined;
148
206
  endIndex?: number | null | undefined;
149
- text?: string | null | undefined;
150
207
  }, {
208
+ text?: string | null | undefined;
151
209
  startIndex?: number | null | undefined;
152
210
  endIndex?: number | null | undefined;
153
- text?: string | null | undefined;
154
211
  }>;
155
212
  segment_text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
156
213
  groundingChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
@@ -159,9 +216,9 @@ declare const groundingMetadataSchema: z.ZodObject<{
159
216
  confidenceScore: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
160
217
  }, "strip", z.ZodTypeAny, {
161
218
  segment: {
219
+ text?: string | null | undefined;
162
220
  startIndex?: number | null | undefined;
163
221
  endIndex?: number | null | undefined;
164
- text?: string | null | undefined;
165
222
  };
166
223
  segment_text?: string | null | undefined;
167
224
  groundingChunkIndices?: number[] | null | undefined;
@@ -170,9 +227,9 @@ declare const groundingMetadataSchema: z.ZodObject<{
170
227
  confidenceScore?: number[] | null | undefined;
171
228
  }, {
172
229
  segment: {
230
+ text?: string | null | undefined;
173
231
  startIndex?: number | null | undefined;
174
232
  endIndex?: number | null | undefined;
175
- text?: string | null | undefined;
176
233
  };
177
234
  segment_text?: string | null | undefined;
178
235
  groundingChunkIndices?: number[] | null | undefined;
@@ -205,9 +262,9 @@ declare const groundingMetadataSchema: z.ZodObject<{
205
262
  }[] | null | undefined;
206
263
  groundingSupports?: {
207
264
  segment: {
265
+ text?: string | null | undefined;
208
266
  startIndex?: number | null | undefined;
209
267
  endIndex?: number | null | undefined;
210
- text?: string | null | undefined;
211
268
  };
212
269
  segment_text?: string | null | undefined;
213
270
  groundingChunkIndices?: number[] | null | undefined;
@@ -236,9 +293,9 @@ declare const groundingMetadataSchema: z.ZodObject<{
236
293
  }[] | null | undefined;
237
294
  groundingSupports?: {
238
295
  segment: {
296
+ text?: string | null | undefined;
239
297
  startIndex?: number | null | undefined;
240
298
  endIndex?: number | null | undefined;
241
- text?: string | null | undefined;
242
299
  };
243
300
  segment_text?: string | null | undefined;
244
301
  groundingChunkIndices?: number[] | null | undefined;
@@ -272,27 +329,6 @@ declare const safetyRatingSchema: z.ZodObject<{
272
329
  severityScore?: number | null | undefined;
273
330
  blocked?: boolean | null | undefined;
274
331
  }>;
275
- declare const googleGenerativeAIProviderOptionsSchema: z.ZodObject<{
276
- responseModalities: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["TEXT", "IMAGE"]>, "many">>>;
277
- thinkingConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
278
- thinkingBudget: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
279
- }, "strip", z.ZodTypeAny, {
280
- thinkingBudget?: number | null | undefined;
281
- }, {
282
- thinkingBudget?: number | null | undefined;
283
- }>>>;
284
- }, "strip", z.ZodTypeAny, {
285
- responseModalities?: ("TEXT" | "IMAGE")[] | null | undefined;
286
- thinkingConfig?: {
287
- thinkingBudget?: number | null | undefined;
288
- } | null | undefined;
289
- }, {
290
- responseModalities?: ("TEXT" | "IMAGE")[] | null | undefined;
291
- thinkingConfig?: {
292
- thinkingBudget?: number | null | undefined;
293
- } | null | undefined;
294
- }>;
295
- type GoogleGenerativeAIProviderOptions = z.infer<typeof googleGenerativeAIProviderOptionsSchema>;
296
332
 
297
333
  type GoogleGenerativeAIGroundingMetadata = z.infer<typeof groundingMetadataSchema>;
298
334
  type GoogleGenerativeAISafetyRating = z.infer<typeof safetyRatingSchema>;
@@ -304,13 +340,13 @@ interface GoogleGenerativeAIProviderMetadata {
304
340
  type GoogleGenerativeAIEmbeddingModelId = 'text-embedding-004' | (string & {});
305
341
 
306
342
  interface GoogleGenerativeAIProvider extends ProviderV2 {
307
- (modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV2;
308
- languageModel(modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV2;
309
- chat(modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV2;
343
+ (modelId: GoogleGenerativeAIModelId): LanguageModelV2;
344
+ languageModel(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
345
+ chat(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
310
346
  /**
311
347
  * @deprecated Use `chat()` instead.
312
348
  */
313
- generativeAI(modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV2;
349
+ generativeAI(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
314
350
  /**
315
351
  @deprecated Use `textEmbeddingModel()` instead.
316
352
  */
package/dist/index.d.ts CHANGED
@@ -32,24 +32,21 @@ declare const googleErrorDataSchema: z.ZodObject<{
32
32
  type GoogleErrorData = z.infer<typeof googleErrorDataSchema>;
33
33
 
34
34
  type GoogleGenerativeAIModelId = 'gemini-2.0-flash-001' | 'gemini-1.5-flash' | 'gemini-1.5-flash-latest' | 'gemini-1.5-flash-001' | 'gemini-1.5-flash-002' | 'gemini-1.5-flash-8b' | 'gemini-1.5-flash-8b-latest' | 'gemini-1.5-flash-8b-001' | 'gemini-1.5-pro' | 'gemini-1.5-pro-latest' | 'gemini-1.5-pro-001' | 'gemini-1.5-pro-002' | 'gemini-2.5-pro-exp-03-25' | 'gemini-2.0-flash-lite-preview-02-05' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21' | 'gemini-2.0-flash-exp' | 'gemini-exp-1206' | 'gemma-3-27b-it' | 'learnlm-1.5-pro-experimental' | (string & {});
35
- interface DynamicRetrievalConfig {
36
- /**
37
- * The mode of the predictor to be used in dynamic retrieval.
38
- */
39
- mode?: 'MODE_UNSPECIFIED' | 'MODE_DYNAMIC';
40
- /**
41
- * The threshold to be used in dynamic retrieval. If not set, a system default
42
- * value is used.
43
- */
44
- dynamicThreshold?: number;
45
- }
46
- interface GoogleGenerativeAISettings {
35
+ declare const googleGenerativeAIProviderOptions: z.ZodObject<{
36
+ responseModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<["TEXT", "IMAGE"]>, "many">>;
37
+ thinkingConfig: z.ZodOptional<z.ZodObject<{
38
+ thinkingBudget: z.ZodOptional<z.ZodNumber>;
39
+ }, "strip", z.ZodTypeAny, {
40
+ thinkingBudget?: number | undefined;
41
+ }, {
42
+ thinkingBudget?: number | undefined;
43
+ }>>;
47
44
  /**
48
45
  Optional.
49
46
  The name of the cached content used as context to serve the prediction.
50
47
  Format: cachedContents/{cachedContent}
51
48
  */
52
- cachedContent?: string;
49
+ cachedContent: z.ZodOptional<z.ZodString>;
53
50
  /**
54
51
  * Optional. Enable structured output. Default is true.
55
52
  *
@@ -58,35 +55,95 @@ interface GoogleGenerativeAISettings {
58
55
  * Google Generative AI uses. You can use this to disable
59
56
  * structured outputs if you need to.
60
57
  */
61
- structuredOutputs?: boolean;
58
+ structuredOutputs: z.ZodOptional<z.ZodBoolean>;
62
59
  /**
63
60
  Optional. A list of unique safety settings for blocking unsafe content.
64
- */
65
- safetySettings?: Array<{
66
- category: 'HARM_CATEGORY_UNSPECIFIED' | 'HARM_CATEGORY_HATE_SPEECH' | 'HARM_CATEGORY_DANGEROUS_CONTENT' | 'HARM_CATEGORY_HARASSMENT' | 'HARM_CATEGORY_SEXUALLY_EXPLICIT' | 'HARM_CATEGORY_CIVIC_INTEGRITY';
67
- threshold: 'HARM_BLOCK_THRESHOLD_UNSPECIFIED' | 'BLOCK_LOW_AND_ABOVE' | 'BLOCK_MEDIUM_AND_ABOVE' | 'BLOCK_ONLY_HIGH' | 'BLOCK_NONE' | 'OFF';
68
- }>;
61
+ */
62
+ safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
63
+ category: z.ZodEnum<["HARM_CATEGORY_UNSPECIFIED", "HARM_CATEGORY_HATE_SPEECH", "HARM_CATEGORY_DANGEROUS_CONTENT", "HARM_CATEGORY_HARASSMENT", "HARM_CATEGORY_SEXUALLY_EXPLICIT", "HARM_CATEGORY_CIVIC_INTEGRITY"]>;
64
+ threshold: z.ZodEnum<["HARM_BLOCK_THRESHOLD_UNSPECIFIED", "BLOCK_LOW_AND_ABOVE", "BLOCK_MEDIUM_AND_ABOVE", "BLOCK_ONLY_HIGH", "BLOCK_NONE", "OFF"]>;
65
+ }, "strip", z.ZodTypeAny, {
66
+ category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
67
+ threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
68
+ }, {
69
+ category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
70
+ threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
71
+ }>, "many">>;
72
+ threshold: z.ZodOptional<z.ZodEnum<["HARM_BLOCK_THRESHOLD_UNSPECIFIED", "BLOCK_LOW_AND_ABOVE", "BLOCK_MEDIUM_AND_ABOVE", "BLOCK_ONLY_HIGH", "BLOCK_NONE", "OFF"]>>;
69
73
  /**
70
74
  * Optional. Enables timestamp understanding for audio-only files.
71
75
  *
72
76
  * https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
73
77
  */
74
- audioTimestamp?: boolean;
78
+ audioTimestamp: z.ZodOptional<z.ZodBoolean>;
75
79
  /**
76
80
  Optional. When enabled, the model will use Google search to ground the response.
77
81
 
78
82
  @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/overview
79
- */
80
- useSearchGrounding?: boolean;
83
+ */
84
+ useSearchGrounding: z.ZodOptional<z.ZodBoolean>;
81
85
  /**
82
86
  Optional. Specifies the dynamic retrieval configuration.
83
87
 
84
88
  @note Dynamic retrieval is only compatible with Gemini 1.5 Flash.
85
89
 
86
90
  @see https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/ground-with-google-search#dynamic-retrieval
87
- */
88
- dynamicRetrievalConfig?: DynamicRetrievalConfig;
89
- }
91
+ */
92
+ dynamicRetrievalConfig: z.ZodOptional<z.ZodObject<{
93
+ /**
94
+ * The mode of the predictor to be used in dynamic retrieval.
95
+ */
96
+ mode: z.ZodOptional<z.ZodEnum<["MODE_UNSPECIFIED", "MODE_DYNAMIC"]>>;
97
+ /**
98
+ * The threshold to be used in dynamic retrieval. If not set, a system default
99
+ * value is used.
100
+ */
101
+ dynamicThreshold: z.ZodOptional<z.ZodNumber>;
102
+ }, "strip", z.ZodTypeAny, {
103
+ mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | undefined;
104
+ dynamicThreshold?: number | undefined;
105
+ }, {
106
+ mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | undefined;
107
+ dynamicThreshold?: number | undefined;
108
+ }>>;
109
+ }, "strip", z.ZodTypeAny, {
110
+ responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
111
+ thinkingConfig?: {
112
+ thinkingBudget?: number | undefined;
113
+ } | undefined;
114
+ cachedContent?: string | undefined;
115
+ structuredOutputs?: boolean | undefined;
116
+ threshold?: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF" | undefined;
117
+ safetySettings?: {
118
+ category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
119
+ threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
120
+ }[] | undefined;
121
+ audioTimestamp?: boolean | undefined;
122
+ useSearchGrounding?: boolean | undefined;
123
+ dynamicRetrievalConfig?: {
124
+ mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | undefined;
125
+ dynamicThreshold?: number | undefined;
126
+ } | undefined;
127
+ }, {
128
+ responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
129
+ thinkingConfig?: {
130
+ thinkingBudget?: number | undefined;
131
+ } | undefined;
132
+ cachedContent?: string | undefined;
133
+ structuredOutputs?: boolean | undefined;
134
+ threshold?: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF" | undefined;
135
+ safetySettings?: {
136
+ category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
137
+ threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
138
+ }[] | undefined;
139
+ audioTimestamp?: boolean | undefined;
140
+ useSearchGrounding?: boolean | undefined;
141
+ dynamicRetrievalConfig?: {
142
+ mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | undefined;
143
+ dynamicThreshold?: number | undefined;
144
+ } | undefined;
145
+ }>;
146
+ type GoogleGenerativeAIProviderOptions = z.infer<typeof googleGenerativeAIProviderOptions>;
90
147
 
91
148
  declare const groundingMetadataSchema: z.ZodObject<{
92
149
  webSearchQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
@@ -144,13 +201,13 @@ declare const groundingMetadataSchema: z.ZodObject<{
144
201
  endIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
145
202
  text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
146
203
  }, "strip", z.ZodTypeAny, {
204
+ text?: string | null | undefined;
147
205
  startIndex?: number | null | undefined;
148
206
  endIndex?: number | null | undefined;
149
- text?: string | null | undefined;
150
207
  }, {
208
+ text?: string | null | undefined;
151
209
  startIndex?: number | null | undefined;
152
210
  endIndex?: number | null | undefined;
153
- text?: string | null | undefined;
154
211
  }>;
155
212
  segment_text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
156
213
  groundingChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
@@ -159,9 +216,9 @@ declare const groundingMetadataSchema: z.ZodObject<{
159
216
  confidenceScore: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
160
217
  }, "strip", z.ZodTypeAny, {
161
218
  segment: {
219
+ text?: string | null | undefined;
162
220
  startIndex?: number | null | undefined;
163
221
  endIndex?: number | null | undefined;
164
- text?: string | null | undefined;
165
222
  };
166
223
  segment_text?: string | null | undefined;
167
224
  groundingChunkIndices?: number[] | null | undefined;
@@ -170,9 +227,9 @@ declare const groundingMetadataSchema: z.ZodObject<{
170
227
  confidenceScore?: number[] | null | undefined;
171
228
  }, {
172
229
  segment: {
230
+ text?: string | null | undefined;
173
231
  startIndex?: number | null | undefined;
174
232
  endIndex?: number | null | undefined;
175
- text?: string | null | undefined;
176
233
  };
177
234
  segment_text?: string | null | undefined;
178
235
  groundingChunkIndices?: number[] | null | undefined;
@@ -205,9 +262,9 @@ declare const groundingMetadataSchema: z.ZodObject<{
205
262
  }[] | null | undefined;
206
263
  groundingSupports?: {
207
264
  segment: {
265
+ text?: string | null | undefined;
208
266
  startIndex?: number | null | undefined;
209
267
  endIndex?: number | null | undefined;
210
- text?: string | null | undefined;
211
268
  };
212
269
  segment_text?: string | null | undefined;
213
270
  groundingChunkIndices?: number[] | null | undefined;
@@ -236,9 +293,9 @@ declare const groundingMetadataSchema: z.ZodObject<{
236
293
  }[] | null | undefined;
237
294
  groundingSupports?: {
238
295
  segment: {
296
+ text?: string | null | undefined;
239
297
  startIndex?: number | null | undefined;
240
298
  endIndex?: number | null | undefined;
241
- text?: string | null | undefined;
242
299
  };
243
300
  segment_text?: string | null | undefined;
244
301
  groundingChunkIndices?: number[] | null | undefined;
@@ -272,27 +329,6 @@ declare const safetyRatingSchema: z.ZodObject<{
272
329
  severityScore?: number | null | undefined;
273
330
  blocked?: boolean | null | undefined;
274
331
  }>;
275
- declare const googleGenerativeAIProviderOptionsSchema: z.ZodObject<{
276
- responseModalities: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["TEXT", "IMAGE"]>, "many">>>;
277
- thinkingConfig: z.ZodOptional<z.ZodNullable<z.ZodObject<{
278
- thinkingBudget: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
279
- }, "strip", z.ZodTypeAny, {
280
- thinkingBudget?: number | null | undefined;
281
- }, {
282
- thinkingBudget?: number | null | undefined;
283
- }>>>;
284
- }, "strip", z.ZodTypeAny, {
285
- responseModalities?: ("TEXT" | "IMAGE")[] | null | undefined;
286
- thinkingConfig?: {
287
- thinkingBudget?: number | null | undefined;
288
- } | null | undefined;
289
- }, {
290
- responseModalities?: ("TEXT" | "IMAGE")[] | null | undefined;
291
- thinkingConfig?: {
292
- thinkingBudget?: number | null | undefined;
293
- } | null | undefined;
294
- }>;
295
- type GoogleGenerativeAIProviderOptions = z.infer<typeof googleGenerativeAIProviderOptionsSchema>;
296
332
 
297
333
  type GoogleGenerativeAIGroundingMetadata = z.infer<typeof groundingMetadataSchema>;
298
334
  type GoogleGenerativeAISafetyRating = z.infer<typeof safetyRatingSchema>;
@@ -304,13 +340,13 @@ interface GoogleGenerativeAIProviderMetadata {
304
340
  type GoogleGenerativeAIEmbeddingModelId = 'text-embedding-004' | (string & {});
305
341
 
306
342
  interface GoogleGenerativeAIProvider extends ProviderV2 {
307
- (modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV2;
308
- languageModel(modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV2;
309
- chat(modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV2;
343
+ (modelId: GoogleGenerativeAIModelId): LanguageModelV2;
344
+ languageModel(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
345
+ chat(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
310
346
  /**
311
347
  * @deprecated Use `chat()` instead.
312
348
  */
313
- generativeAI(modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV2;
349
+ generativeAI(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
314
350
  /**
315
351
  @deprecated Use `textEmbeddingModel()` instead.
316
352
  */