@ai-sdk/google 1.2.17 → 2.0.0-alpha.1

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