@ai-sdk/google 1.2.19 → 2.0.0-alpha.10

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,96 +1,291 @@
1
1
  # @ai-sdk/google
2
2
 
3
- ## 1.2.19
3
+ ## 2.0.0-alpha.10
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - f262012: fix (provider/google): prevent error when thinking signature is used
7
+ - 581a9be: fix (provider/google): prevent error when thinking signature is used
8
+ - Updated dependencies [c4df419]
9
+ - @ai-sdk/provider@2.0.0-alpha.10
10
+ - @ai-sdk/provider-utils@3.0.0-alpha.10
8
11
 
9
- ## 1.2.18
12
+ ## 2.0.0-alpha.9
10
13
 
11
14
  ### Patch Changes
12
15
 
13
- - 4b2e1b0: Add reasoning token output support for gemini models via Vertex AI Provider
16
+ - Updated dependencies [811dff3]
17
+ - @ai-sdk/provider@2.0.0-alpha.9
18
+ - @ai-sdk/provider-utils@3.0.0-alpha.9
14
19
 
15
- ## 1.2.17
20
+ ## 2.0.0-alpha.8
16
21
 
17
22
  ### Patch Changes
18
23
 
19
- - Updated dependencies [d87b9d1]
20
- - @ai-sdk/provider-utils@2.2.8
24
+ - 1a635b5: update supportedUrls to only support native URL
25
+ - Updated dependencies [4fef487]
26
+ - Updated dependencies [9222aeb]
27
+ - @ai-sdk/provider-utils@3.0.0-alpha.8
28
+ - @ai-sdk/provider@2.0.0-alpha.8
21
29
 
22
- ## 1.2.16
30
+ ## 2.0.0-alpha.7
23
31
 
24
32
  ### Patch Changes
25
33
 
26
- - 0ca6f2f: feat(providers/google): add gemini-2.5-pro-preview-05-06
34
+ - Updated dependencies [5c56081]
35
+ - @ai-sdk/provider@2.0.0-alpha.7
36
+ - @ai-sdk/provider-utils@3.0.0-alpha.7
27
37
 
28
- ## 1.2.15
38
+ ## 2.0.0-alpha.6
29
39
 
30
40
  ### Patch Changes
31
41
 
32
- - 2afd354: fix(providers/google): accept nullish in safetyRatings
42
+ - Updated dependencies [0d2c085]
43
+ - @ai-sdk/provider@2.0.0-alpha.6
44
+ - @ai-sdk/provider-utils@3.0.0-alpha.6
33
45
 
34
- ## 1.2.14
46
+ ## 2.0.0-alpha.4
35
47
 
36
48
  ### Patch Changes
37
49
 
38
- - c695a7e: feat (provider/google): add new gemini models
50
+ - Updated dependencies [dc714f3]
51
+ - @ai-sdk/provider@2.0.0-alpha.4
52
+ - @ai-sdk/provider-utils@3.0.0-alpha.4
39
53
 
40
- ## 1.2.13
54
+ ## 2.0.0-alpha.3
41
55
 
42
56
  ### Patch Changes
43
57
 
44
- - 6183b08: feat(providers/google): Add taskType support for Text Embedding Models
58
+ - Updated dependencies [6b98118]
59
+ - @ai-sdk/provider@2.0.0-alpha.3
60
+ - @ai-sdk/provider-utils@3.0.0-alpha.3
45
61
 
46
- ## 1.2.12
62
+ ## 2.0.0-alpha.2
47
63
 
48
64
  ### Patch Changes
49
65
 
50
- - c56331d: feat (providers/google): add thinking config to provider options
66
+ - Updated dependencies [26535e0]
67
+ - @ai-sdk/provider@2.0.0-alpha.2
68
+ - @ai-sdk/provider-utils@3.0.0-alpha.2
51
69
 
52
- ## 1.2.11
70
+ ## 2.0.0-alpha.1
53
71
 
54
72
  ### Patch Changes
55
73
 
56
- - Updated dependencies [beef951]
57
- - @ai-sdk/provider@1.1.3
58
- - @ai-sdk/provider-utils@2.2.7
74
+ - Updated dependencies [3f2f00c]
75
+ - @ai-sdk/provider@2.0.0-alpha.1
76
+ - @ai-sdk/provider-utils@3.0.0-alpha.1
59
77
 
60
- ## 1.2.10
78
+ ## 2.0.0-canary.20
61
79
 
62
80
  ### Patch Changes
63
81
 
64
- - Updated dependencies [013faa8]
65
- - @ai-sdk/provider@1.1.2
66
- - @ai-sdk/provider-utils@2.2.6
82
+ - Updated dependencies [faf8446]
83
+ - @ai-sdk/provider-utils@3.0.0-canary.19
67
84
 
68
- ## 1.2.9
85
+ ## 2.0.0-canary.19
69
86
 
70
87
  ### Patch Changes
71
88
 
72
- - Updated dependencies [c21fa6d]
73
- - @ai-sdk/provider-utils@2.2.5
74
- - @ai-sdk/provider@1.1.1
89
+ - Updated dependencies [40acf9b]
90
+ - @ai-sdk/provider-utils@3.0.0-canary.18
75
91
 
76
- ## 1.2.8
92
+ ## 2.0.0-canary.18
77
93
 
78
94
  ### Patch Changes
79
95
 
80
- - 1e8e66d: fix (provider/google): allow "OFF" for Google HarmBlockThreshold
96
+ - f07a6d4: fix(providers/google): accept nullish in safetyRatings
97
+ - Updated dependencies [ea7a7c9]
98
+ - @ai-sdk/provider-utils@3.0.0-canary.17
81
99
 
82
- ## 1.2.7
100
+ ## 2.0.0-canary.17
83
101
 
84
102
  ### Patch Changes
85
103
 
86
- - 1789884: feat: add provider option schemas for vertex imagegen and google genai
104
+ - Updated dependencies [87b828f]
105
+ - @ai-sdk/provider-utils@3.0.0-canary.16
87
106
 
88
- ## 1.2.6
107
+ ## 2.0.0-canary.16
89
108
 
90
109
  ### Patch Changes
91
110
 
92
- - Updated dependencies [2c19b9a]
93
- - @ai-sdk/provider-utils@2.2.4
111
+ - Updated dependencies [a571d6e]
112
+ - Updated dependencies [a8c8bd5]
113
+ - Updated dependencies [7979f7f]
114
+ - Updated dependencies [41fa418]
115
+ - @ai-sdk/provider-utils@3.0.0-canary.15
116
+ - @ai-sdk/provider@2.0.0-canary.14
117
+
118
+ ## 2.0.0-canary.15
119
+
120
+ ### Patch Changes
121
+
122
+ - Updated dependencies [957b739]
123
+ - Updated dependencies [9bd5ab5]
124
+ - @ai-sdk/provider-utils@3.0.0-canary.14
125
+ - @ai-sdk/provider@2.0.0-canary.13
126
+
127
+ ## 2.0.0-canary.14
128
+
129
+ ### Patch Changes
130
+
131
+ - f916255: feat (provider/google): add new gemini models
132
+ - Updated dependencies [7b3ae3f]
133
+ - Updated dependencies [0ff02bb]
134
+ - @ai-sdk/provider@2.0.0-canary.12
135
+ - @ai-sdk/provider-utils@3.0.0-canary.13
136
+
137
+ ## 2.0.0-canary.13
138
+
139
+ ### Patch Changes
140
+
141
+ - 7378473: chore(providers/google): switch to providerOptions
142
+ - Updated dependencies [9bf7291]
143
+ - Updated dependencies [4617fab]
144
+ - Updated dependencies [e030615]
145
+ - @ai-sdk/provider@2.0.0-canary.11
146
+ - @ai-sdk/provider-utils@3.0.0-canary.12
147
+
148
+ ## 2.0.0-canary.12
149
+
150
+ ### Patch Changes
151
+
152
+ - 888b750: feat(providers/google): Add taskType support for Text Embedding Models
153
+ - 66962ed: fix(packages): export node10 compatible types
154
+ - Updated dependencies [66962ed]
155
+ - Updated dependencies [9301f86]
156
+ - Updated dependencies [a3f768e]
157
+ - @ai-sdk/provider-utils@3.0.0-canary.11
158
+ - @ai-sdk/provider@2.0.0-canary.10
159
+
160
+ ## 2.0.0-canary.11
161
+
162
+ ### Patch Changes
163
+
164
+ - Updated dependencies [e86be6f]
165
+ - @ai-sdk/provider@2.0.0-canary.9
166
+ - @ai-sdk/provider-utils@3.0.0-canary.10
167
+
168
+ ## 2.0.0-canary.10
169
+
170
+ ### Patch Changes
171
+
172
+ - 3259565: feat (providers/google): add thinking config to provider options
173
+ - fd98925: chore(providers/google): update embedding model to use providerOptions
174
+ - Updated dependencies [95857aa]
175
+ - Updated dependencies [7ea4132]
176
+ - @ai-sdk/provider@2.0.0-canary.8
177
+ - @ai-sdk/provider-utils@3.0.0-canary.9
178
+
179
+ ## 2.0.0-canary.9
180
+
181
+ ### Patch Changes
182
+
183
+ - Updated dependencies [5d142ab]
184
+ - Updated dependencies [b6b43c7]
185
+ - Updated dependencies [8aa9e20]
186
+ - Updated dependencies [3795467]
187
+ - @ai-sdk/provider-utils@3.0.0-canary.8
188
+ - @ai-sdk/provider@2.0.0-canary.7
189
+
190
+ ## 2.0.0-canary.8
191
+
192
+ ### Patch Changes
193
+
194
+ - 26735b5: chore(embedding-model): add v2 interface
195
+ - 443d8ec: feat(embedding-model-v2): add response body field
196
+ - fd65bc6: chore(embedding-model-v2): rename rawResponse to response
197
+ - Updated dependencies [26735b5]
198
+ - Updated dependencies [443d8ec]
199
+ - Updated dependencies [14c9410]
200
+ - Updated dependencies [d9c98f4]
201
+ - Updated dependencies [c4a2fec]
202
+ - Updated dependencies [0054544]
203
+ - Updated dependencies [9e9c809]
204
+ - Updated dependencies [32831c6]
205
+ - Updated dependencies [d0f9495]
206
+ - Updated dependencies [fd65bc6]
207
+ - Updated dependencies [393138b]
208
+ - Updated dependencies [7182d14]
209
+ - @ai-sdk/provider@2.0.0-canary.6
210
+ - @ai-sdk/provider-utils@3.0.0-canary.7
211
+
212
+ ## 2.0.0-canary.7
213
+
214
+ ### Patch Changes
215
+
216
+ - f10304b: feat(tool-calling): don't require the user to have to pass parameters
217
+ - Updated dependencies [411e483]
218
+ - Updated dependencies [79457bd]
219
+ - Updated dependencies [ad80501]
220
+ - Updated dependencies [1766ede]
221
+ - Updated dependencies [f10304b]
222
+ - @ai-sdk/provider@2.0.0-canary.5
223
+ - @ai-sdk/provider-utils@3.0.0-canary.6
224
+
225
+ ## 2.0.0-canary.6
226
+
227
+ ### Patch Changes
228
+
229
+ - Updated dependencies [6f6bb89]
230
+ - @ai-sdk/provider@2.0.0-canary.4
231
+ - @ai-sdk/provider-utils@3.0.0-canary.5
232
+
233
+ ## 2.0.0-canary.5
234
+
235
+ ### Patch Changes
236
+
237
+ - Updated dependencies [d1a1aa1]
238
+ - @ai-sdk/provider@2.0.0-canary.3
239
+ - @ai-sdk/provider-utils@3.0.0-canary.4
240
+
241
+ ## 2.0.0-canary.4
242
+
243
+ ### Patch Changes
244
+
245
+ - Updated dependencies [a166433]
246
+ - Updated dependencies [abf9a79]
247
+ - Updated dependencies [9f95b35]
248
+ - Updated dependencies [0a87932]
249
+ - Updated dependencies [6dc848c]
250
+ - @ai-sdk/provider-utils@3.0.0-canary.3
251
+ - @ai-sdk/provider@2.0.0-canary.2
252
+
253
+ ## 2.0.0-canary.3
254
+
255
+ ### Patch Changes
256
+
257
+ - Updated dependencies [c57e248]
258
+ - Updated dependencies [33f4a6a]
259
+ - @ai-sdk/provider@2.0.0-canary.1
260
+ - @ai-sdk/provider-utils@3.0.0-canary.2
261
+
262
+ ## 2.0.0-canary.2
263
+
264
+ ### Patch Changes
265
+
266
+ - 5cf30ea: fix (provider/google): allow "OFF" for Google HarmBlockThreshold
267
+
268
+ ## 2.0.0-canary.1
269
+
270
+ ### Patch Changes
271
+
272
+ - 779d916: feat: add provider option schemas for vertex imagegen and google genai
273
+ - Updated dependencies [060370c]
274
+ - Updated dependencies [0c0c0b3]
275
+ - Updated dependencies [63d791d]
276
+ - @ai-sdk/provider-utils@3.0.0-canary.1
277
+
278
+ ## 2.0.0-canary.0
279
+
280
+ ### Major Changes
281
+
282
+ - d5f588f: AI SDK 5
283
+
284
+ ### Patch Changes
285
+
286
+ - Updated dependencies [d5f588f]
287
+ - @ai-sdk/provider-utils@3.0.0-canary.0
288
+ - @ai-sdk/provider@2.0.0-canary.0
94
289
 
95
290
  ## 1.2.5
96
291
 
package/dist/index.d.mts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { z } from 'zod';
2
+ import { ProviderV2, LanguageModelV2, EmbeddingModelV2 } from '@ai-sdk/provider';
2
3
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
- import { ProviderV1, LanguageModelV1, EmbeddingModelV1 } from '@ai-sdk/provider';
4
4
 
5
5
  declare const googleErrorDataSchema: z.ZodObject<{
6
6
  error: z.ZodObject<{
@@ -8,48 +8,48 @@ declare const googleErrorDataSchema: z.ZodObject<{
8
8
  message: z.ZodString;
9
9
  status: z.ZodString;
10
10
  }, "strip", z.ZodTypeAny, {
11
- status: string;
12
11
  code: number | null;
13
12
  message: string;
14
- }, {
15
13
  status: string;
14
+ }, {
16
15
  code: number | null;
17
16
  message: string;
17
+ status: string;
18
18
  }>;
19
19
  }, "strip", z.ZodTypeAny, {
20
20
  error: {
21
- status: string;
22
21
  code: number | null;
23
22
  message: string;
23
+ status: string;
24
24
  };
25
25
  }, {
26
26
  error: {
27
- status: string;
28
27
  code: number | null;
29
28
  message: string;
29
+ status: string;
30
30
  };
31
31
  }>;
32
32
  type GoogleErrorData = z.infer<typeof googleErrorDataSchema>;
33
33
 
34
- type GoogleGenerativeAIModelId = '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.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-live-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21' | 'gemini-2.0-flash-exp' | 'gemini-2.5-pro-exp-03-25' | 'gemini-2.5-pro-preview-05-06' | 'gemini-2.5-flash-preview-04-17' | '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 {
34
+ type GoogleGenerativeAIModelId = '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.0-flash' | 'gemini-2.0-flash-001' | 'gemini-2.0-flash-live-001' | 'gemini-2.0-flash-lite' | 'gemini-2.0-pro-exp-02-05' | 'gemini-2.0-flash-thinking-exp-01-21' | 'gemini-2.0-flash-exp' | 'gemini-2.5-pro-exp-03-25' | 'gemini-2.5-flash-preview-04-17' | 'gemini-exp-1206' | 'gemma-3-27b-it' | 'learnlm-1.5-pro-experimental' | (string & {});
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
+ includeThoughts: z.ZodOptional<z.ZodBoolean>;
40
+ }, "strip", z.ZodTypeAny, {
41
+ thinkingBudget?: number | undefined;
42
+ includeThoughts?: boolean | undefined;
43
+ }, {
44
+ thinkingBudget?: number | undefined;
45
+ includeThoughts?: boolean | undefined;
46
+ }>>;
47
47
  /**
48
48
  Optional.
49
49
  The name of the cached content used as context to serve the prediction.
50
50
  Format: cachedContents/{cachedContent}
51
51
  */
52
- cachedContent?: string;
52
+ cachedContent: z.ZodOptional<z.ZodString>;
53
53
  /**
54
54
  * Optional. Enable structured output. Default is true.
55
55
  *
@@ -58,35 +58,97 @@ interface GoogleGenerativeAISettings {
58
58
  * Google Generative AI uses. You can use this to disable
59
59
  * structured outputs if you need to.
60
60
  */
61
- structuredOutputs?: boolean;
61
+ structuredOutputs: z.ZodOptional<z.ZodBoolean>;
62
62
  /**
63
63
  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
- }>;
64
+ */
65
+ safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
66
+ 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"]>;
67
+ threshold: z.ZodEnum<["HARM_BLOCK_THRESHOLD_UNSPECIFIED", "BLOCK_LOW_AND_ABOVE", "BLOCK_MEDIUM_AND_ABOVE", "BLOCK_ONLY_HIGH", "BLOCK_NONE", "OFF"]>;
68
+ }, "strip", z.ZodTypeAny, {
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
+ }, {
72
+ category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
73
+ threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
74
+ }>, "many">>;
75
+ threshold: z.ZodOptional<z.ZodEnum<["HARM_BLOCK_THRESHOLD_UNSPECIFIED", "BLOCK_LOW_AND_ABOVE", "BLOCK_MEDIUM_AND_ABOVE", "BLOCK_ONLY_HIGH", "BLOCK_NONE", "OFF"]>>;
69
76
  /**
70
77
  * Optional. Enables timestamp understanding for audio-only files.
71
78
  *
72
79
  * https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
73
80
  */
74
- audioTimestamp?: boolean;
81
+ audioTimestamp: z.ZodOptional<z.ZodBoolean>;
75
82
  /**
76
83
  Optional. When enabled, the model will use Google search to ground the response.
77
84
 
78
85
  @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/overview
79
- */
80
- useSearchGrounding?: boolean;
86
+ */
87
+ useSearchGrounding: z.ZodOptional<z.ZodBoolean>;
81
88
  /**
82
89
  Optional. Specifies the dynamic retrieval configuration.
83
90
 
84
91
  @note Dynamic retrieval is only compatible with Gemini 1.5 Flash.
85
92
 
86
93
  @see https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/ground-with-google-search#dynamic-retrieval
87
- */
88
- dynamicRetrievalConfig?: DynamicRetrievalConfig;
89
- }
94
+ */
95
+ dynamicRetrievalConfig: z.ZodOptional<z.ZodObject<{
96
+ /**
97
+ * The mode of the predictor to be used in dynamic retrieval.
98
+ */
99
+ mode: z.ZodOptional<z.ZodEnum<["MODE_UNSPECIFIED", "MODE_DYNAMIC"]>>;
100
+ /**
101
+ * The threshold to be used in dynamic retrieval. If not set, a system default
102
+ * value is used.
103
+ */
104
+ dynamicThreshold: z.ZodOptional<z.ZodNumber>;
105
+ }, "strip", z.ZodTypeAny, {
106
+ mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | undefined;
107
+ dynamicThreshold?: number | undefined;
108
+ }, {
109
+ mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | undefined;
110
+ dynamicThreshold?: number | undefined;
111
+ }>>;
112
+ }, "strip", z.ZodTypeAny, {
113
+ responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
114
+ thinkingConfig?: {
115
+ thinkingBudget?: number | undefined;
116
+ includeThoughts?: boolean | undefined;
117
+ } | undefined;
118
+ cachedContent?: string | undefined;
119
+ structuredOutputs?: boolean | undefined;
120
+ threshold?: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF" | undefined;
121
+ safetySettings?: {
122
+ category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
123
+ threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
124
+ }[] | undefined;
125
+ audioTimestamp?: boolean | undefined;
126
+ useSearchGrounding?: boolean | undefined;
127
+ dynamicRetrievalConfig?: {
128
+ mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | undefined;
129
+ dynamicThreshold?: number | undefined;
130
+ } | undefined;
131
+ }, {
132
+ responseModalities?: ("TEXT" | "IMAGE")[] | undefined;
133
+ thinkingConfig?: {
134
+ thinkingBudget?: number | undefined;
135
+ includeThoughts?: boolean | undefined;
136
+ } | undefined;
137
+ cachedContent?: string | undefined;
138
+ structuredOutputs?: boolean | undefined;
139
+ threshold?: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF" | undefined;
140
+ safetySettings?: {
141
+ category: "HARM_CATEGORY_UNSPECIFIED" | "HARM_CATEGORY_HATE_SPEECH" | "HARM_CATEGORY_DANGEROUS_CONTENT" | "HARM_CATEGORY_HARASSMENT" | "HARM_CATEGORY_SEXUALLY_EXPLICIT" | "HARM_CATEGORY_CIVIC_INTEGRITY";
142
+ threshold: "HARM_BLOCK_THRESHOLD_UNSPECIFIED" | "BLOCK_LOW_AND_ABOVE" | "BLOCK_MEDIUM_AND_ABOVE" | "BLOCK_ONLY_HIGH" | "BLOCK_NONE" | "OFF";
143
+ }[] | undefined;
144
+ audioTimestamp?: boolean | undefined;
145
+ useSearchGrounding?: boolean | undefined;
146
+ dynamicRetrievalConfig?: {
147
+ mode?: "MODE_UNSPECIFIED" | "MODE_DYNAMIC" | undefined;
148
+ dynamicThreshold?: number | undefined;
149
+ } | undefined;
150
+ }>;
151
+ type GoogleGenerativeAIProviderOptions = z.infer<typeof googleGenerativeAIProviderOptions>;
90
152
 
91
153
  declare const groundingMetadataSchema: z.ZodObject<{
92
154
  webSearchQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
@@ -144,13 +206,13 @@ declare const groundingMetadataSchema: z.ZodObject<{
144
206
  endIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
145
207
  text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
146
208
  }, "strip", z.ZodTypeAny, {
209
+ text?: string | null | undefined;
147
210
  startIndex?: number | null | undefined;
148
211
  endIndex?: number | null | undefined;
149
- text?: string | null | undefined;
150
212
  }, {
213
+ text?: string | null | undefined;
151
214
  startIndex?: number | null | undefined;
152
215
  endIndex?: number | null | undefined;
153
- text?: string | null | undefined;
154
216
  }>;
155
217
  segment_text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
156
218
  groundingChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
@@ -159,9 +221,9 @@ declare const groundingMetadataSchema: z.ZodObject<{
159
221
  confidenceScore: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
160
222
  }, "strip", z.ZodTypeAny, {
161
223
  segment: {
224
+ text?: string | null | undefined;
162
225
  startIndex?: number | null | undefined;
163
226
  endIndex?: number | null | undefined;
164
- text?: string | null | undefined;
165
227
  };
166
228
  segment_text?: string | null | undefined;
167
229
  groundingChunkIndices?: number[] | null | undefined;
@@ -170,9 +232,9 @@ declare const groundingMetadataSchema: z.ZodObject<{
170
232
  confidenceScore?: number[] | null | undefined;
171
233
  }, {
172
234
  segment: {
235
+ text?: string | null | undefined;
173
236
  startIndex?: number | null | undefined;
174
237
  endIndex?: number | null | undefined;
175
- text?: string | null | undefined;
176
238
  };
177
239
  segment_text?: string | null | undefined;
178
240
  groundingChunkIndices?: number[] | null | undefined;
@@ -205,9 +267,9 @@ declare const groundingMetadataSchema: z.ZodObject<{
205
267
  }[] | null | undefined;
206
268
  groundingSupports?: {
207
269
  segment: {
270
+ text?: string | null | undefined;
208
271
  startIndex?: number | null | undefined;
209
272
  endIndex?: number | null | undefined;
210
- text?: string | null | undefined;
211
273
  };
212
274
  segment_text?: string | null | undefined;
213
275
  groundingChunkIndices?: number[] | null | undefined;
@@ -236,9 +298,9 @@ declare const groundingMetadataSchema: z.ZodObject<{
236
298
  }[] | null | undefined;
237
299
  groundingSupports?: {
238
300
  segment: {
301
+ text?: string | null | undefined;
239
302
  startIndex?: number | null | undefined;
240
303
  endIndex?: number | null | undefined;
241
- text?: string | null | undefined;
242
304
  };
243
305
  segment_text?: string | null | undefined;
244
306
  groundingChunkIndices?: number[] | null | undefined;
@@ -272,32 +334,6 @@ declare const safetyRatingSchema: z.ZodObject<{
272
334
  severityScore?: number | null | undefined;
273
335
  blocked?: boolean | null | undefined;
274
336
  }>;
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
- includeThoughts: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
280
- }, "strip", z.ZodTypeAny, {
281
- thinkingBudget?: number | null | undefined;
282
- includeThoughts?: boolean | null | undefined;
283
- }, {
284
- thinkingBudget?: number | null | undefined;
285
- includeThoughts?: boolean | null | undefined;
286
- }>>>;
287
- }, "strip", z.ZodTypeAny, {
288
- responseModalities?: ("TEXT" | "IMAGE")[] | null | undefined;
289
- thinkingConfig?: {
290
- thinkingBudget?: number | null | undefined;
291
- includeThoughts?: boolean | null | undefined;
292
- } | null | undefined;
293
- }, {
294
- responseModalities?: ("TEXT" | "IMAGE")[] | null | undefined;
295
- thinkingConfig?: {
296
- thinkingBudget?: number | null | undefined;
297
- includeThoughts?: boolean | null | undefined;
298
- } | null | undefined;
299
- }>;
300
- type GoogleGenerativeAIProviderOptions = z.infer<typeof googleGenerativeAIProviderOptionsSchema>;
301
337
 
302
338
  type GoogleGenerativeAIGroundingMetadata = z.infer<typeof groundingMetadataSchema>;
303
339
  type GoogleGenerativeAISafetyRating = z.infer<typeof safetyRatingSchema>;
@@ -307,44 +343,24 @@ interface GoogleGenerativeAIProviderMetadata {
307
343
  }
308
344
 
309
345
  type GoogleGenerativeAIEmbeddingModelId = 'text-embedding-004' | (string & {});
310
- interface GoogleGenerativeAIEmbeddingSettings {
311
- /**
312
- * Optional. Optional reduced dimension for the output embedding.
313
- * If set, excessive values in the output embedding are truncated from the end.
314
- */
315
- outputDimensionality?: number;
316
- /**
317
- * Optional. Specifies the task type for generating embeddings.
318
- * Supported task types:
319
- * - SEMANTIC_SIMILARITY: Optimized for text similarity.
320
- * - CLASSIFICATION: Optimized for text classification.
321
- * - CLUSTERING: Optimized for clustering texts based on similarity.
322
- * - RETRIEVAL_DOCUMENT: Optimized for document retrieval.
323
- * - RETRIEVAL_QUERY: Optimized for query-based retrieval.
324
- * - QUESTION_ANSWERING: Optimized for answering questions.
325
- * - FACT_VERIFICATION: Optimized for verifying factual information.
326
- * - CODE_RETRIEVAL_QUERY: Optimized for retrieving code blocks based on natural language queries.
327
- */
328
- taskType?: 'SEMANTIC_SIMILARITY' | 'CLASSIFICATION' | 'CLUSTERING' | 'RETRIEVAL_DOCUMENT' | 'RETRIEVAL_QUERY' | 'QUESTION_ANSWERING' | 'FACT_VERIFICATION' | 'CODE_RETRIEVAL_QUERY';
329
- }
330
346
 
331
- interface GoogleGenerativeAIProvider extends ProviderV1 {
332
- (modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV1;
333
- languageModel(modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV1;
334
- chat(modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV1;
347
+ interface GoogleGenerativeAIProvider extends ProviderV2 {
348
+ (modelId: GoogleGenerativeAIModelId): LanguageModelV2;
349
+ languageModel(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
350
+ chat(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
335
351
  /**
336
352
  * @deprecated Use `chat()` instead.
337
353
  */
338
- generativeAI(modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV1;
354
+ generativeAI(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
339
355
  /**
340
356
  @deprecated Use `textEmbeddingModel()` instead.
341
357
  */
342
- embedding(modelId: GoogleGenerativeAIEmbeddingModelId, settings?: GoogleGenerativeAIEmbeddingSettings): EmbeddingModelV1<string>;
358
+ embedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV2<string>;
343
359
  /**
344
360
  @deprecated Use `textEmbeddingModel()` instead.
345
361
  */
346
- textEmbedding(modelId: GoogleGenerativeAIEmbeddingModelId, settings?: GoogleGenerativeAIEmbeddingSettings): EmbeddingModelV1<string>;
347
- textEmbeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId, settings?: GoogleGenerativeAIEmbeddingSettings): EmbeddingModelV1<string>;
362
+ textEmbedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV2<string>;
363
+ textEmbeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV2<string>;
348
364
  }
349
365
  interface GoogleGenerativeAIProviderSettings {
350
366
  /**