@ai-sdk/google 1.2.18 → 2.0.0-alpha.2

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,90 +1,232 @@
1
1
  # @ai-sdk/google
2
2
 
3
- ## 1.2.18
3
+ ## 2.0.0-alpha.2
4
4
 
5
5
  ### Patch Changes
6
6
 
7
- - 4b2e1b0: Add reasoning token output support for gemini models via Vertex AI Provider
7
+ - Updated dependencies [26535e0]
8
+ - @ai-sdk/provider@2.0.0-alpha.2
9
+ - @ai-sdk/provider-utils@3.0.0-alpha.2
8
10
 
9
- ## 1.2.17
11
+ ## 2.0.0-alpha.1
10
12
 
11
13
  ### Patch Changes
12
14
 
13
- - Updated dependencies [d87b9d1]
14
- - @ai-sdk/provider-utils@2.2.8
15
+ - Updated dependencies [3f2f00c]
16
+ - @ai-sdk/provider@2.0.0-alpha.1
17
+ - @ai-sdk/provider-utils@3.0.0-alpha.1
15
18
 
16
- ## 1.2.16
19
+ ## 2.0.0-canary.20
17
20
 
18
21
  ### Patch Changes
19
22
 
20
- - 0ca6f2f: feat(providers/google): add gemini-2.5-pro-preview-05-06
23
+ - Updated dependencies [faf8446]
24
+ - @ai-sdk/provider-utils@3.0.0-canary.19
21
25
 
22
- ## 1.2.15
26
+ ## 2.0.0-canary.19
23
27
 
24
28
  ### Patch Changes
25
29
 
26
- - 2afd354: fix(providers/google): accept nullish in safetyRatings
30
+ - Updated dependencies [40acf9b]
31
+ - @ai-sdk/provider-utils@3.0.0-canary.18
27
32
 
28
- ## 1.2.14
33
+ ## 2.0.0-canary.18
29
34
 
30
35
  ### Patch Changes
31
36
 
32
- - c695a7e: feat (provider/google): add new gemini models
37
+ - f07a6d4: fix(providers/google): accept nullish in safetyRatings
38
+ - Updated dependencies [ea7a7c9]
39
+ - @ai-sdk/provider-utils@3.0.0-canary.17
33
40
 
34
- ## 1.2.13
41
+ ## 2.0.0-canary.17
35
42
 
36
43
  ### Patch Changes
37
44
 
38
- - 6183b08: feat(providers/google): Add taskType support for Text Embedding Models
45
+ - Updated dependencies [87b828f]
46
+ - @ai-sdk/provider-utils@3.0.0-canary.16
39
47
 
40
- ## 1.2.12
48
+ ## 2.0.0-canary.16
41
49
 
42
50
  ### Patch Changes
43
51
 
44
- - c56331d: feat (providers/google): add thinking config to provider options
52
+ - Updated dependencies [a571d6e]
53
+ - Updated dependencies [a8c8bd5]
54
+ - Updated dependencies [7979f7f]
55
+ - Updated dependencies [41fa418]
56
+ - @ai-sdk/provider-utils@3.0.0-canary.15
57
+ - @ai-sdk/provider@2.0.0-canary.14
45
58
 
46
- ## 1.2.11
59
+ ## 2.0.0-canary.15
47
60
 
48
61
  ### Patch Changes
49
62
 
50
- - Updated dependencies [beef951]
51
- - @ai-sdk/provider@1.1.3
52
- - @ai-sdk/provider-utils@2.2.7
63
+ - Updated dependencies [957b739]
64
+ - Updated dependencies [9bd5ab5]
65
+ - @ai-sdk/provider-utils@3.0.0-canary.14
66
+ - @ai-sdk/provider@2.0.0-canary.13
53
67
 
54
- ## 1.2.10
68
+ ## 2.0.0-canary.14
55
69
 
56
70
  ### Patch Changes
57
71
 
58
- - Updated dependencies [013faa8]
59
- - @ai-sdk/provider@1.1.2
60
- - @ai-sdk/provider-utils@2.2.6
72
+ - f916255: feat (provider/google): add new gemini models
73
+ - Updated dependencies [7b3ae3f]
74
+ - Updated dependencies [0ff02bb]
75
+ - @ai-sdk/provider@2.0.0-canary.12
76
+ - @ai-sdk/provider-utils@3.0.0-canary.13
61
77
 
62
- ## 1.2.9
78
+ ## 2.0.0-canary.13
63
79
 
64
80
  ### Patch Changes
65
81
 
66
- - Updated dependencies [c21fa6d]
67
- - @ai-sdk/provider-utils@2.2.5
68
- - @ai-sdk/provider@1.1.1
82
+ - 7378473: chore(providers/google): switch to providerOptions
83
+ - Updated dependencies [9bf7291]
84
+ - Updated dependencies [4617fab]
85
+ - Updated dependencies [e030615]
86
+ - @ai-sdk/provider@2.0.0-canary.11
87
+ - @ai-sdk/provider-utils@3.0.0-canary.12
69
88
 
70
- ## 1.2.8
89
+ ## 2.0.0-canary.12
71
90
 
72
91
  ### Patch Changes
73
92
 
74
- - 1e8e66d: fix (provider/google): allow "OFF" for Google HarmBlockThreshold
93
+ - 888b750: feat(providers/google): Add taskType support for Text Embedding Models
94
+ - 66962ed: fix(packages): export node10 compatible types
95
+ - Updated dependencies [66962ed]
96
+ - Updated dependencies [9301f86]
97
+ - Updated dependencies [a3f768e]
98
+ - @ai-sdk/provider-utils@3.0.0-canary.11
99
+ - @ai-sdk/provider@2.0.0-canary.10
75
100
 
76
- ## 1.2.7
101
+ ## 2.0.0-canary.11
77
102
 
78
103
  ### Patch Changes
79
104
 
80
- - 1789884: feat: add provider option schemas for vertex imagegen and google genai
105
+ - Updated dependencies [e86be6f]
106
+ - @ai-sdk/provider@2.0.0-canary.9
107
+ - @ai-sdk/provider-utils@3.0.0-canary.10
81
108
 
82
- ## 1.2.6
109
+ ## 2.0.0-canary.10
83
110
 
84
111
  ### Patch Changes
85
112
 
86
- - Updated dependencies [2c19b9a]
87
- - @ai-sdk/provider-utils@2.2.4
113
+ - 3259565: feat (providers/google): add thinking config to provider options
114
+ - fd98925: chore(providers/google): update embedding model to use providerOptions
115
+ - Updated dependencies [95857aa]
116
+ - Updated dependencies [7ea4132]
117
+ - @ai-sdk/provider@2.0.0-canary.8
118
+ - @ai-sdk/provider-utils@3.0.0-canary.9
119
+
120
+ ## 2.0.0-canary.9
121
+
122
+ ### Patch Changes
123
+
124
+ - Updated dependencies [5d142ab]
125
+ - Updated dependencies [b6b43c7]
126
+ - Updated dependencies [8aa9e20]
127
+ - Updated dependencies [3795467]
128
+ - @ai-sdk/provider-utils@3.0.0-canary.8
129
+ - @ai-sdk/provider@2.0.0-canary.7
130
+
131
+ ## 2.0.0-canary.8
132
+
133
+ ### Patch Changes
134
+
135
+ - 26735b5: chore(embedding-model): add v2 interface
136
+ - 443d8ec: feat(embedding-model-v2): add response body field
137
+ - fd65bc6: chore(embedding-model-v2): rename rawResponse to response
138
+ - Updated dependencies [26735b5]
139
+ - Updated dependencies [443d8ec]
140
+ - Updated dependencies [14c9410]
141
+ - Updated dependencies [d9c98f4]
142
+ - Updated dependencies [c4a2fec]
143
+ - Updated dependencies [0054544]
144
+ - Updated dependencies [9e9c809]
145
+ - Updated dependencies [32831c6]
146
+ - Updated dependencies [d0f9495]
147
+ - Updated dependencies [fd65bc6]
148
+ - Updated dependencies [393138b]
149
+ - Updated dependencies [7182d14]
150
+ - @ai-sdk/provider@2.0.0-canary.6
151
+ - @ai-sdk/provider-utils@3.0.0-canary.7
152
+
153
+ ## 2.0.0-canary.7
154
+
155
+ ### Patch Changes
156
+
157
+ - f10304b: feat(tool-calling): don't require the user to have to pass parameters
158
+ - Updated dependencies [411e483]
159
+ - Updated dependencies [79457bd]
160
+ - Updated dependencies [ad80501]
161
+ - Updated dependencies [1766ede]
162
+ - Updated dependencies [f10304b]
163
+ - @ai-sdk/provider@2.0.0-canary.5
164
+ - @ai-sdk/provider-utils@3.0.0-canary.6
165
+
166
+ ## 2.0.0-canary.6
167
+
168
+ ### Patch Changes
169
+
170
+ - Updated dependencies [6f6bb89]
171
+ - @ai-sdk/provider@2.0.0-canary.4
172
+ - @ai-sdk/provider-utils@3.0.0-canary.5
173
+
174
+ ## 2.0.0-canary.5
175
+
176
+ ### Patch Changes
177
+
178
+ - Updated dependencies [d1a1aa1]
179
+ - @ai-sdk/provider@2.0.0-canary.3
180
+ - @ai-sdk/provider-utils@3.0.0-canary.4
181
+
182
+ ## 2.0.0-canary.4
183
+
184
+ ### Patch Changes
185
+
186
+ - Updated dependencies [a166433]
187
+ - Updated dependencies [abf9a79]
188
+ - Updated dependencies [9f95b35]
189
+ - Updated dependencies [0a87932]
190
+ - Updated dependencies [6dc848c]
191
+ - @ai-sdk/provider-utils@3.0.0-canary.3
192
+ - @ai-sdk/provider@2.0.0-canary.2
193
+
194
+ ## 2.0.0-canary.3
195
+
196
+ ### Patch Changes
197
+
198
+ - Updated dependencies [c57e248]
199
+ - Updated dependencies [33f4a6a]
200
+ - @ai-sdk/provider@2.0.0-canary.1
201
+ - @ai-sdk/provider-utils@3.0.0-canary.2
202
+
203
+ ## 2.0.0-canary.2
204
+
205
+ ### Patch Changes
206
+
207
+ - 5cf30ea: fix (provider/google): allow "OFF" for Google HarmBlockThreshold
208
+
209
+ ## 2.0.0-canary.1
210
+
211
+ ### Patch Changes
212
+
213
+ - 779d916: feat: add provider option schemas for vertex imagegen and google genai
214
+ - Updated dependencies [060370c]
215
+ - Updated dependencies [0c0c0b3]
216
+ - Updated dependencies [63d791d]
217
+ - @ai-sdk/provider-utils@3.0.0-canary.1
218
+
219
+ ## 2.0.0-canary.0
220
+
221
+ ### Major Changes
222
+
223
+ - d5f588f: AI SDK 5
224
+
225
+ ### Patch Changes
226
+
227
+ - Updated dependencies [d5f588f]
228
+ - @ai-sdk/provider-utils@3.0.0-canary.0
229
+ - @ai-sdk/provider@2.0.0-canary.0
88
230
 
89
231
  ## 1.2.5
90
232
 
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,45 @@ 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
+ }, "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,32 +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
- 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
332
 
302
333
  type GoogleGenerativeAIGroundingMetadata = z.infer<typeof groundingMetadataSchema>;
303
334
  type GoogleGenerativeAISafetyRating = z.infer<typeof safetyRatingSchema>;
@@ -307,44 +338,24 @@ interface GoogleGenerativeAIProviderMetadata {
307
338
  }
308
339
 
309
340
  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
341
 
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;
342
+ interface GoogleGenerativeAIProvider extends ProviderV2 {
343
+ (modelId: GoogleGenerativeAIModelId): LanguageModelV2;
344
+ languageModel(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
345
+ chat(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
335
346
  /**
336
347
  * @deprecated Use `chat()` instead.
337
348
  */
338
- generativeAI(modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV1;
349
+ generativeAI(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
339
350
  /**
340
351
  @deprecated Use `textEmbeddingModel()` instead.
341
352
  */
342
- embedding(modelId: GoogleGenerativeAIEmbeddingModelId, settings?: GoogleGenerativeAIEmbeddingSettings): EmbeddingModelV1<string>;
353
+ embedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV2<string>;
343
354
  /**
344
355
  @deprecated Use `textEmbeddingModel()` instead.
345
356
  */
346
- textEmbedding(modelId: GoogleGenerativeAIEmbeddingModelId, settings?: GoogleGenerativeAIEmbeddingSettings): EmbeddingModelV1<string>;
347
- textEmbeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId, settings?: GoogleGenerativeAIEmbeddingSettings): EmbeddingModelV1<string>;
357
+ textEmbedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV2<string>;
358
+ textEmbeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV2<string>;
348
359
  }
349
360
  interface GoogleGenerativeAIProviderSettings {
350
361
  /**