@ai-sdk/google 3.0.136 → 3.0.138
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 +15 -0
- package/dist/index.d.mts +8 -11
- package/dist/index.d.ts +8 -11
- package/dist/index.js +248 -230
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +158 -135
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +19 -14
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +19 -14
- package/dist/internal/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/convert-json-schema-to-openapi-schema.ts +11 -1
- package/src/google-generative-ai-embedding-options.ts +15 -14
- package/src/google-generative-ai-image-model.ts +1 -1
- package/src/google-generative-ai-language-model.ts +43 -40
- package/src/google-generative-ai-video-model.ts +30 -26
- package/src/tool/file-search.ts +33 -30
- package/src/tool/google-search.ts +19 -18
- package/src/transcription/google-transcription-model-options.ts +40 -31
- package/src/transcription/google-transcription-model.ts +37 -30
package/dist/index.mjs
CHANGED
|
@@ -3,6 +3,8 @@ import {
|
|
|
3
3
|
InvalidArgumentError
|
|
4
4
|
} from "@ai-sdk/provider";
|
|
5
5
|
import {
|
|
6
|
+
lazySchema as lazySchema3,
|
|
7
|
+
zodSchema as zodSchema3,
|
|
6
8
|
combineHeaders,
|
|
7
9
|
convertToBase64,
|
|
8
10
|
createJsonResponseHandler,
|
|
@@ -37,37 +39,45 @@ var googleFailedResponseHandler = createJsonErrorResponseHandler({
|
|
|
37
39
|
});
|
|
38
40
|
|
|
39
41
|
// src/transcription/google-transcription-model-options.ts
|
|
42
|
+
import {
|
|
43
|
+
lazySchema as lazySchema2,
|
|
44
|
+
zodSchema as zodSchema2
|
|
45
|
+
} from "@ai-sdk/provider-utils";
|
|
40
46
|
import { z as z2 } from "zod/v4";
|
|
41
|
-
var googleTranscriptionModelOptions =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
47
|
+
var googleTranscriptionModelOptions = lazySchema2(
|
|
48
|
+
() => zodSchema2(
|
|
49
|
+
z2.object({
|
|
50
|
+
/**
|
|
51
|
+
* BCP-47 language codes providing hints about the languages present in the
|
|
52
|
+
* audio. If omitted or empty, defaults to automatic language detection.
|
|
53
|
+
*/
|
|
54
|
+
languageCodes: z2.array(z2.string()).optional(),
|
|
55
|
+
/**
|
|
56
|
+
* Custom vocabulary phrases, which bias the speech recognition model
|
|
57
|
+
* toward recognizing specific terms.
|
|
58
|
+
*/
|
|
59
|
+
customVocabulary: z2.array(z2.string()).optional(),
|
|
60
|
+
/**
|
|
61
|
+
* Enables word-level timestamp generation.
|
|
62
|
+
*/
|
|
63
|
+
wordTimestamp: z2.boolean().optional(),
|
|
64
|
+
/**
|
|
65
|
+
* Enables speaker diarization.
|
|
66
|
+
*/
|
|
67
|
+
diarization: z2.boolean().optional(),
|
|
68
|
+
/**
|
|
69
|
+
* Transcription output formatting mode.
|
|
70
|
+
*
|
|
71
|
+
* - `VERBATIM` (default): exact literal transcript preserving filler
|
|
72
|
+
* words, repetitions, and false starts.
|
|
73
|
+
* - `SMART`: cleans up and structures the transcript in real time —
|
|
74
|
+
* disfluency removal, inline self-corrections, structured formatting
|
|
75
|
+
* (lists, numbers, dates, paragraph breaks), and grammar/casing polish.
|
|
76
|
+
*/
|
|
77
|
+
mode: z2.enum(["SMART", "VERBATIM"]).optional()
|
|
78
|
+
})
|
|
79
|
+
)
|
|
80
|
+
);
|
|
71
81
|
|
|
72
82
|
// src/transcription/google-transcription-model.ts
|
|
73
83
|
function isLiveTranscriptionModelId(modelId) {
|
|
@@ -191,29 +201,33 @@ function parseOffsetSeconds(offset) {
|
|
|
191
201
|
const parsed = Number.parseFloat(offset);
|
|
192
202
|
return Number.isFinite(parsed) ? parsed : void 0;
|
|
193
203
|
}
|
|
194
|
-
var googleInteractionsWordAnnotationSchema = z3.object({
|
|
204
|
+
var googleInteractionsWordAnnotationSchema = () => z3.object({
|
|
195
205
|
type: z3.string().nullish(),
|
|
196
206
|
text: z3.string().nullish(),
|
|
197
207
|
speaker: z3.string().nullish(),
|
|
198
208
|
start_offset: z3.string().nullish(),
|
|
199
209
|
end_offset: z3.string().nullish()
|
|
200
210
|
});
|
|
201
|
-
var googleInteractionsTranscriptionResponseSchema =
|
|
202
|
-
|
|
203
|
-
steps: z3.array(
|
|
211
|
+
var googleInteractionsTranscriptionResponseSchema = lazySchema3(
|
|
212
|
+
() => zodSchema3(
|
|
204
213
|
z3.object({
|
|
205
|
-
|
|
206
|
-
|
|
214
|
+
status: z3.string().nullish(),
|
|
215
|
+
steps: z3.array(
|
|
207
216
|
z3.object({
|
|
208
217
|
type: z3.string().nullish(),
|
|
209
|
-
|
|
210
|
-
|
|
218
|
+
content: z3.array(
|
|
219
|
+
z3.object({
|
|
220
|
+
type: z3.string().nullish(),
|
|
221
|
+
text: z3.string().nullish(),
|
|
222
|
+
annotations: z3.array(googleInteractionsWordAnnotationSchema()).nullish()
|
|
223
|
+
})
|
|
224
|
+
).nullish()
|
|
211
225
|
})
|
|
212
|
-
).nullish()
|
|
226
|
+
).nullish(),
|
|
227
|
+
usage: z3.record(z3.string(), z3.unknown()).nullish()
|
|
213
228
|
})
|
|
214
|
-
)
|
|
215
|
-
|
|
216
|
-
});
|
|
229
|
+
)
|
|
230
|
+
);
|
|
217
231
|
|
|
218
232
|
// src/google-provider.ts
|
|
219
233
|
import {
|
|
@@ -224,7 +238,7 @@ import {
|
|
|
224
238
|
} from "@ai-sdk/provider-utils";
|
|
225
239
|
|
|
226
240
|
// src/version.ts
|
|
227
|
-
var VERSION = true ? "3.0.
|
|
241
|
+
var VERSION = true ? "3.0.138" : "0.0.0-test";
|
|
228
242
|
|
|
229
243
|
// src/google-generative-ai-embedding-model.ts
|
|
230
244
|
import {
|
|
@@ -234,21 +248,21 @@ import {
|
|
|
234
248
|
combineHeaders as combineHeaders2,
|
|
235
249
|
createJsonResponseHandler as createJsonResponseHandler2,
|
|
236
250
|
EXPERIMENTAL_EMBEDDING_MODEL_PROVIDER_OPTIONS_TRANSFORMER,
|
|
237
|
-
lazySchema as
|
|
251
|
+
lazySchema as lazySchema5,
|
|
238
252
|
parseProviderOptions as parseProviderOptions2,
|
|
239
253
|
postJsonToApi as postJsonToApi2,
|
|
240
254
|
resolve as resolve2,
|
|
241
|
-
zodSchema as
|
|
255
|
+
zodSchema as zodSchema5
|
|
242
256
|
} from "@ai-sdk/provider-utils";
|
|
243
257
|
import { z as z5 } from "zod/v4";
|
|
244
258
|
|
|
245
259
|
// src/google-generative-ai-embedding-options.ts
|
|
246
260
|
import {
|
|
247
|
-
lazySchema as
|
|
248
|
-
zodSchema as
|
|
261
|
+
lazySchema as lazySchema4,
|
|
262
|
+
zodSchema as zodSchema4
|
|
249
263
|
} from "@ai-sdk/provider-utils";
|
|
250
264
|
import { z as z4 } from "zod/v4";
|
|
251
|
-
var googleEmbeddingContentPartSchema = z4.union([
|
|
265
|
+
var googleEmbeddingContentPartSchema = () => z4.union([
|
|
252
266
|
z4.object({ text: z4.string() }),
|
|
253
267
|
z4.object({
|
|
254
268
|
inlineData: z4.object({
|
|
@@ -263,8 +277,8 @@ var googleEmbeddingContentPartSchema = z4.union([
|
|
|
263
277
|
})
|
|
264
278
|
})
|
|
265
279
|
]);
|
|
266
|
-
var googleEmbeddingModelOptions =
|
|
267
|
-
() =>
|
|
280
|
+
var googleEmbeddingModelOptions = lazySchema4(
|
|
281
|
+
() => zodSchema4(
|
|
268
282
|
z4.object({
|
|
269
283
|
/**
|
|
270
284
|
* Optional. Optional reduced dimension for the output embedding.
|
|
@@ -302,7 +316,7 @@ var googleEmbeddingModelOptions = lazySchema2(
|
|
|
302
316
|
* The array length must match the number of values being embedded. In
|
|
303
317
|
* the case of a single embedding, the array length must be 1.
|
|
304
318
|
*/
|
|
305
|
-
content: z4.array(z4.array(googleEmbeddingContentPartSchema).min(1).nullable()).optional()
|
|
319
|
+
content: z4.array(z4.array(googleEmbeddingContentPartSchema()).min(1).nullable()).optional()
|
|
306
320
|
})
|
|
307
321
|
)
|
|
308
322
|
);
|
|
@@ -434,15 +448,15 @@ var GoogleGenerativeAIEmbeddingModel = class {
|
|
|
434
448
|
};
|
|
435
449
|
}
|
|
436
450
|
};
|
|
437
|
-
var googleGenerativeAITextEmbeddingResponseSchema =
|
|
438
|
-
() =>
|
|
451
|
+
var googleGenerativeAITextEmbeddingResponseSchema = lazySchema5(
|
|
452
|
+
() => zodSchema5(
|
|
439
453
|
z5.object({
|
|
440
454
|
embeddings: z5.array(z5.object({ values: z5.array(z5.number()) }))
|
|
441
455
|
})
|
|
442
456
|
)
|
|
443
457
|
);
|
|
444
|
-
var googleGenerativeAISingleEmbeddingResponseSchema =
|
|
445
|
-
() =>
|
|
458
|
+
var googleGenerativeAISingleEmbeddingResponseSchema = lazySchema5(
|
|
459
|
+
() => zodSchema5(
|
|
446
460
|
z5.object({
|
|
447
461
|
embedding: z5.object({ values: z5.array(z5.number()) })
|
|
448
462
|
})
|
|
@@ -465,11 +479,11 @@ import {
|
|
|
465
479
|
createEventSourceResponseHandler,
|
|
466
480
|
createJsonResponseHandler as createJsonResponseHandler3,
|
|
467
481
|
generateId,
|
|
468
|
-
lazySchema as
|
|
482
|
+
lazySchema as lazySchema7,
|
|
469
483
|
parseProviderOptions as parseProviderOptions3,
|
|
470
484
|
postJsonToApi as postJsonToApi3,
|
|
471
485
|
resolve as resolve3,
|
|
472
|
-
zodSchema as
|
|
486
|
+
zodSchema as zodSchema7
|
|
473
487
|
} from "@ai-sdk/provider-utils";
|
|
474
488
|
import { z as z7 } from "zod/v4";
|
|
475
489
|
|
|
@@ -680,6 +694,11 @@ function convertJSONSchemaDefinition(jsonSchema, isRoot, referenceContext) {
|
|
|
680
694
|
const nonNullTypes = type.filter((t) => t !== "null");
|
|
681
695
|
if (nonNullTypes.length === 0) {
|
|
682
696
|
result.type = "null";
|
|
697
|
+
} else if (nonNullTypes.length === 1) {
|
|
698
|
+
result.type = nonNullTypes[0];
|
|
699
|
+
if (hasNull) {
|
|
700
|
+
result.nullable = true;
|
|
701
|
+
}
|
|
683
702
|
} else {
|
|
684
703
|
result.anyOf = nonNullTypes.map((t) => ({ type: t }));
|
|
685
704
|
if (hasNull) {
|
|
@@ -1354,12 +1373,12 @@ function getModelPath(modelId) {
|
|
|
1354
1373
|
|
|
1355
1374
|
// src/google-generative-ai-options.ts
|
|
1356
1375
|
import {
|
|
1357
|
-
lazySchema as
|
|
1358
|
-
zodSchema as
|
|
1376
|
+
lazySchema as lazySchema6,
|
|
1377
|
+
zodSchema as zodSchema6
|
|
1359
1378
|
} from "@ai-sdk/provider-utils";
|
|
1360
1379
|
import { z as z6 } from "zod/v4";
|
|
1361
|
-
var googleLanguageModelOptions =
|
|
1362
|
-
() =>
|
|
1380
|
+
var googleLanguageModelOptions = lazySchema6(
|
|
1381
|
+
() => zodSchema6(
|
|
1363
1382
|
z6.object({
|
|
1364
1383
|
responseModalities: z6.array(z6.enum(["TEXT", "IMAGE"])).optional(),
|
|
1365
1384
|
thinkingConfig: z6.object({
|
|
@@ -3193,7 +3212,7 @@ var getGroundingMetadataSchema = () => z7.object({
|
|
|
3193
3212
|
z7.object({})
|
|
3194
3213
|
]).nullish()
|
|
3195
3214
|
});
|
|
3196
|
-
var partialArgSchema = z7.object({
|
|
3215
|
+
var partialArgSchema = () => z7.object({
|
|
3197
3216
|
jsonPath: z7.string(),
|
|
3198
3217
|
stringValue: z7.string().nullish(),
|
|
3199
3218
|
numberValue: z7.number().nullish(),
|
|
@@ -3210,7 +3229,7 @@ var getContentSchema = () => z7.object({
|
|
|
3210
3229
|
id: z7.string().nullish(),
|
|
3211
3230
|
name: z7.string().nullish(),
|
|
3212
3231
|
args: z7.unknown().nullish(),
|
|
3213
|
-
partialArgs: z7.array(partialArgSchema).nullish(),
|
|
3232
|
+
partialArgs: z7.array(partialArgSchema()).nullish(),
|
|
3214
3233
|
willContinue: z7.boolean().nullish()
|
|
3215
3234
|
}),
|
|
3216
3235
|
thoughtSignature: z7.string().nullish()
|
|
@@ -3263,13 +3282,13 @@ var getSafetyRatingSchema = () => z7.object({
|
|
|
3263
3282
|
severityScore: z7.number().nullish(),
|
|
3264
3283
|
blocked: z7.boolean().nullish()
|
|
3265
3284
|
});
|
|
3266
|
-
var tokenDetailsSchema = z7.array(
|
|
3285
|
+
var tokenDetailsSchema = () => z7.array(
|
|
3267
3286
|
z7.object({
|
|
3268
3287
|
modality: z7.string(),
|
|
3269
3288
|
tokenCount: z7.number()
|
|
3270
3289
|
}).catchall(z7.json())
|
|
3271
3290
|
).nullish();
|
|
3272
|
-
var usageSchema = z7.object({
|
|
3291
|
+
var usageSchema = () => z7.object({
|
|
3273
3292
|
cachedContentTokenCount: z7.number().nullish(),
|
|
3274
3293
|
thoughtsTokenCount: z7.number().nullish(),
|
|
3275
3294
|
promptTokenCount: z7.number().nullish(),
|
|
@@ -3280,10 +3299,10 @@ var usageSchema = z7.object({
|
|
|
3280
3299
|
trafficType: z7.string().nullish(),
|
|
3281
3300
|
serviceTier: z7.string().nullish(),
|
|
3282
3301
|
// https://ai.google.dev/api/generate-content#Modality
|
|
3283
|
-
promptTokensDetails: tokenDetailsSchema,
|
|
3284
|
-
cacheTokensDetails: tokenDetailsSchema,
|
|
3285
|
-
candidatesTokensDetails: tokenDetailsSchema,
|
|
3286
|
-
toolUsePromptTokensDetails: tokenDetailsSchema
|
|
3302
|
+
promptTokensDetails: tokenDetailsSchema(),
|
|
3303
|
+
cacheTokensDetails: tokenDetailsSchema(),
|
|
3304
|
+
candidatesTokensDetails: tokenDetailsSchema(),
|
|
3305
|
+
toolUsePromptTokensDetails: tokenDetailsSchema()
|
|
3287
3306
|
}).catchall(z7.json());
|
|
3288
3307
|
var getUrlContextMetadataSchema = () => z7.object({
|
|
3289
3308
|
urlMetadata: z7.array(
|
|
@@ -3293,8 +3312,8 @@ var getUrlContextMetadataSchema = () => z7.object({
|
|
|
3293
3312
|
})
|
|
3294
3313
|
).nullish()
|
|
3295
3314
|
});
|
|
3296
|
-
var responseSchema =
|
|
3297
|
-
() =>
|
|
3315
|
+
var responseSchema = lazySchema7(
|
|
3316
|
+
() => zodSchema7(
|
|
3298
3317
|
z7.object({
|
|
3299
3318
|
responseId: z7.string().nullish(),
|
|
3300
3319
|
candidates: z7.array(
|
|
@@ -3308,7 +3327,7 @@ var responseSchema = lazySchema5(
|
|
|
3308
3327
|
urlContextMetadata: getUrlContextMetadataSchema().nullish()
|
|
3309
3328
|
})
|
|
3310
3329
|
).nullish(),
|
|
3311
|
-
usageMetadata: usageSchema.nullish(),
|
|
3330
|
+
usageMetadata: usageSchema().nullish(),
|
|
3312
3331
|
promptFeedback: z7.object({
|
|
3313
3332
|
blockReason: z7.string().nullish(),
|
|
3314
3333
|
safetyRatings: z7.array(getSafetyRatingSchema()).nullish()
|
|
@@ -3316,8 +3335,8 @@ var responseSchema = lazySchema5(
|
|
|
3316
3335
|
})
|
|
3317
3336
|
)
|
|
3318
3337
|
);
|
|
3319
|
-
var chunkSchema =
|
|
3320
|
-
() =>
|
|
3338
|
+
var chunkSchema = lazySchema7(
|
|
3339
|
+
() => zodSchema7(
|
|
3321
3340
|
z7.object({
|
|
3322
3341
|
responseId: z7.string().nullish(),
|
|
3323
3342
|
candidates: z7.array(
|
|
@@ -3331,7 +3350,7 @@ var chunkSchema = lazySchema5(
|
|
|
3331
3350
|
urlContextMetadata: getUrlContextMetadataSchema().nullish()
|
|
3332
3351
|
})
|
|
3333
3352
|
).nullish(),
|
|
3334
|
-
usageMetadata: usageSchema.nullish(),
|
|
3353
|
+
usageMetadata: usageSchema().nullish(),
|
|
3335
3354
|
promptFeedback: z7.object({
|
|
3336
3355
|
blockReason: z7.string().nullish(),
|
|
3337
3356
|
safetyRatings: z7.array(getSafetyRatingSchema()).nullish()
|
|
@@ -3361,23 +3380,23 @@ var codeExecution = createProviderToolFactoryWithOutputSchema({
|
|
|
3361
3380
|
// src/tool/enterprise-web-search.ts
|
|
3362
3381
|
import {
|
|
3363
3382
|
createProviderToolFactory,
|
|
3364
|
-
lazySchema as
|
|
3365
|
-
zodSchema as
|
|
3383
|
+
lazySchema as lazySchema8,
|
|
3384
|
+
zodSchema as zodSchema8
|
|
3366
3385
|
} from "@ai-sdk/provider-utils";
|
|
3367
3386
|
import { z as z9 } from "zod/v4";
|
|
3368
3387
|
var enterpriseWebSearch = createProviderToolFactory({
|
|
3369
3388
|
id: "google.enterprise_web_search",
|
|
3370
|
-
inputSchema:
|
|
3389
|
+
inputSchema: lazySchema8(() => zodSchema8(z9.object({})))
|
|
3371
3390
|
});
|
|
3372
3391
|
|
|
3373
3392
|
// src/tool/file-search.ts
|
|
3374
3393
|
import {
|
|
3375
3394
|
createProviderToolFactory as createProviderToolFactory2,
|
|
3376
|
-
lazySchema as
|
|
3377
|
-
zodSchema as
|
|
3395
|
+
lazySchema as lazySchema9,
|
|
3396
|
+
zodSchema as zodSchema9
|
|
3378
3397
|
} from "@ai-sdk/provider-utils";
|
|
3379
3398
|
import { z as z10 } from "zod/v4";
|
|
3380
|
-
var fileSearchArgsBaseSchema = z10.object({
|
|
3399
|
+
var fileSearchArgsBaseSchema = () => z10.object({
|
|
3381
3400
|
/** The names of the file_search_stores to retrieve from.
|
|
3382
3401
|
* Example: `fileSearchStores/my-file-search-store-123`
|
|
3383
3402
|
*/
|
|
@@ -3393,8 +3412,8 @@ var fileSearchArgsBaseSchema = z10.object({
|
|
|
3393
3412
|
"Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression."
|
|
3394
3413
|
).optional()
|
|
3395
3414
|
}).passthrough();
|
|
3396
|
-
var fileSearchArgsSchema =
|
|
3397
|
-
() =>
|
|
3415
|
+
var fileSearchArgsSchema = lazySchema9(
|
|
3416
|
+
() => zodSchema9(fileSearchArgsBaseSchema())
|
|
3398
3417
|
);
|
|
3399
3418
|
var fileSearch = createProviderToolFactory2({
|
|
3400
3419
|
id: "google.file_search",
|
|
@@ -3404,23 +3423,23 @@ var fileSearch = createProviderToolFactory2({
|
|
|
3404
3423
|
// src/tool/google-maps.ts
|
|
3405
3424
|
import {
|
|
3406
3425
|
createProviderToolFactory as createProviderToolFactory3,
|
|
3407
|
-
lazySchema as
|
|
3408
|
-
zodSchema as
|
|
3426
|
+
lazySchema as lazySchema10,
|
|
3427
|
+
zodSchema as zodSchema10
|
|
3409
3428
|
} from "@ai-sdk/provider-utils";
|
|
3410
3429
|
import { z as z11 } from "zod/v4";
|
|
3411
3430
|
var googleMaps = createProviderToolFactory3({
|
|
3412
3431
|
id: "google.google_maps",
|
|
3413
|
-
inputSchema:
|
|
3432
|
+
inputSchema: lazySchema10(() => zodSchema10(z11.object({})))
|
|
3414
3433
|
});
|
|
3415
3434
|
|
|
3416
3435
|
// src/tool/google-search.ts
|
|
3417
3436
|
import {
|
|
3418
3437
|
createProviderToolFactory as createProviderToolFactory4,
|
|
3419
|
-
lazySchema as
|
|
3420
|
-
zodSchema as
|
|
3438
|
+
lazySchema as lazySchema11,
|
|
3439
|
+
zodSchema as zodSchema11
|
|
3421
3440
|
} from "@ai-sdk/provider-utils";
|
|
3422
3441
|
import { z as z12 } from "zod/v4";
|
|
3423
|
-
var googleSearchToolArgsBaseSchema = z12.object({
|
|
3442
|
+
var googleSearchToolArgsBaseSchema = () => z12.object({
|
|
3424
3443
|
searchTypes: z12.object({
|
|
3425
3444
|
webSearch: z12.object({}).optional(),
|
|
3426
3445
|
imageSearch: z12.object({}).optional()
|
|
@@ -3430,8 +3449,8 @@ var googleSearchToolArgsBaseSchema = z12.object({
|
|
|
3430
3449
|
endTime: z12.string()
|
|
3431
3450
|
}).optional()
|
|
3432
3451
|
}).passthrough();
|
|
3433
|
-
var googleSearchToolArgsSchema =
|
|
3434
|
-
() =>
|
|
3452
|
+
var googleSearchToolArgsSchema = lazySchema11(
|
|
3453
|
+
() => zodSchema11(googleSearchToolArgsBaseSchema())
|
|
3435
3454
|
);
|
|
3436
3455
|
var googleSearch = createProviderToolFactory4(
|
|
3437
3456
|
{
|
|
@@ -3443,13 +3462,13 @@ var googleSearch = createProviderToolFactory4(
|
|
|
3443
3462
|
// src/tool/url-context.ts
|
|
3444
3463
|
import {
|
|
3445
3464
|
createProviderToolFactory as createProviderToolFactory5,
|
|
3446
|
-
lazySchema as
|
|
3447
|
-
zodSchema as
|
|
3465
|
+
lazySchema as lazySchema12,
|
|
3466
|
+
zodSchema as zodSchema12
|
|
3448
3467
|
} from "@ai-sdk/provider-utils";
|
|
3449
3468
|
import { z as z13 } from "zod/v4";
|
|
3450
3469
|
var urlContext = createProviderToolFactory5({
|
|
3451
3470
|
id: "google.url_context",
|
|
3452
|
-
inputSchema:
|
|
3471
|
+
inputSchema: lazySchema12(() => zodSchema12(z13.object({})))
|
|
3453
3472
|
});
|
|
3454
3473
|
|
|
3455
3474
|
// src/tool/vertex-rag-store.ts
|
|
@@ -3529,11 +3548,11 @@ import {
|
|
|
3529
3548
|
convertToBase64 as convertToBase643,
|
|
3530
3549
|
createJsonResponseHandler as createJsonResponseHandler4,
|
|
3531
3550
|
generateId as defaultGenerateId,
|
|
3532
|
-
lazySchema as
|
|
3551
|
+
lazySchema as lazySchema13,
|
|
3533
3552
|
parseProviderOptions as parseProviderOptions4,
|
|
3534
3553
|
postJsonToApi as postJsonToApi4,
|
|
3535
3554
|
resolve as resolve4,
|
|
3536
|
-
zodSchema as
|
|
3555
|
+
zodSchema as zodSchema13
|
|
3537
3556
|
} from "@ai-sdk/provider-utils";
|
|
3538
3557
|
import { z as z15 } from "zod/v4";
|
|
3539
3558
|
var GoogleGenerativeAIImageModel = class {
|
|
@@ -3789,8 +3808,8 @@ var GoogleGenerativeAIImageModel = class {
|
|
|
3789
3808
|
function isGeminiModel(modelId) {
|
|
3790
3809
|
return modelId.startsWith("gemini-");
|
|
3791
3810
|
}
|
|
3792
|
-
var googleImageResponseSchema =
|
|
3793
|
-
() =>
|
|
3811
|
+
var googleImageResponseSchema = lazySchema13(
|
|
3812
|
+
() => zodSchema13(
|
|
3794
3813
|
z15.object({
|
|
3795
3814
|
predictions: z15.array(
|
|
3796
3815
|
z15.union([
|
|
@@ -3801,8 +3820,8 @@ var googleImageResponseSchema = lazySchema11(
|
|
|
3801
3820
|
})
|
|
3802
3821
|
)
|
|
3803
3822
|
);
|
|
3804
|
-
var googleImageModelOptionsSchema =
|
|
3805
|
-
() =>
|
|
3823
|
+
var googleImageModelOptionsSchema = lazySchema13(
|
|
3824
|
+
() => zodSchema13(
|
|
3806
3825
|
z15.object({
|
|
3807
3826
|
personGeneration: z15.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
|
|
3808
3827
|
aspectRatio: z15.enum(["1:1", "3:4", "4:3", "9:16", "16:9"]).nullish(),
|
|
@@ -3815,7 +3834,7 @@ var googleImageModelOptionsSchema = lazySchema11(
|
|
|
3815
3834
|
* dedicated escape hatch for grounding image generation the same way
|
|
3816
3835
|
* `generateText` does.
|
|
3817
3836
|
*/
|
|
3818
|
-
googleSearch: googleSearchToolArgsBaseSchema.optional()
|
|
3837
|
+
googleSearch: googleSearchToolArgsBaseSchema().optional()
|
|
3819
3838
|
})
|
|
3820
3839
|
)
|
|
3821
3840
|
);
|
|
@@ -3831,11 +3850,11 @@ import {
|
|
|
3831
3850
|
delay,
|
|
3832
3851
|
getFromApi,
|
|
3833
3852
|
isSameOrigin,
|
|
3834
|
-
lazySchema as
|
|
3853
|
+
lazySchema as lazySchema14,
|
|
3835
3854
|
parseProviderOptions as parseProviderOptions5,
|
|
3836
3855
|
postJsonToApi as postJsonToApi5,
|
|
3837
3856
|
resolve as resolve5,
|
|
3838
|
-
zodSchema as
|
|
3857
|
+
zodSchema as zodSchema14
|
|
3839
3858
|
} from "@ai-sdk/provider-utils";
|
|
3840
3859
|
import { z as z16 } from "zod/v4";
|
|
3841
3860
|
function getFirstFrameImage(options) {
|
|
@@ -4102,28 +4121,32 @@ var GoogleGenerativeAIVideoModel = class {
|
|
|
4102
4121
|
};
|
|
4103
4122
|
}
|
|
4104
4123
|
};
|
|
4105
|
-
var googleOperationSchema =
|
|
4106
|
-
|
|
4107
|
-
|
|
4108
|
-
|
|
4109
|
-
|
|
4110
|
-
|
|
4111
|
-
|
|
4112
|
-
|
|
4113
|
-
|
|
4114
|
-
|
|
4115
|
-
|
|
4116
|
-
z16.object({
|
|
4117
|
-
|
|
4118
|
-
|
|
4119
|
-
|
|
4120
|
-
|
|
4121
|
-
|
|
4122
|
-
|
|
4123
|
-
|
|
4124
|
-
})
|
|
4125
|
-
|
|
4126
|
-
|
|
4124
|
+
var googleOperationSchema = lazySchema14(
|
|
4125
|
+
() => zodSchema14(
|
|
4126
|
+
z16.object({
|
|
4127
|
+
name: z16.string().nullish(),
|
|
4128
|
+
done: z16.boolean().nullish(),
|
|
4129
|
+
error: z16.object({
|
|
4130
|
+
code: z16.number().nullish(),
|
|
4131
|
+
message: z16.string(),
|
|
4132
|
+
status: z16.string().nullish()
|
|
4133
|
+
}).nullish(),
|
|
4134
|
+
response: z16.object({
|
|
4135
|
+
generateVideoResponse: z16.object({
|
|
4136
|
+
generatedSamples: z16.array(
|
|
4137
|
+
z16.object({
|
|
4138
|
+
video: z16.object({
|
|
4139
|
+
uri: z16.string().nullish()
|
|
4140
|
+
}).nullish()
|
|
4141
|
+
})
|
|
4142
|
+
).nullish()
|
|
4143
|
+
}).nullish()
|
|
4144
|
+
}).nullish()
|
|
4145
|
+
})
|
|
4146
|
+
)
|
|
4147
|
+
);
|
|
4148
|
+
var googleVideoModelOptionsSchema = lazySchema14(
|
|
4149
|
+
() => zodSchema14(
|
|
4127
4150
|
z16.object({
|
|
4128
4151
|
pollIntervalMs: z16.number().positive().nullish(),
|
|
4129
4152
|
pollTimeoutMs: z16.number().positive().nullish(),
|
|
@@ -5305,8 +5328,8 @@ ${block.text}`
|
|
|
5305
5328
|
|
|
5306
5329
|
// src/interactions/google-interactions-api.ts
|
|
5307
5330
|
import {
|
|
5308
|
-
lazySchema as
|
|
5309
|
-
zodSchema as
|
|
5331
|
+
lazySchema as lazySchema15,
|
|
5332
|
+
zodSchema as zodSchema15
|
|
5310
5333
|
} from "@ai-sdk/provider-utils";
|
|
5311
5334
|
import { z as z17 } from "zod/v4";
|
|
5312
5335
|
var tokenByModalitySchema = () => z17.object({
|
|
@@ -5470,8 +5493,8 @@ var stepSchema = () => {
|
|
|
5470
5493
|
z17.object({ type: z17.string() }).loose()
|
|
5471
5494
|
]);
|
|
5472
5495
|
};
|
|
5473
|
-
var googleInteractionsResponseSchema =
|
|
5474
|
-
() =>
|
|
5496
|
+
var googleInteractionsResponseSchema = lazySchema15(
|
|
5497
|
+
() => zodSchema15(
|
|
5475
5498
|
z17.object({
|
|
5476
5499
|
/*
|
|
5477
5500
|
* `id` is omitted from the response body when `store: false` (fully
|
|
@@ -5492,8 +5515,8 @@ var googleInteractionsResponseSchema = lazySchema13(
|
|
|
5492
5515
|
}).loose()
|
|
5493
5516
|
)
|
|
5494
5517
|
);
|
|
5495
|
-
var googleInteractionsEventSchema =
|
|
5496
|
-
() =>
|
|
5518
|
+
var googleInteractionsEventSchema = lazySchema15(
|
|
5519
|
+
() => zodSchema15(
|
|
5497
5520
|
(() => {
|
|
5498
5521
|
const status = interactionStatusSchema();
|
|
5499
5522
|
const annotation = annotationSchema();
|
|
@@ -5651,12 +5674,12 @@ var googleInteractionsEventSchema = lazySchema13(
|
|
|
5651
5674
|
|
|
5652
5675
|
// src/interactions/google-interactions-language-model-options.ts
|
|
5653
5676
|
import {
|
|
5654
|
-
lazySchema as
|
|
5655
|
-
zodSchema as
|
|
5677
|
+
lazySchema as lazySchema16,
|
|
5678
|
+
zodSchema as zodSchema16
|
|
5656
5679
|
} from "@ai-sdk/provider-utils";
|
|
5657
5680
|
import { z as z18 } from "zod/v4";
|
|
5658
|
-
var googleInteractionsLanguageModelOptions =
|
|
5659
|
-
() =>
|
|
5681
|
+
var googleInteractionsLanguageModelOptions = lazySchema16(
|
|
5682
|
+
() => zodSchema16(
|
|
5660
5683
|
z18.object({
|
|
5661
5684
|
previousInteractionId: z18.string().nullish(),
|
|
5662
5685
|
store: z18.boolean().nullish(),
|