@ai-sdk/google 2.0.0-beta.2 → 2.0.0-beta.3
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 +11 -0
- package/dist/index.d.mts +56 -289
- package/dist/index.d.ts +56 -289
- package/dist/index.js +93 -93
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.d.mts +18 -162
- package/dist/internal/index.d.ts +18 -162
- package/dist/internal/index.js +86 -86
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +3 -3
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/internal/index.d.ts
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
import { LanguageModelV2 } from '@ai-sdk/provider';
|
2
2
|
import { Resolvable, FetchFunction } from '@ai-sdk/provider-utils';
|
3
|
-
import { z } from 'zod';
|
3
|
+
import { z } from 'zod/v4';
|
4
4
|
|
5
|
-
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-12b-it' | 'gemma-3-27b-it' |
|
5
|
+
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-12b-it' | 'gemma-3-27b-it' | (string & {});
|
6
6
|
|
7
7
|
type GoogleGenerativeAIConfig = {
|
8
8
|
provider: string;
|
@@ -27,167 +27,37 @@ declare class GoogleGenerativeAILanguageModel implements LanguageModelV2 {
|
|
27
27
|
doStream(options: Parameters<LanguageModelV2['doStream']>[0]): Promise<Awaited<ReturnType<LanguageModelV2['doStream']>>>;
|
28
28
|
}
|
29
29
|
declare const groundingMetadataSchema: z.ZodObject<{
|
30
|
-
webSearchQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString
|
31
|
-
retrievalQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString
|
30
|
+
webSearchQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
31
|
+
retrievalQueries: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
32
32
|
searchEntryPoint: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
33
33
|
renderedContent: z.ZodString;
|
34
|
-
},
|
35
|
-
renderedContent: string;
|
36
|
-
}, {
|
37
|
-
renderedContent: string;
|
38
|
-
}>>>;
|
34
|
+
}, z.core.$strip>>>;
|
39
35
|
groundingChunks: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
40
36
|
web: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
41
37
|
uri: z.ZodString;
|
42
38
|
title: z.ZodString;
|
43
|
-
},
|
44
|
-
uri: string;
|
45
|
-
title: string;
|
46
|
-
}, {
|
47
|
-
uri: string;
|
48
|
-
title: string;
|
49
|
-
}>>>;
|
39
|
+
}, z.core.$strip>>>;
|
50
40
|
retrievedContext: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
51
41
|
uri: z.ZodString;
|
52
42
|
title: z.ZodString;
|
53
|
-
},
|
54
|
-
|
55
|
-
title: string;
|
56
|
-
}, {
|
57
|
-
uri: string;
|
58
|
-
title: string;
|
59
|
-
}>>>;
|
60
|
-
}, "strip", z.ZodTypeAny, {
|
61
|
-
web?: {
|
62
|
-
uri: string;
|
63
|
-
title: string;
|
64
|
-
} | null | undefined;
|
65
|
-
retrievedContext?: {
|
66
|
-
uri: string;
|
67
|
-
title: string;
|
68
|
-
} | null | undefined;
|
69
|
-
}, {
|
70
|
-
web?: {
|
71
|
-
uri: string;
|
72
|
-
title: string;
|
73
|
-
} | null | undefined;
|
74
|
-
retrievedContext?: {
|
75
|
-
uri: string;
|
76
|
-
title: string;
|
77
|
-
} | null | undefined;
|
78
|
-
}>, "many">>>;
|
43
|
+
}, z.core.$strip>>>;
|
44
|
+
}, z.core.$strip>>>>;
|
79
45
|
groundingSupports: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodObject<{
|
80
46
|
segment: z.ZodObject<{
|
81
47
|
startIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
82
48
|
endIndex: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
83
49
|
text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
84
|
-
},
|
85
|
-
startIndex?: number | null | undefined;
|
86
|
-
endIndex?: number | null | undefined;
|
87
|
-
text?: string | null | undefined;
|
88
|
-
}, {
|
89
|
-
startIndex?: number | null | undefined;
|
90
|
-
endIndex?: number | null | undefined;
|
91
|
-
text?: string | null | undefined;
|
92
|
-
}>;
|
50
|
+
}, z.core.$strip>;
|
93
51
|
segment_text: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
94
|
-
groundingChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber
|
95
|
-
supportChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber
|
96
|
-
confidenceScores: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber
|
97
|
-
confidenceScore: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber
|
98
|
-
},
|
99
|
-
|
100
|
-
startIndex?: number | null | undefined;
|
101
|
-
endIndex?: number | null | undefined;
|
102
|
-
text?: string | null | undefined;
|
103
|
-
};
|
104
|
-
segment_text?: string | null | undefined;
|
105
|
-
groundingChunkIndices?: number[] | null | undefined;
|
106
|
-
supportChunkIndices?: number[] | null | undefined;
|
107
|
-
confidenceScores?: number[] | null | undefined;
|
108
|
-
confidenceScore?: number[] | null | undefined;
|
109
|
-
}, {
|
110
|
-
segment: {
|
111
|
-
startIndex?: number | null | undefined;
|
112
|
-
endIndex?: number | null | undefined;
|
113
|
-
text?: string | null | undefined;
|
114
|
-
};
|
115
|
-
segment_text?: string | null | undefined;
|
116
|
-
groundingChunkIndices?: number[] | null | undefined;
|
117
|
-
supportChunkIndices?: number[] | null | undefined;
|
118
|
-
confidenceScores?: number[] | null | undefined;
|
119
|
-
confidenceScore?: number[] | null | undefined;
|
120
|
-
}>, "many">>>;
|
121
|
-
retrievalMetadata: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodObject<{
|
52
|
+
groundingChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
53
|
+
supportChunkIndices: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
54
|
+
confidenceScores: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
55
|
+
confidenceScore: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber>>>;
|
56
|
+
}, z.core.$strip>>>>;
|
57
|
+
retrievalMetadata: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodObject<{
|
122
58
|
webDynamicRetrievalScore: z.ZodNumber;
|
123
|
-
},
|
124
|
-
|
125
|
-
}, {
|
126
|
-
webDynamicRetrievalScore: number;
|
127
|
-
}>, z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>]>>>;
|
128
|
-
}, "strip", z.ZodTypeAny, {
|
129
|
-
webSearchQueries?: string[] | null | undefined;
|
130
|
-
retrievalQueries?: string[] | null | undefined;
|
131
|
-
searchEntryPoint?: {
|
132
|
-
renderedContent: string;
|
133
|
-
} | null | undefined;
|
134
|
-
groundingChunks?: {
|
135
|
-
web?: {
|
136
|
-
uri: string;
|
137
|
-
title: string;
|
138
|
-
} | null | undefined;
|
139
|
-
retrievedContext?: {
|
140
|
-
uri: string;
|
141
|
-
title: string;
|
142
|
-
} | null | undefined;
|
143
|
-
}[] | null | undefined;
|
144
|
-
groundingSupports?: {
|
145
|
-
segment: {
|
146
|
-
startIndex?: number | null | undefined;
|
147
|
-
endIndex?: number | null | undefined;
|
148
|
-
text?: string | null | undefined;
|
149
|
-
};
|
150
|
-
segment_text?: string | null | undefined;
|
151
|
-
groundingChunkIndices?: number[] | null | undefined;
|
152
|
-
supportChunkIndices?: number[] | null | undefined;
|
153
|
-
confidenceScores?: number[] | null | undefined;
|
154
|
-
confidenceScore?: number[] | null | undefined;
|
155
|
-
}[] | null | undefined;
|
156
|
-
retrievalMetadata?: {
|
157
|
-
webDynamicRetrievalScore: number;
|
158
|
-
} | {} | null | undefined;
|
159
|
-
}, {
|
160
|
-
webSearchQueries?: string[] | null | undefined;
|
161
|
-
retrievalQueries?: string[] | null | undefined;
|
162
|
-
searchEntryPoint?: {
|
163
|
-
renderedContent: string;
|
164
|
-
} | null | undefined;
|
165
|
-
groundingChunks?: {
|
166
|
-
web?: {
|
167
|
-
uri: string;
|
168
|
-
title: string;
|
169
|
-
} | null | undefined;
|
170
|
-
retrievedContext?: {
|
171
|
-
uri: string;
|
172
|
-
title: string;
|
173
|
-
} | null | undefined;
|
174
|
-
}[] | null | undefined;
|
175
|
-
groundingSupports?: {
|
176
|
-
segment: {
|
177
|
-
startIndex?: number | null | undefined;
|
178
|
-
endIndex?: number | null | undefined;
|
179
|
-
text?: string | null | undefined;
|
180
|
-
};
|
181
|
-
segment_text?: string | null | undefined;
|
182
|
-
groundingChunkIndices?: number[] | null | undefined;
|
183
|
-
supportChunkIndices?: number[] | null | undefined;
|
184
|
-
confidenceScores?: number[] | null | undefined;
|
185
|
-
confidenceScore?: number[] | null | undefined;
|
186
|
-
}[] | null | undefined;
|
187
|
-
retrievalMetadata?: {
|
188
|
-
webDynamicRetrievalScore: number;
|
189
|
-
} | {} | null | undefined;
|
190
|
-
}>;
|
59
|
+
}, z.core.$strip>, z.ZodObject<{}, z.core.$strip>]>>>;
|
60
|
+
}, z.core.$strip>;
|
191
61
|
declare const safetyRatingSchema: z.ZodObject<{
|
192
62
|
category: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
193
63
|
probability: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
@@ -195,20 +65,6 @@ declare const safetyRatingSchema: z.ZodObject<{
|
|
195
65
|
severity: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
196
66
|
severityScore: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
197
67
|
blocked: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
198
|
-
},
|
199
|
-
category?: string | null | undefined;
|
200
|
-
probability?: string | null | undefined;
|
201
|
-
probabilityScore?: number | null | undefined;
|
202
|
-
severity?: string | null | undefined;
|
203
|
-
severityScore?: number | null | undefined;
|
204
|
-
blocked?: boolean | null | undefined;
|
205
|
-
}, {
|
206
|
-
category?: string | null | undefined;
|
207
|
-
probability?: string | null | undefined;
|
208
|
-
probabilityScore?: number | null | undefined;
|
209
|
-
severity?: string | null | undefined;
|
210
|
-
severityScore?: number | null | undefined;
|
211
|
-
blocked?: boolean | null | undefined;
|
212
|
-
}>;
|
68
|
+
}, z.core.$strip>;
|
213
69
|
|
214
70
|
export { GoogleGenerativeAILanguageModel, groundingMetadataSchema, safetyRatingSchema };
|
package/dist/internal/index.js
CHANGED
@@ -28,7 +28,7 @@ module.exports = __toCommonJS(internal_exports);
|
|
28
28
|
|
29
29
|
// src/google-generative-ai-language-model.ts
|
30
30
|
var import_provider_utils3 = require("@ai-sdk/provider-utils");
|
31
|
-
var
|
31
|
+
var import_v43 = require("zod/v4");
|
32
32
|
|
33
33
|
// src/convert-json-schema-to-openapi-schema.ts
|
34
34
|
function convertJSONSchemaToOpenAPISchema(jsonSchema) {
|
@@ -247,12 +247,12 @@ function getModelPath(modelId) {
|
|
247
247
|
|
248
248
|
// src/google-error.ts
|
249
249
|
var import_provider_utils2 = require("@ai-sdk/provider-utils");
|
250
|
-
var
|
251
|
-
var googleErrorDataSchema =
|
252
|
-
error:
|
253
|
-
code:
|
254
|
-
message:
|
255
|
-
status:
|
250
|
+
var import_v4 = require("zod/v4");
|
251
|
+
var googleErrorDataSchema = import_v4.z.object({
|
252
|
+
error: import_v4.z.object({
|
253
|
+
code: import_v4.z.number().nullable(),
|
254
|
+
message: import_v4.z.string(),
|
255
|
+
status: import_v4.z.string()
|
256
256
|
})
|
257
257
|
});
|
258
258
|
var googleFailedResponseHandler = (0, import_provider_utils2.createJsonErrorResponseHandler)({
|
@@ -261,30 +261,30 @@ var googleFailedResponseHandler = (0, import_provider_utils2.createJsonErrorResp
|
|
261
261
|
});
|
262
262
|
|
263
263
|
// src/google-generative-ai-options.ts
|
264
|
-
var
|
265
|
-
var dynamicRetrievalConfig =
|
264
|
+
var import_v42 = require("zod/v4");
|
265
|
+
var dynamicRetrievalConfig = import_v42.z.object({
|
266
266
|
/**
|
267
267
|
* The mode of the predictor to be used in dynamic retrieval.
|
268
268
|
*/
|
269
|
-
mode:
|
269
|
+
mode: import_v42.z.enum(["MODE_UNSPECIFIED", "MODE_DYNAMIC"]).optional(),
|
270
270
|
/**
|
271
271
|
* The threshold to be used in dynamic retrieval. If not set, a system default
|
272
272
|
* value is used.
|
273
273
|
*/
|
274
|
-
dynamicThreshold:
|
274
|
+
dynamicThreshold: import_v42.z.number().optional()
|
275
275
|
});
|
276
|
-
var googleGenerativeAIProviderOptions =
|
277
|
-
responseModalities:
|
278
|
-
thinkingConfig:
|
279
|
-
thinkingBudget:
|
280
|
-
includeThoughts:
|
276
|
+
var googleGenerativeAIProviderOptions = import_v42.z.object({
|
277
|
+
responseModalities: import_v42.z.array(import_v42.z.enum(["TEXT", "IMAGE"])).optional(),
|
278
|
+
thinkingConfig: import_v42.z.object({
|
279
|
+
thinkingBudget: import_v42.z.number().optional(),
|
280
|
+
includeThoughts: import_v42.z.boolean().optional()
|
281
281
|
}).optional(),
|
282
282
|
/**
|
283
283
|
Optional.
|
284
284
|
The name of the cached content used as context to serve the prediction.
|
285
285
|
Format: cachedContents/{cachedContent}
|
286
286
|
*/
|
287
|
-
cachedContent:
|
287
|
+
cachedContent: import_v42.z.string().optional(),
|
288
288
|
/**
|
289
289
|
* Optional. Enable structured output. Default is true.
|
290
290
|
*
|
@@ -293,13 +293,13 @@ var googleGenerativeAIProviderOptions = import_zod2.z.object({
|
|
293
293
|
* Google Generative AI uses. You can use this to disable
|
294
294
|
* structured outputs if you need to.
|
295
295
|
*/
|
296
|
-
structuredOutputs:
|
296
|
+
structuredOutputs: import_v42.z.boolean().optional(),
|
297
297
|
/**
|
298
298
|
Optional. A list of unique safety settings for blocking unsafe content.
|
299
299
|
*/
|
300
|
-
safetySettings:
|
301
|
-
|
302
|
-
category:
|
300
|
+
safetySettings: import_v42.z.array(
|
301
|
+
import_v42.z.object({
|
302
|
+
category: import_v42.z.enum([
|
303
303
|
"HARM_CATEGORY_UNSPECIFIED",
|
304
304
|
"HARM_CATEGORY_HATE_SPEECH",
|
305
305
|
"HARM_CATEGORY_DANGEROUS_CONTENT",
|
@@ -307,7 +307,7 @@ var googleGenerativeAIProviderOptions = import_zod2.z.object({
|
|
307
307
|
"HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
308
308
|
"HARM_CATEGORY_CIVIC_INTEGRITY"
|
309
309
|
]),
|
310
|
-
threshold:
|
310
|
+
threshold: import_v42.z.enum([
|
311
311
|
"HARM_BLOCK_THRESHOLD_UNSPECIFIED",
|
312
312
|
"BLOCK_LOW_AND_ABOVE",
|
313
313
|
"BLOCK_MEDIUM_AND_ABOVE",
|
@@ -317,7 +317,7 @@ var googleGenerativeAIProviderOptions = import_zod2.z.object({
|
|
317
317
|
])
|
318
318
|
})
|
319
319
|
).optional(),
|
320
|
-
threshold:
|
320
|
+
threshold: import_v42.z.enum([
|
321
321
|
"HARM_BLOCK_THRESHOLD_UNSPECIFIED",
|
322
322
|
"BLOCK_LOW_AND_ABOVE",
|
323
323
|
"BLOCK_MEDIUM_AND_ABOVE",
|
@@ -330,13 +330,13 @@ var googleGenerativeAIProviderOptions = import_zod2.z.object({
|
|
330
330
|
*
|
331
331
|
* https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
|
332
332
|
*/
|
333
|
-
audioTimestamp:
|
333
|
+
audioTimestamp: import_v42.z.boolean().optional(),
|
334
334
|
/**
|
335
335
|
Optional. When enabled, the model will use Google search to ground the response.
|
336
336
|
|
337
337
|
@see https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/overview
|
338
338
|
*/
|
339
|
-
useSearchGrounding:
|
339
|
+
useSearchGrounding: import_v42.z.boolean().optional(),
|
340
340
|
/**
|
341
341
|
Optional. Specifies the dynamic retrieval configuration.
|
342
342
|
|
@@ -866,91 +866,91 @@ function extractSources({
|
|
866
866
|
title: chunk.web.title
|
867
867
|
}));
|
868
868
|
}
|
869
|
-
var contentSchema =
|
870
|
-
parts:
|
871
|
-
|
869
|
+
var contentSchema = import_v43.z.object({
|
870
|
+
parts: import_v43.z.array(
|
871
|
+
import_v43.z.union([
|
872
872
|
// note: order matters since text can be fully empty
|
873
|
-
|
874
|
-
functionCall:
|
875
|
-
name:
|
876
|
-
args:
|
873
|
+
import_v43.z.object({
|
874
|
+
functionCall: import_v43.z.object({
|
875
|
+
name: import_v43.z.string(),
|
876
|
+
args: import_v43.z.unknown()
|
877
877
|
})
|
878
878
|
}),
|
879
|
-
|
880
|
-
inlineData:
|
881
|
-
mimeType:
|
882
|
-
data:
|
879
|
+
import_v43.z.object({
|
880
|
+
inlineData: import_v43.z.object({
|
881
|
+
mimeType: import_v43.z.string(),
|
882
|
+
data: import_v43.z.string()
|
883
883
|
})
|
884
884
|
}),
|
885
|
-
|
886
|
-
text:
|
887
|
-
thought:
|
885
|
+
import_v43.z.object({
|
886
|
+
text: import_v43.z.string().nullish(),
|
887
|
+
thought: import_v43.z.boolean().nullish()
|
888
888
|
})
|
889
889
|
])
|
890
890
|
).nullish()
|
891
891
|
});
|
892
|
-
var groundingChunkSchema =
|
893
|
-
web:
|
894
|
-
retrievedContext:
|
892
|
+
var groundingChunkSchema = import_v43.z.object({
|
893
|
+
web: import_v43.z.object({ uri: import_v43.z.string(), title: import_v43.z.string() }).nullish(),
|
894
|
+
retrievedContext: import_v43.z.object({ uri: import_v43.z.string(), title: import_v43.z.string() }).nullish()
|
895
895
|
});
|
896
|
-
var groundingMetadataSchema =
|
897
|
-
webSearchQueries:
|
898
|
-
retrievalQueries:
|
899
|
-
searchEntryPoint:
|
900
|
-
groundingChunks:
|
901
|
-
groundingSupports:
|
902
|
-
|
903
|
-
segment:
|
904
|
-
startIndex:
|
905
|
-
endIndex:
|
906
|
-
text:
|
896
|
+
var groundingMetadataSchema = import_v43.z.object({
|
897
|
+
webSearchQueries: import_v43.z.array(import_v43.z.string()).nullish(),
|
898
|
+
retrievalQueries: import_v43.z.array(import_v43.z.string()).nullish(),
|
899
|
+
searchEntryPoint: import_v43.z.object({ renderedContent: import_v43.z.string() }).nullish(),
|
900
|
+
groundingChunks: import_v43.z.array(groundingChunkSchema).nullish(),
|
901
|
+
groundingSupports: import_v43.z.array(
|
902
|
+
import_v43.z.object({
|
903
|
+
segment: import_v43.z.object({
|
904
|
+
startIndex: import_v43.z.number().nullish(),
|
905
|
+
endIndex: import_v43.z.number().nullish(),
|
906
|
+
text: import_v43.z.string().nullish()
|
907
907
|
}),
|
908
|
-
segment_text:
|
909
|
-
groundingChunkIndices:
|
910
|
-
supportChunkIndices:
|
911
|
-
confidenceScores:
|
912
|
-
confidenceScore:
|
908
|
+
segment_text: import_v43.z.string().nullish(),
|
909
|
+
groundingChunkIndices: import_v43.z.array(import_v43.z.number()).nullish(),
|
910
|
+
supportChunkIndices: import_v43.z.array(import_v43.z.number()).nullish(),
|
911
|
+
confidenceScores: import_v43.z.array(import_v43.z.number()).nullish(),
|
912
|
+
confidenceScore: import_v43.z.array(import_v43.z.number()).nullish()
|
913
913
|
})
|
914
914
|
).nullish(),
|
915
|
-
retrievalMetadata:
|
916
|
-
|
917
|
-
webDynamicRetrievalScore:
|
915
|
+
retrievalMetadata: import_v43.z.union([
|
916
|
+
import_v43.z.object({
|
917
|
+
webDynamicRetrievalScore: import_v43.z.number()
|
918
918
|
}),
|
919
|
-
|
919
|
+
import_v43.z.object({})
|
920
920
|
]).nullish()
|
921
921
|
});
|
922
|
-
var safetyRatingSchema =
|
923
|
-
category:
|
924
|
-
probability:
|
925
|
-
probabilityScore:
|
926
|
-
severity:
|
927
|
-
severityScore:
|
928
|
-
blocked:
|
922
|
+
var safetyRatingSchema = import_v43.z.object({
|
923
|
+
category: import_v43.z.string().nullish(),
|
924
|
+
probability: import_v43.z.string().nullish(),
|
925
|
+
probabilityScore: import_v43.z.number().nullish(),
|
926
|
+
severity: import_v43.z.string().nullish(),
|
927
|
+
severityScore: import_v43.z.number().nullish(),
|
928
|
+
blocked: import_v43.z.boolean().nullish()
|
929
929
|
});
|
930
|
-
var usageSchema =
|
931
|
-
cachedContentTokenCount:
|
932
|
-
thoughtsTokenCount:
|
933
|
-
promptTokenCount:
|
934
|
-
candidatesTokenCount:
|
935
|
-
totalTokenCount:
|
930
|
+
var usageSchema = import_v43.z.object({
|
931
|
+
cachedContentTokenCount: import_v43.z.number().nullish(),
|
932
|
+
thoughtsTokenCount: import_v43.z.number().nullish(),
|
933
|
+
promptTokenCount: import_v43.z.number().nullish(),
|
934
|
+
candidatesTokenCount: import_v43.z.number().nullish(),
|
935
|
+
totalTokenCount: import_v43.z.number().nullish()
|
936
936
|
});
|
937
|
-
var responseSchema =
|
938
|
-
candidates:
|
939
|
-
|
940
|
-
content: contentSchema.nullish().or(
|
941
|
-
finishReason:
|
942
|
-
safetyRatings:
|
937
|
+
var responseSchema = import_v43.z.object({
|
938
|
+
candidates: import_v43.z.array(
|
939
|
+
import_v43.z.object({
|
940
|
+
content: contentSchema.nullish().or(import_v43.z.object({}).strict()),
|
941
|
+
finishReason: import_v43.z.string().nullish(),
|
942
|
+
safetyRatings: import_v43.z.array(safetyRatingSchema).nullish(),
|
943
943
|
groundingMetadata: groundingMetadataSchema.nullish()
|
944
944
|
})
|
945
945
|
),
|
946
946
|
usageMetadata: usageSchema.nullish()
|
947
947
|
});
|
948
|
-
var chunkSchema =
|
949
|
-
candidates:
|
950
|
-
|
948
|
+
var chunkSchema = import_v43.z.object({
|
949
|
+
candidates: import_v43.z.array(
|
950
|
+
import_v43.z.object({
|
951
951
|
content: contentSchema.nullish(),
|
952
|
-
finishReason:
|
953
|
-
safetyRatings:
|
952
|
+
finishReason: import_v43.z.string().nullish(),
|
953
|
+
safetyRatings: import_v43.z.array(safetyRatingSchema).nullish(),
|
954
954
|
groundingMetadata: groundingMetadataSchema.nullish()
|
955
955
|
})
|
956
956
|
).nullish(),
|