@ai-sdk/google 2.0.0-alpha.9 → 2.0.0-beta.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 +142 -0
- package/dist/index.d.mts +110 -290
- package/dist/index.d.ts +110 -290
- package/dist/index.js +472 -209
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +448 -182
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +22 -180
- package/dist/internal/index.d.ts +22 -180
- package/dist/internal/index.js +352 -196
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +328 -173
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +4 -4
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,306 +8,92 @@ declare const googleErrorDataSchema: z.ZodObject<{
|
|
7
8
|
code: z.ZodNullable<z.ZodNumber>;
|
8
9
|
message: z.ZodString;
|
9
10
|
status: z.ZodString;
|
10
|
-
},
|
11
|
-
|
12
|
-
message: string;
|
13
|
-
status: string;
|
14
|
-
}, {
|
15
|
-
code: number | null;
|
16
|
-
message: string;
|
17
|
-
status: string;
|
18
|
-
}>;
|
19
|
-
}, "strip", z.ZodTypeAny, {
|
20
|
-
error: {
|
21
|
-
code: number | null;
|
22
|
-
message: string;
|
23
|
-
status: string;
|
24
|
-
};
|
25
|
-
}, {
|
26
|
-
error: {
|
27
|
-
code: number | null;
|
28
|
-
message: string;
|
29
|
-
status: 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-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-
|
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-pro-exp-03-25' | 'gemini-2.5-flash-preview-04-17' | 'gemini-exp-1206' | 'gemma-3-12b-it' | 'gemma-3-27b-it' | (string & {});
|
35
16
|
declare const googleGenerativeAIProviderOptions: z.ZodObject<{
|
36
|
-
responseModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<
|
17
|
+
responseModalities: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
18
|
+
TEXT: "TEXT";
|
19
|
+
IMAGE: "IMAGE";
|
20
|
+
}>>>;
|
37
21
|
thinkingConfig: z.ZodOptional<z.ZodObject<{
|
38
22
|
thinkingBudget: z.ZodOptional<z.ZodNumber>;
|
39
|
-
|
40
|
-
|
41
|
-
}, {
|
42
|
-
thinkingBudget?: number | undefined;
|
43
|
-
}>>;
|
44
|
-
/**
|
45
|
-
Optional.
|
46
|
-
The name of the cached content used as context to serve the prediction.
|
47
|
-
Format: cachedContents/{cachedContent}
|
48
|
-
*/
|
23
|
+
includeThoughts: z.ZodOptional<z.ZodBoolean>;
|
24
|
+
}, z.core.$strip>>;
|
49
25
|
cachedContent: z.ZodOptional<z.ZodString>;
|
50
|
-
/**
|
51
|
-
* Optional. Enable structured output. Default is true.
|
52
|
-
*
|
53
|
-
* This is useful when the JSON Schema contains elements that are
|
54
|
-
* not supported by the OpenAPI schema version that
|
55
|
-
* Google Generative AI uses. You can use this to disable
|
56
|
-
* structured outputs if you need to.
|
57
|
-
*/
|
58
26
|
structuredOutputs: z.ZodOptional<z.ZodBoolean>;
|
59
|
-
/**
|
60
|
-
Optional. A list of unique safety settings for blocking unsafe content.
|
61
|
-
*/
|
62
27
|
safetySettings: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
63
|
-
category: z.ZodEnum<
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
@note Dynamic retrieval is only compatible with Gemini 1.5 Flash.
|
89
|
-
|
90
|
-
@see https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/ground-with-google-search#dynamic-retrieval
|
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;
|
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";
|
108
52
|
}>>;
|
109
|
-
|
110
|
-
|
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
|
-
}>;
|
53
|
+
audioTimestamp: z.ZodOptional<z.ZodBoolean>;
|
54
|
+
}, z.core.$strip>;
|
146
55
|
type GoogleGenerativeAIProviderOptions = z.infer<typeof googleGenerativeAIProviderOptions>;
|
147
56
|
|
148
57
|
declare const groundingMetadataSchema: z.ZodObject<{
|
149
|
-
webSearchQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString
|
150
|
-
retrievalQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString
|
58
|
+
webSearchQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
59
|
+
retrievalQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
151
60
|
searchEntryPoint: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
152
61
|
renderedContent: z.ZodString;
|
153
|
-
},
|
154
|
-
renderedContent: string;
|
155
|
-
}, {
|
156
|
-
renderedContent: string;
|
157
|
-
}>>>;
|
62
|
+
}, z.core.$strip>>>;
|
158
63
|
groundingChunks: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
159
64
|
web: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
160
65
|
uri: z.ZodString;
|
161
66
|
title: z.ZodString;
|
162
|
-
},
|
163
|
-
uri: string;
|
164
|
-
title: string;
|
165
|
-
}, {
|
166
|
-
uri: string;
|
167
|
-
title: string;
|
168
|
-
}>>>;
|
67
|
+
}, z.core.$strip>>>;
|
169
68
|
retrievedContext: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
170
69
|
uri: z.ZodString;
|
171
70
|
title: z.ZodString;
|
172
|
-
},
|
173
|
-
|
174
|
-
title: string;
|
175
|
-
}, {
|
176
|
-
uri: string;
|
177
|
-
title: string;
|
178
|
-
}>>>;
|
179
|
-
}, "strip", z.ZodTypeAny, {
|
180
|
-
web?: {
|
181
|
-
uri: string;
|
182
|
-
title: string;
|
183
|
-
} | null | undefined;
|
184
|
-
retrievedContext?: {
|
185
|
-
uri: string;
|
186
|
-
title: string;
|
187
|
-
} | null | undefined;
|
188
|
-
}, {
|
189
|
-
web?: {
|
190
|
-
uri: string;
|
191
|
-
title: string;
|
192
|
-
} | null | undefined;
|
193
|
-
retrievedContext?: {
|
194
|
-
uri: string;
|
195
|
-
title: string;
|
196
|
-
} | null | undefined;
|
197
|
-
}>, "many">>>;
|
71
|
+
}, z.core.$strip>>>;
|
72
|
+
}, z.core.$strip>>>>;
|
198
73
|
groundingSupports: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
199
74
|
segment: z.ZodObject<{
|
200
75
|
startIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
201
76
|
endIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
202
77
|
text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
203
|
-
},
|
204
|
-
text?: string | null | undefined;
|
205
|
-
startIndex?: number | null | undefined;
|
206
|
-
endIndex?: number | null | undefined;
|
207
|
-
}, {
|
208
|
-
text?: string | null | undefined;
|
209
|
-
startIndex?: number | null | undefined;
|
210
|
-
endIndex?: number | null | undefined;
|
211
|
-
}>;
|
78
|
+
}, z.core.$strip>;
|
212
79
|
segment_text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
213
|
-
groundingChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber
|
214
|
-
supportChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber
|
215
|
-
confidenceScores: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber
|
216
|
-
confidenceScore: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber
|
217
|
-
},
|
218
|
-
|
219
|
-
text?: string | null | undefined;
|
220
|
-
startIndex?: number | null | undefined;
|
221
|
-
endIndex?: number | null | undefined;
|
222
|
-
};
|
223
|
-
segment_text?: string | null | undefined;
|
224
|
-
groundingChunkIndices?: number[] | null | undefined;
|
225
|
-
supportChunkIndices?: number[] | null | undefined;
|
226
|
-
confidenceScores?: number[] | null | undefined;
|
227
|
-
confidenceScore?: number[] | null | undefined;
|
228
|
-
}, {
|
229
|
-
segment: {
|
230
|
-
text?: string | null | undefined;
|
231
|
-
startIndex?: number | null | undefined;
|
232
|
-
endIndex?: number | null | undefined;
|
233
|
-
};
|
234
|
-
segment_text?: string | null | undefined;
|
235
|
-
groundingChunkIndices?: number[] | null | undefined;
|
236
|
-
supportChunkIndices?: number[] | null | undefined;
|
237
|
-
confidenceScores?: number[] | null | undefined;
|
238
|
-
confidenceScore?: number[] | null | undefined;
|
239
|
-
}>, "many">>>;
|
240
|
-
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<{
|
241
86
|
webDynamicRetrievalScore: z.ZodNumber;
|
242
|
-
},
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
} | null | undefined;
|
253
|
-
groundingChunks?: {
|
254
|
-
web?: {
|
255
|
-
uri: string;
|
256
|
-
title: string;
|
257
|
-
} | null | undefined;
|
258
|
-
retrievedContext?: {
|
259
|
-
uri: string;
|
260
|
-
title: string;
|
261
|
-
} | null | undefined;
|
262
|
-
}[] | null | undefined;
|
263
|
-
groundingSupports?: {
|
264
|
-
segment: {
|
265
|
-
text?: string | null | undefined;
|
266
|
-
startIndex?: number | null | undefined;
|
267
|
-
endIndex?: number | null | undefined;
|
268
|
-
};
|
269
|
-
segment_text?: string | null | undefined;
|
270
|
-
groundingChunkIndices?: number[] | null | undefined;
|
271
|
-
supportChunkIndices?: number[] | null | undefined;
|
272
|
-
confidenceScores?: number[] | null | undefined;
|
273
|
-
confidenceScore?: number[] | null | undefined;
|
274
|
-
}[] | null | undefined;
|
275
|
-
retrievalMetadata?: {
|
276
|
-
webDynamicRetrievalScore: number;
|
277
|
-
} | {} | null | undefined;
|
278
|
-
}, {
|
279
|
-
webSearchQueries?: string[] | null | undefined;
|
280
|
-
retrievalQueries?: string[] | null | undefined;
|
281
|
-
searchEntryPoint?: {
|
282
|
-
renderedContent: string;
|
283
|
-
} | null | undefined;
|
284
|
-
groundingChunks?: {
|
285
|
-
web?: {
|
286
|
-
uri: string;
|
287
|
-
title: string;
|
288
|
-
} | null | undefined;
|
289
|
-
retrievedContext?: {
|
290
|
-
uri: string;
|
291
|
-
title: string;
|
292
|
-
} | null | undefined;
|
293
|
-
}[] | null | undefined;
|
294
|
-
groundingSupports?: {
|
295
|
-
segment: {
|
296
|
-
text?: string | null | undefined;
|
297
|
-
startIndex?: number | null | undefined;
|
298
|
-
endIndex?: number | null | undefined;
|
299
|
-
};
|
300
|
-
segment_text?: string | null | undefined;
|
301
|
-
groundingChunkIndices?: number[] | null | undefined;
|
302
|
-
supportChunkIndices?: number[] | null | undefined;
|
303
|
-
confidenceScores?: number[] | null | undefined;
|
304
|
-
confidenceScore?: number[] | null | undefined;
|
305
|
-
}[] | null | undefined;
|
306
|
-
retrievalMetadata?: {
|
307
|
-
webDynamicRetrievalScore: number;
|
308
|
-
} | {} | null | undefined;
|
309
|
-
}>;
|
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
|
+
|
310
97
|
declare const safetyRatingSchema: z.ZodObject<{
|
311
98
|
category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
312
99
|
probability: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
@@ -314,36 +101,68 @@ declare const safetyRatingSchema: z.ZodObject<{
|
|
314
101
|
severity: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
315
102
|
severityScore: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
316
103
|
blocked: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
317
|
-
},
|
318
|
-
category?: string | null | undefined;
|
319
|
-
probability?: string | null | undefined;
|
320
|
-
probabilityScore?: number | null | undefined;
|
321
|
-
severity?: string | null | undefined;
|
322
|
-
severityScore?: number | null | undefined;
|
323
|
-
blocked?: boolean | null | undefined;
|
324
|
-
}, {
|
325
|
-
category?: string | null | undefined;
|
326
|
-
probability?: string | null | undefined;
|
327
|
-
probabilityScore?: number | null | undefined;
|
328
|
-
severity?: string | null | undefined;
|
329
|
-
severityScore?: number | null | undefined;
|
330
|
-
blocked?: boolean | null | undefined;
|
331
|
-
}>;
|
104
|
+
}, z.core.$strip>;
|
332
105
|
|
333
106
|
type GoogleGenerativeAIGroundingMetadata = z.infer<typeof groundingMetadataSchema>;
|
107
|
+
type GoogleGenerativeAIUrlContextMetadata = z.infer<typeof urlContextMetadataSchema>;
|
334
108
|
type GoogleGenerativeAISafetyRating = z.infer<typeof safetyRatingSchema>;
|
335
109
|
interface GoogleGenerativeAIProviderMetadata {
|
336
110
|
groundingMetadata: GoogleGenerativeAIGroundingMetadata | null;
|
111
|
+
urlContextMetadata: GoogleGenerativeAIUrlContextMetadata | null;
|
337
112
|
safetyRatings: GoogleGenerativeAISafetyRating[] | null;
|
338
113
|
}
|
339
114
|
|
115
|
+
type GoogleGenerativeAIImageModelId = 'imagen-3.0-generate-002' | (string & {});
|
116
|
+
interface GoogleGenerativeAIImageSettings {
|
117
|
+
/**
|
118
|
+
Override the maximum number of images per call (default 4)
|
119
|
+
*/
|
120
|
+
maxImagesPerCall?: number;
|
121
|
+
}
|
122
|
+
|
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
|
+
|
340
139
|
type GoogleGenerativeAIEmbeddingModelId = 'text-embedding-004' | (string & {});
|
341
140
|
|
141
|
+
declare const googleTools: {
|
142
|
+
/**
|
143
|
+
* Creates a Google search tool that gives Google direct access to real-time web content.
|
144
|
+
* Must have name "google_search".
|
145
|
+
*/
|
146
|
+
googleSearch: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{}, {
|
147
|
+
mode?: "MODE_DYNAMIC" | "MODE_UNSPECIFIED";
|
148
|
+
dynamicThreshold?: number;
|
149
|
+
}>;
|
150
|
+
/**
|
151
|
+
* Creates a URL context tool that gives Google direct access to real-time web content.
|
152
|
+
* Must have name "url_context".
|
153
|
+
*/
|
154
|
+
urlContext: _ai_sdk_provider_utils.ProviderDefinedToolFactory<{}, {}>;
|
155
|
+
};
|
156
|
+
|
342
157
|
interface GoogleGenerativeAIProvider extends ProviderV2 {
|
343
158
|
(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
|
344
159
|
languageModel(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
|
345
160
|
chat(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
|
346
161
|
/**
|
162
|
+
Creates a model for image generation.
|
163
|
+
*/
|
164
|
+
image(modelId: GoogleGenerativeAIImageModelId, settings?: GoogleGenerativeAIImageSettings): ImageModelV2;
|
165
|
+
/**
|
347
166
|
* @deprecated Use `chat()` instead.
|
348
167
|
*/
|
349
168
|
generativeAI(modelId: GoogleGenerativeAIModelId): LanguageModelV2;
|
@@ -356,6 +175,7 @@ interface GoogleGenerativeAIProvider extends ProviderV2 {
|
|
356
175
|
*/
|
357
176
|
textEmbedding(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV2<string>;
|
358
177
|
textEmbeddingModel(modelId: GoogleGenerativeAIEmbeddingModelId): EmbeddingModelV2<string>;
|
178
|
+
tools: typeof googleTools;
|
359
179
|
}
|
360
180
|
interface GoogleGenerativeAIProviderSettings {
|
361
181
|
/**
|
@@ -391,4 +211,4 @@ Default Google Generative AI provider instance.
|
|
391
211
|
*/
|
392
212
|
declare const google: GoogleGenerativeAIProvider;
|
393
213
|
|
394
|
-
export { type GoogleErrorData, type GoogleGenerativeAIProvider, type GoogleGenerativeAIProviderMetadata, type GoogleGenerativeAIProviderOptions, type GoogleGenerativeAIProviderSettings, createGoogleGenerativeAI, google };
|
214
|
+
export { type GoogleErrorData, type GoogleGenerativeAIImageProviderOptions, type GoogleGenerativeAIProvider, type GoogleGenerativeAIProviderMetadata, type GoogleGenerativeAIProviderOptions, type GoogleGenerativeAIProviderSettings, createGoogleGenerativeAI, google };
|