@ai-sdk/google 2.0.0-canary.9 → 2.0.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/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
- import { z } from 'zod';
2
- import { ProviderV2, LanguageModelV2, EmbeddingModelV2 } from '@ai-sdk/provider';
1
+ import { z } from 'zod/v4';
2
+ import { ProviderV2, LanguageModelV2, ImageModelV2, EmbeddingModelV2 } from '@ai-sdk/provider';
3
+ import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
3
4
  import { FetchFunction } from '@ai-sdk/provider-utils';
4
5
 
5
6
  declare const googleErrorDataSchema: z.ZodObject<{
@@ -7,313 +8,202 @@ declare const googleErrorDataSchema: z.ZodObject<{
7
8
  code: z.ZodNullable<z.ZodNumber>;
8
9
  message: z.ZodString;
9
10
  status: z.ZodString;
10
- }, "strip", z.ZodTypeAny, {
11
- status: string;
12
- code: number | null;
13
- message: string;
14
- }, {
15
- status: string;
16
- code: number | null;
17
- message: string;
18
- }>;
19
- }, "strip", z.ZodTypeAny, {
20
- error: {
21
- status: string;
22
- code: number | null;
23
- message: string;
24
- };
25
- }, {
26
- error: {
27
- status: string;
28
- code: number | null;
29
- message: string;
30
- };
31
- }>;
11
+ }, z.core.$strip>;
12
+ }, z.core.$strip>;
32
13
  type GoogleErrorData = z.infer<typeof googleErrorDataSchema>;
33
14
 
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 {
47
- /**
48
- Optional.
49
- The name of the cached content used as context to serve the prediction.
50
- Format: cachedContents/{cachedContent}
51
- */
52
- cachedContent?: string;
53
- /**
54
- * Optional. Enable structured output. Default is true.
55
- *
56
- * This is useful when the JSON Schema contains elements that are
57
- * not supported by the OpenAPI schema version that
58
- * Google Generative AI uses. You can use this to disable
59
- * structured outputs if you need to.
60
- */
61
- structuredOutputs?: boolean;
62
- /**
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
- }>;
69
- /**
70
- * Optional. Enables timestamp understanding for audio-only files.
71
- *
72
- * https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
73
- */
74
- audioTimestamp?: boolean;
75
- /**
76
- Optional. When enabled, the model will use Google search to ground the response.
77
-
78
- @see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/overview
79
- */
80
- useSearchGrounding?: boolean;
81
- /**
82
- Optional. Specifies the dynamic retrieval configuration.
83
-
84
- @note Dynamic retrieval is only compatible with Gemini 1.5 Flash.
85
-
86
- @see https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/ground-with-google-search#dynamic-retrieval
87
- */
88
- dynamicRetrievalConfig?: DynamicRetrievalConfig;
89
- }
15
+ 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' | 'gemini-2.5-flash' | 'gemini-2.5-flash-lite' | 'gemini-2.5-pro-exp-03-25' | 'gemini-2.5-flash-preview-04-17' | 'gemini-exp-1206' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
16
+ declare const googleGenerativeAIProviderOptions: z.ZodObject<{
17
+ responseModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
18
+ TEXT: "TEXT";
19
+ IMAGE: "IMAGE";
20
+ }>>>;
21
+ thinkingConfig: z.ZodOptional<z.ZodObject<{
22
+ thinkingBudget: z.ZodOptional<z.ZodNumber>;
23
+ includeThoughts: z.ZodOptional<z.ZodBoolean>;
24
+ }, z.core.$strip>>;
25
+ cachedContent: z.ZodOptional<z.ZodString>;
26
+ structuredOutputs: z.ZodOptional<z.ZodBoolean>;
27
+ safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
28
+ category: z.ZodEnum<{
29
+ HARM_CATEGORY_UNSPECIFIED: "HARM_CATEGORY_UNSPECIFIED";
30
+ HARM_CATEGORY_HATE_SPEECH: "HARM_CATEGORY_HATE_SPEECH";
31
+ HARM_CATEGORY_DANGEROUS_CONTENT: "HARM_CATEGORY_DANGEROUS_CONTENT";
32
+ HARM_CATEGORY_HARASSMENT: "HARM_CATEGORY_HARASSMENT";
33
+ HARM_CATEGORY_SEXUALLY_EXPLICIT: "HARM_CATEGORY_SEXUALLY_EXPLICIT";
34
+ HARM_CATEGORY_CIVIC_INTEGRITY: "HARM_CATEGORY_CIVIC_INTEGRITY";
35
+ }>;
36
+ threshold: z.ZodEnum<{
37
+ HARM_BLOCK_THRESHOLD_UNSPECIFIED: "HARM_BLOCK_THRESHOLD_UNSPECIFIED";
38
+ BLOCK_LOW_AND_ABOVE: "BLOCK_LOW_AND_ABOVE";
39
+ BLOCK_MEDIUM_AND_ABOVE: "BLOCK_MEDIUM_AND_ABOVE";
40
+ BLOCK_ONLY_HIGH: "BLOCK_ONLY_HIGH";
41
+ BLOCK_NONE: "BLOCK_NONE";
42
+ OFF: "OFF";
43
+ }>;
44
+ }, z.core.$strip>>>;
45
+ threshold: z.ZodOptional<z.ZodEnum<{
46
+ HARM_BLOCK_THRESHOLD_UNSPECIFIED: "HARM_BLOCK_THRESHOLD_UNSPECIFIED";
47
+ BLOCK_LOW_AND_ABOVE: "BLOCK_LOW_AND_ABOVE";
48
+ BLOCK_MEDIUM_AND_ABOVE: "BLOCK_MEDIUM_AND_ABOVE";
49
+ BLOCK_ONLY_HIGH: "BLOCK_ONLY_HIGH";
50
+ BLOCK_NONE: "BLOCK_NONE";
51
+ OFF: "OFF";
52
+ }>>;
53
+ audioTimestamp: z.ZodOptional<z.ZodBoolean>;
54
+ }, z.core.$strip>;
55
+ type GoogleGenerativeAIProviderOptions = z.infer<typeof googleGenerativeAIProviderOptions>;
90
56
 
91
57
  declare const groundingMetadataSchema: z.ZodObject<{
92
- webSearchQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
93
- retrievalQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString, "many">>>;
58
+ webSearchQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
59
+ retrievalQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
94
60
  searchEntryPoint: z.ZodOptional<z.ZodNullable<z.ZodObject<{
95
61
  renderedContent: z.ZodString;
96
- }, "strip", z.ZodTypeAny, {
97
- renderedContent: string;
98
- }, {
99
- renderedContent: string;
100
- }>>>;
62
+ }, z.core.$strip>>>;
101
63
  groundingChunks: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
102
64
  web: z.ZodOptional<z.ZodNullable<z.ZodObject<{
103
65
  uri: z.ZodString;
104
66
  title: z.ZodString;
105
- }, "strip", z.ZodTypeAny, {
106
- uri: string;
107
- title: string;
108
- }, {
109
- uri: string;
110
- title: string;
111
- }>>>;
67
+ }, z.core.$strip>>>;
112
68
  retrievedContext: z.ZodOptional<z.ZodNullable<z.ZodObject<{
113
69
  uri: z.ZodString;
114
70
  title: z.ZodString;
115
- }, "strip", z.ZodTypeAny, {
116
- uri: string;
117
- title: string;
118
- }, {
119
- uri: string;
120
- title: string;
121
- }>>>;
122
- }, "strip", z.ZodTypeAny, {
123
- web?: {
124
- uri: string;
125
- title: string;
126
- } | null | undefined;
127
- retrievedContext?: {
128
- uri: string;
129
- title: string;
130
- } | null | undefined;
131
- }, {
132
- web?: {
133
- uri: string;
134
- title: string;
135
- } | null | undefined;
136
- retrievedContext?: {
137
- uri: string;
138
- title: string;
139
- } | null | undefined;
140
- }>, "many">>>;
71
+ }, z.core.$strip>>>;
72
+ }, z.core.$strip>>>>;
141
73
  groundingSupports: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
142
74
  segment: z.ZodObject<{
143
75
  startIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
144
76
  endIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
145
77
  text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
146
- }, "strip", z.ZodTypeAny, {
147
- startIndex?: number | null | undefined;
148
- endIndex?: number | null | undefined;
149
- text?: string | null | undefined;
150
- }, {
151
- startIndex?: number | null | undefined;
152
- endIndex?: number | null | undefined;
153
- text?: string | null | undefined;
154
- }>;
78
+ }, z.core.$strip>;
155
79
  segment_text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
156
- groundingChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
157
- supportChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
158
- confidenceScores: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
159
- confidenceScore: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
160
- }, "strip", z.ZodTypeAny, {
161
- segment: {
162
- startIndex?: number | null | undefined;
163
- endIndex?: number | null | undefined;
164
- text?: string | null | undefined;
165
- };
166
- segment_text?: string | null | undefined;
167
- groundingChunkIndices?: number[] | null | undefined;
168
- supportChunkIndices?: number[] | null | undefined;
169
- confidenceScores?: number[] | null | undefined;
170
- confidenceScore?: number[] | null | undefined;
171
- }, {
172
- segment: {
173
- startIndex?: number | null | undefined;
174
- endIndex?: number | null | undefined;
175
- text?: string | null | undefined;
176
- };
177
- segment_text?: string | null | undefined;
178
- groundingChunkIndices?: number[] | null | undefined;
179
- supportChunkIndices?: number[] | null | undefined;
180
- confidenceScores?: number[] | null | undefined;
181
- confidenceScore?: number[] | null | undefined;
182
- }>, "many">>>;
183
- retrievalMetadata: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodObject<{
80
+ groundingChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
81
+ supportChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
82
+ confidenceScores: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
83
+ confidenceScore: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
84
+ }, z.core.$strip>>>>;
85
+ retrievalMetadata: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
184
86
  webDynamicRetrievalScore: z.ZodNumber;
185
- }, "strip", z.ZodTypeAny, {
186
- webDynamicRetrievalScore: number;
187
- }, {
188
- webDynamicRetrievalScore: number;
189
- }>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>>;
190
- }, "strip", z.ZodTypeAny, {
191
- webSearchQueries?: string[] | null | undefined;
192
- retrievalQueries?: string[] | null | undefined;
193
- searchEntryPoint?: {
194
- renderedContent: string;
195
- } | null | undefined;
196
- groundingChunks?: {
197
- web?: {
198
- uri: string;
199
- title: string;
200
- } | null | undefined;
201
- retrievedContext?: {
202
- uri: string;
203
- title: string;
204
- } | null | undefined;
205
- }[] | null | undefined;
206
- groundingSupports?: {
207
- segment: {
208
- startIndex?: number | null | undefined;
209
- endIndex?: number | null | undefined;
210
- text?: string | null | undefined;
211
- };
212
- segment_text?: string | null | undefined;
213
- groundingChunkIndices?: number[] | null | undefined;
214
- supportChunkIndices?: number[] | null | undefined;
215
- confidenceScores?: number[] | null | undefined;
216
- confidenceScore?: number[] | null | undefined;
217
- }[] | null | undefined;
218
- retrievalMetadata?: {
219
- webDynamicRetrievalScore: number;
220
- } | {} | null | undefined;
221
- }, {
222
- webSearchQueries?: string[] | null | undefined;
223
- retrievalQueries?: string[] | null | undefined;
224
- searchEntryPoint?: {
225
- renderedContent: string;
226
- } | null | undefined;
227
- groundingChunks?: {
228
- web?: {
229
- uri: string;
230
- title: string;
231
- } | null | undefined;
232
- retrievedContext?: {
233
- uri: string;
234
- title: string;
235
- } | null | undefined;
236
- }[] | null | undefined;
237
- groundingSupports?: {
238
- segment: {
239
- startIndex?: number | null | undefined;
240
- endIndex?: number | null | undefined;
241
- text?: string | null | undefined;
242
- };
243
- segment_text?: string | null | undefined;
244
- groundingChunkIndices?: number[] | null | undefined;
245
- supportChunkIndices?: number[] | null | undefined;
246
- confidenceScores?: number[] | null | undefined;
247
- confidenceScore?: number[] | null | undefined;
248
- }[] | null | undefined;
249
- retrievalMetadata?: {
250
- webDynamicRetrievalScore: number;
251
- } | {} | null | undefined;
252
- }>;
87
+ }, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>>>;
88
+ }, z.core.$strip>;
89
+
90
+ declare const urlContextMetadataSchema: z.ZodObject<{
91
+ urlMetadata: z.ZodArray<z.ZodObject<{
92
+ retrievedUrl: z.ZodString;
93
+ urlRetrievalStatus: z.ZodString;
94
+ }, z.core.$strip>>;
95
+ }, z.core.$strip>;
96
+
253
97
  declare const safetyRatingSchema: z.ZodObject<{
254
- category: z.ZodString;
255
- probability: z.ZodString;
98
+ category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
99
+ probability: z.ZodOptional<z.ZodNullable<z.ZodString>>;
256
100
  probabilityScore: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
257
101
  severity: z.ZodOptional<z.ZodNullable<z.ZodString>>;
258
102
  severityScore: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
259
103
  blocked: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
260
- }, "strip", z.ZodTypeAny, {
261
- category: string;
262
- probability: string;
263
- probabilityScore?: number | null | undefined;
264
- severity?: string | null | undefined;
265
- severityScore?: number | null | undefined;
266
- blocked?: boolean | null | undefined;
267
- }, {
268
- category: string;
269
- probability: string;
270
- probabilityScore?: number | null | undefined;
271
- severity?: string | null | undefined;
272
- severityScore?: number | null | undefined;
273
- blocked?: boolean | null | undefined;
274
- }>;
275
- declare const googleGenerativeAIProviderOptionsSchema: z.ZodObject<{
276
- responseModalities: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodEnum<["TEXT", "IMAGE"]>, "many">>>;
277
- }, "strip", z.ZodTypeAny, {
278
- responseModalities?: ("TEXT" | "IMAGE")[] | null | undefined;
279
- }, {
280
- responseModalities?: ("TEXT" | "IMAGE")[] | null | undefined;
281
- }>;
282
- type GoogleGenerativeAIProviderOptions = z.infer<typeof googleGenerativeAIProviderOptionsSchema>;
104
+ }, z.core.$strip>;
283
105
 
284
106
  type GoogleGenerativeAIGroundingMetadata = z.infer<typeof groundingMetadataSchema>;
107
+ type GoogleGenerativeAIUrlContextMetadata = z.infer<typeof urlContextMetadataSchema>;
285
108
  type GoogleGenerativeAISafetyRating = z.infer<typeof safetyRatingSchema>;
286
109
  interface GoogleGenerativeAIProviderMetadata {
287
110
  groundingMetadata: GoogleGenerativeAIGroundingMetadata | null;
111
+ urlContextMetadata: GoogleGenerativeAIUrlContextMetadata | null;
288
112
  safetyRatings: GoogleGenerativeAISafetyRating[] | null;
289
113
  }
290
114
 
291
- type GoogleGenerativeAIEmbeddingModelId = 'text-embedding-004' | (string & {});
292
- interface GoogleGenerativeAIEmbeddingSettings {
115
+ type GoogleGenerativeAIImageModelId = 'imagen-3.0-generate-002' | (string & {});
116
+ interface GoogleGenerativeAIImageSettings {
293
117
  /**
294
- * Optional. Optional reduced dimension for the output embedding.
295
- * If set, excessive values in the output embedding are truncated from the end.
118
+ Override the maximum number of images per call (default 4)
296
119
  */
297
- outputDimensionality?: number;
120
+ maxImagesPerCall?: number;
298
121
  }
299
122
 
300
- interface GoogleGenerativeAIProvider extends ProviderV2 {
301
- (modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV2;
302
- languageModel(modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV2;
303
- chat(modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV2;
123
+ declare const googleImageProviderOptionsSchema: z.ZodObject<{
124
+ personGeneration: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
125
+ dont_allow: "dont_allow";
126
+ allow_adult: "allow_adult";
127
+ allow_all: "allow_all";
128
+ }>>>;
129
+ aspectRatio: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
130
+ "1:1": "1:1";
131
+ "3:4": "3:4";
132
+ "4:3": "4:3";
133
+ "9:16": "9:16";
134
+ "16:9": "16:9";
135
+ }>>>;
136
+ }, z.core.$strip>;
137
+ type GoogleGenerativeAIImageProviderOptions = z.infer<typeof googleImageProviderOptionsSchema>;
138
+
139
+ type GoogleGenerativeAIEmbeddingModelId = 'gemini-embedding-001' | 'text-embedding-004' | (string & {});
140
+ declare const googleGenerativeAIEmbeddingProviderOptions: z.ZodObject<{
141
+ outputDimensionality: z.ZodOptional<z.ZodNumber>;
142
+ taskType: z.ZodOptional<z.ZodEnum<{
143
+ SEMANTIC_SIMILARITY: "SEMANTIC_SIMILARITY";
144
+ CLASSIFICATION: "CLASSIFICATION";
145
+ CLUSTERING: "CLUSTERING";
146
+ RETRIEVAL_DOCUMENT: "RETRIEVAL_DOCUMENT";
147
+ RETRIEVAL_QUERY: "RETRIEVAL_QUERY";
148
+ QUESTION_ANSWERING: "QUESTION_ANSWERING";
149
+ FACT_VERIFICATION: "FACT_VERIFICATION";
150
+ CODE_RETRIEVAL_QUERY: "CODE_RETRIEVAL_QUERY";
151
+ }>>;
152
+ }, z.core.$strip>;
153
+ type GoogleGenerativeAIEmbeddingProviderOptions = z.infer<typeof googleGenerativeAIEmbeddingProviderOptions>;
154
+
155
+ declare const googleTools: {
304
156
  /**
305
- * @deprecated Use `chat()` instead.
157
+ * Creates a Google search tool that gives Google direct access to real-time web content.
158
+ * Must have name "google_search".
306
159
  */
307
- generativeAI(modelId: GoogleGenerativeAIModelId, settings?: GoogleGenerativeAISettings): LanguageModelV2;
160
+ googleSearch: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{}, {
161
+ mode?: "MODE_DYNAMIC" | "MODE_UNSPECIFIED";
162
+ dynamicThreshold?: number;
163
+ }>;
308
164
  /**
309
- @deprecated Use `textEmbeddingModel()` instead.
165
+ * Creates a URL context tool that gives Google direct access to real-time web content.
166
+ * Must have name "url_context".
310
167
  */
311
- embedding(modelId: GoogleGenerativeAIEmbeddingModelId, settings?: GoogleGenerativeAIEmbeddingSettings): EmbeddingModelV2<string>;
168
+ urlContext: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{}, {}>;
312
169
  /**
313
- @deprecated Use `textEmbeddingModel()` instead.
170
+ * A tool that enables the model to generate and run Python code.
171
+ * Must have name "code_execution".
172
+ *
173
+ * @note Ensure the selected model supports Code Execution.
174
+ * Multi-tool usage with the code execution tool is typically compatible with Gemini >=2 models.
175
+ *
176
+ * @see https://ai.google.dev/gemini-api/docs/code-execution (Google AI)
177
+ * @see https://cloud.google.com/vertex-ai/generative-ai/docs/model-reference/code-execution-api (Vertex AI)
178
+ */
179
+ codeExecution: _ai_sdk_provider_utils.ProviderDefinedToolFactoryWithOutputSchema<{
180
+ language: string;
181
+ code: string;
182
+ }, {
183
+ outcome: string;
184
+ output: string;
185
+ }, {}>;
186
+ };
187
+
188
+ interface GoogleGenerativeAIProvider extends ProviderV2 {
189
+ (modelId: GoogleGenerativeAIModelId): LanguageModelV2;
190
+ languageModel(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
191
+ chat(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
192
+ /**
193
+ Creates a model for image generation.
314
194
  */
315
- textEmbedding(modelId: GoogleGenerativeAIEmbeddingModelId, settings?: GoogleGenerativeAIEmbeddingSettings): EmbeddingModelV2<string>;
316
- textEmbeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId, settings?: GoogleGenerativeAIEmbeddingSettings): EmbeddingModelV2<string>;
195
+ image(modelId: GoogleGenerativeAIImageModelId, settings?: GoogleGenerativeAIImageSettings): ImageModelV2;
196
+ /**
197
+ * @deprecated Use `chat()` instead.
198
+ */
199
+ generativeAI(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
200
+ /**
201
+ @deprecated Use `textEmbedding()` instead.
202
+ */
203
+ embedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV2<string>;
204
+ textEmbedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV2<string>;
205
+ textEmbeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV2<string>;
206
+ tools: typeof googleTools;
317
207
  }
318
208
  interface GoogleGenerativeAIProviderSettings {
319
209
  /**
@@ -349,4 +239,4 @@ Default Google Generative AI provider instance.
349
239
  */
350
240
  declare const google: GoogleGenerativeAIProvider;
351
241
 
352
- export { type GoogleErrorData, type GoogleGenerativeAIProvider, type GoogleGenerativeAIProviderMetadata, type GoogleGenerativeAIProviderOptions, type GoogleGenerativeAIProviderSettings, createGoogleGenerativeAI, google };
242
+ export { type GoogleErrorData, type GoogleGenerativeAIEmbeddingProviderOptions, type GoogleGenerativeAIImageProviderOptions, type GoogleGenerativeAIProvider, type GoogleGenerativeAIProviderMetadata, type GoogleGenerativeAIProviderOptions, type GoogleGenerativeAIProviderSettings, createGoogleGenerativeAI, google };