@ai-sdk/google 3.0.139 → 3.0.140
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 +8 -0
- package/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +536 -516
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +536 -516
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +510 -490
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +510 -490
- package/dist/internal/index.mjs.map +1 -1
- package/docs/15-google-generative-ai.mdx +18 -2
- package/package.json +2 -2
- package/src/convert-to-google-generative-ai-messages.ts +17 -5
- package/src/google-generative-ai-prompt.ts +21 -2
- package/src/index.ts +4 -1
package/dist/index.mjs
CHANGED
|
@@ -238,7 +238,7 @@ import {
|
|
|
238
238
|
} from "@ai-sdk/provider-utils";
|
|
239
239
|
|
|
240
240
|
// src/version.ts
|
|
241
|
-
var VERSION = true ? "3.0.
|
|
241
|
+
var VERSION = true ? "3.0.140" : "0.0.0-test";
|
|
242
242
|
|
|
243
243
|
// src/google-generative-ai-embedding-model.ts
|
|
244
244
|
import {
|
|
@@ -485,7 +485,7 @@ import {
|
|
|
485
485
|
resolve as resolve3,
|
|
486
486
|
zodSchema as zodSchema7
|
|
487
487
|
} from "@ai-sdk/provider-utils";
|
|
488
|
-
import { z as
|
|
488
|
+
import { z as z8 } from "zod/v4";
|
|
489
489
|
|
|
490
490
|
// src/continue-google-stream.ts
|
|
491
491
|
function continueGoogleStream({
|
|
@@ -916,6 +916,19 @@ import {
|
|
|
916
916
|
isUrlSupported,
|
|
917
917
|
secureJsonParse
|
|
918
918
|
} from "@ai-sdk/provider-utils";
|
|
919
|
+
|
|
920
|
+
// src/google-generative-ai-prompt.ts
|
|
921
|
+
import { z as z6 } from "zod/v4";
|
|
922
|
+
var googleVideoMetadataSchema = z6.object({
|
|
923
|
+
/** Start offset as a duration in seconds, e.g. `'3.5s'`. */
|
|
924
|
+
startOffset: z6.string().optional(),
|
|
925
|
+
/** End offset as a duration in seconds, e.g. `'10s'`. */
|
|
926
|
+
endOffset: z6.string().optional(),
|
|
927
|
+
/** Frames per second in the range (0, 24]. Defaults to 1. */
|
|
928
|
+
fps: z6.number().gt(0).max(24).optional()
|
|
929
|
+
});
|
|
930
|
+
|
|
931
|
+
// src/convert-to-google-generative-ai-messages.ts
|
|
919
932
|
var SKIP_THOUGHT_SIGNATURE_VALIDATOR = "skip_thought_signature_validator";
|
|
920
933
|
function getGoogleProviderOptions(providerOptions, providerOptionsName) {
|
|
921
934
|
const namespaces = [
|
|
@@ -1054,7 +1067,7 @@ function appendLegacyToolResultParts(parts, toolName, outputValue, toolCallId, i
|
|
|
1054
1067
|
}
|
|
1055
1068
|
}
|
|
1056
1069
|
function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
1057
|
-
var _a2, _b, _c, _d, _e, _f, _g;
|
|
1070
|
+
var _a2, _b, _c, _d, _e, _f, _g, _h;
|
|
1058
1071
|
const systemInstructionParts = [];
|
|
1059
1072
|
const contents = [];
|
|
1060
1073
|
let systemMessagesAllowed = true;
|
|
@@ -1094,17 +1107,24 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
|
1094
1107
|
}
|
|
1095
1108
|
case "file": {
|
|
1096
1109
|
const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType;
|
|
1110
|
+
const rawVideoMetadata = (_g = getGoogleProviderOptions(
|
|
1111
|
+
part.providerOptions,
|
|
1112
|
+
providerOptionsName
|
|
1113
|
+
)) == null ? void 0 : _g.videoMetadata;
|
|
1114
|
+
const videoMetadata = rawVideoMetadata == null ? void 0 : googleVideoMetadataSchema.parse(rawVideoMetadata);
|
|
1097
1115
|
parts.push(
|
|
1098
1116
|
part.data instanceof URL ? {
|
|
1099
1117
|
fileData: {
|
|
1100
1118
|
mimeType: mediaType,
|
|
1101
1119
|
fileUri: part.data.protocol === "gs:" && part.originalUrl != null ? part.originalUrl : part.data.toString()
|
|
1102
|
-
}
|
|
1120
|
+
},
|
|
1121
|
+
...videoMetadata != null ? { videoMetadata } : {}
|
|
1103
1122
|
} : {
|
|
1104
1123
|
inlineData: {
|
|
1105
1124
|
mimeType: mediaType,
|
|
1106
1125
|
data: convertToBase642(part.data)
|
|
1107
|
-
}
|
|
1126
|
+
},
|
|
1127
|
+
...videoMetadata != null ? { videoMetadata } : {}
|
|
1108
1128
|
}
|
|
1109
1129
|
);
|
|
1110
1130
|
break;
|
|
@@ -1265,7 +1285,7 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
|
1265
1285
|
name: part.toolName,
|
|
1266
1286
|
response: {
|
|
1267
1287
|
name: part.toolName,
|
|
1268
|
-
content: output.type === "execution-denied" ? (
|
|
1288
|
+
content: output.type === "execution-denied" ? (_h = output.reason) != null ? _h : "Tool call execution denied." : output.value
|
|
1269
1289
|
}
|
|
1270
1290
|
}
|
|
1271
1291
|
});
|
|
@@ -1376,23 +1396,23 @@ import {
|
|
|
1376
1396
|
lazySchema as lazySchema6,
|
|
1377
1397
|
zodSchema as zodSchema6
|
|
1378
1398
|
} from "@ai-sdk/provider-utils";
|
|
1379
|
-
import { z as
|
|
1399
|
+
import { z as z7 } from "zod/v4";
|
|
1380
1400
|
var googleLanguageModelOptions = lazySchema6(
|
|
1381
1401
|
() => zodSchema6(
|
|
1382
|
-
|
|
1383
|
-
responseModalities:
|
|
1384
|
-
thinkingConfig:
|
|
1385
|
-
thinkingBudget:
|
|
1386
|
-
includeThoughts:
|
|
1402
|
+
z7.object({
|
|
1403
|
+
responseModalities: z7.array(z7.enum(["TEXT", "IMAGE"])).optional(),
|
|
1404
|
+
thinkingConfig: z7.object({
|
|
1405
|
+
thinkingBudget: z7.number().optional(),
|
|
1406
|
+
includeThoughts: z7.boolean().optional(),
|
|
1387
1407
|
// https://ai.google.dev/gemini-api/docs/gemini-3?thinking=high#thinking_level
|
|
1388
|
-
thinkingLevel:
|
|
1408
|
+
thinkingLevel: z7.enum(["minimal", "low", "medium", "high"]).optional()
|
|
1389
1409
|
}).optional(),
|
|
1390
1410
|
/**
|
|
1391
1411
|
* Optional.
|
|
1392
1412
|
* The name of the cached content used as context to serve the prediction.
|
|
1393
1413
|
* Format: cachedContents/{cachedContent}
|
|
1394
1414
|
*/
|
|
1395
|
-
cachedContent:
|
|
1415
|
+
cachedContent: z7.string().optional(),
|
|
1396
1416
|
/**
|
|
1397
1417
|
* Optional. Enable structured output. Default is true.
|
|
1398
1418
|
*
|
|
@@ -1401,13 +1421,13 @@ var googleLanguageModelOptions = lazySchema6(
|
|
|
1401
1421
|
* Google Generative AI uses. You can use this to disable
|
|
1402
1422
|
* structured outputs if you need to.
|
|
1403
1423
|
*/
|
|
1404
|
-
structuredOutputs:
|
|
1424
|
+
structuredOutputs: z7.boolean().optional(),
|
|
1405
1425
|
/**
|
|
1406
1426
|
* Optional. A list of unique safety settings for blocking unsafe content.
|
|
1407
1427
|
*/
|
|
1408
|
-
safetySettings:
|
|
1409
|
-
|
|
1410
|
-
category:
|
|
1428
|
+
safetySettings: z7.array(
|
|
1429
|
+
z7.object({
|
|
1430
|
+
category: z7.enum([
|
|
1411
1431
|
"HARM_CATEGORY_UNSPECIFIED",
|
|
1412
1432
|
"HARM_CATEGORY_HATE_SPEECH",
|
|
1413
1433
|
"HARM_CATEGORY_DANGEROUS_CONTENT",
|
|
@@ -1415,7 +1435,7 @@ var googleLanguageModelOptions = lazySchema6(
|
|
|
1415
1435
|
"HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
|
1416
1436
|
"HARM_CATEGORY_CIVIC_INTEGRITY"
|
|
1417
1437
|
]),
|
|
1418
|
-
threshold:
|
|
1438
|
+
threshold: z7.enum([
|
|
1419
1439
|
"HARM_BLOCK_THRESHOLD_UNSPECIFIED",
|
|
1420
1440
|
"BLOCK_LOW_AND_ABOVE",
|
|
1421
1441
|
"BLOCK_MEDIUM_AND_ABOVE",
|
|
@@ -1425,7 +1445,7 @@ var googleLanguageModelOptions = lazySchema6(
|
|
|
1425
1445
|
])
|
|
1426
1446
|
})
|
|
1427
1447
|
).optional(),
|
|
1428
|
-
threshold:
|
|
1448
|
+
threshold: z7.enum([
|
|
1429
1449
|
"HARM_BLOCK_THRESHOLD_UNSPECIFIED",
|
|
1430
1450
|
"BLOCK_LOW_AND_ABOVE",
|
|
1431
1451
|
"BLOCK_MEDIUM_AND_ABOVE",
|
|
@@ -1438,19 +1458,19 @@ var googleLanguageModelOptions = lazySchema6(
|
|
|
1438
1458
|
*
|
|
1439
1459
|
* https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
|
|
1440
1460
|
*/
|
|
1441
|
-
audioTimestamp:
|
|
1461
|
+
audioTimestamp: z7.boolean().optional(),
|
|
1442
1462
|
/**
|
|
1443
1463
|
* Optional. Defines labels used in billing reports. Available on Vertex AI only.
|
|
1444
1464
|
*
|
|
1445
1465
|
* https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls
|
|
1446
1466
|
*/
|
|
1447
|
-
labels:
|
|
1467
|
+
labels: z7.record(z7.string(), z7.string()).optional(),
|
|
1448
1468
|
/**
|
|
1449
1469
|
* Optional. If specified, the media resolution specified will be used.
|
|
1450
1470
|
*
|
|
1451
1471
|
* https://ai.google.dev/api/generate-content#MediaResolution
|
|
1452
1472
|
*/
|
|
1453
|
-
mediaResolution:
|
|
1473
|
+
mediaResolution: z7.enum([
|
|
1454
1474
|
"MEDIA_RESOLUTION_UNSPECIFIED",
|
|
1455
1475
|
"MEDIA_RESOLUTION_LOW",
|
|
1456
1476
|
"MEDIA_RESOLUTION_MEDIUM",
|
|
@@ -1461,8 +1481,8 @@ var googleLanguageModelOptions = lazySchema6(
|
|
|
1461
1481
|
*
|
|
1462
1482
|
* https://ai.google.dev/gemini-api/docs/image-generation#aspect_ratios
|
|
1463
1483
|
*/
|
|
1464
|
-
imageConfig:
|
|
1465
|
-
aspectRatio:
|
|
1484
|
+
imageConfig: z7.object({
|
|
1485
|
+
aspectRatio: z7.enum([
|
|
1466
1486
|
"1:1",
|
|
1467
1487
|
"2:3",
|
|
1468
1488
|
"3:2",
|
|
@@ -1478,12 +1498,12 @@ var googleLanguageModelOptions = lazySchema6(
|
|
|
1478
1498
|
"1:4",
|
|
1479
1499
|
"4:1"
|
|
1480
1500
|
]).optional(),
|
|
1481
|
-
imageSize:
|
|
1501
|
+
imageSize: z7.enum(["1K", "2K", "4K", "512"]).optional(),
|
|
1482
1502
|
/**
|
|
1483
1503
|
* Optional. Controls the generation of people in images.
|
|
1484
1504
|
* Vertex AI only.
|
|
1485
1505
|
*/
|
|
1486
|
-
personGeneration:
|
|
1506
|
+
personGeneration: z7.enum([
|
|
1487
1507
|
"PERSON_GENERATION_UNSPECIFIED",
|
|
1488
1508
|
"ALLOW_ALL",
|
|
1489
1509
|
"ALLOW_ADULT",
|
|
@@ -1497,7 +1517,7 @@ var googleLanguageModelOptions = lazySchema6(
|
|
|
1497
1517
|
*
|
|
1498
1518
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerationConfig
|
|
1499
1519
|
*/
|
|
1500
|
-
prominentPeople:
|
|
1520
|
+
prominentPeople: z7.enum([
|
|
1501
1521
|
"PROMINENT_PEOPLE_UNSPECIFIED",
|
|
1502
1522
|
"ALLOW_PROMINENT_PEOPLE",
|
|
1503
1523
|
"BLOCK_PROMINENT_PEOPLE"
|
|
@@ -1506,9 +1526,9 @@ var googleLanguageModelOptions = lazySchema6(
|
|
|
1506
1526
|
* Optional. The image output format for generated images.
|
|
1507
1527
|
* Vertex AI only.
|
|
1508
1528
|
*/
|
|
1509
|
-
imageOutputOptions:
|
|
1510
|
-
mimeType:
|
|
1511
|
-
compressionQuality:
|
|
1529
|
+
imageOutputOptions: z7.object({
|
|
1530
|
+
mimeType: z7.enum(["image/jpeg", "image/png"]).optional(),
|
|
1531
|
+
compressionQuality: z7.number().optional()
|
|
1512
1532
|
}).optional()
|
|
1513
1533
|
}).optional(),
|
|
1514
1534
|
/**
|
|
@@ -1517,10 +1537,10 @@ var googleLanguageModelOptions = lazySchema6(
|
|
|
1517
1537
|
*
|
|
1518
1538
|
* https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps
|
|
1519
1539
|
*/
|
|
1520
|
-
retrievalConfig:
|
|
1521
|
-
latLng:
|
|
1522
|
-
latitude:
|
|
1523
|
-
longitude:
|
|
1540
|
+
retrievalConfig: z7.object({
|
|
1541
|
+
latLng: z7.object({
|
|
1542
|
+
latitude: z7.number(),
|
|
1543
|
+
longitude: z7.number()
|
|
1524
1544
|
}).optional()
|
|
1525
1545
|
}).optional(),
|
|
1526
1546
|
/**
|
|
@@ -1533,12 +1553,12 @@ var googleLanguageModelOptions = lazySchema6(
|
|
|
1533
1553
|
*
|
|
1534
1554
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling#streaming-fc
|
|
1535
1555
|
*/
|
|
1536
|
-
streamFunctionCallArguments:
|
|
1556
|
+
streamFunctionCallArguments: z7.boolean().optional(),
|
|
1537
1557
|
/**
|
|
1538
1558
|
* Optional. The service tier to use for the request. Sent as the
|
|
1539
1559
|
* `serviceTier` body field. Gemini API only.
|
|
1540
1560
|
*/
|
|
1541
|
-
serviceTier:
|
|
1561
|
+
serviceTier: z7.enum(["standard", "flex", "priority"]).optional(),
|
|
1542
1562
|
/**
|
|
1543
1563
|
* Optional. Resumes a response that stopped with `MAX_TOKENS` because it
|
|
1544
1564
|
* used up its `maxOutputTokens` budget (Gemini 4 long decode). Pass the
|
|
@@ -1548,7 +1568,7 @@ var googleLanguageModelOptions = lazySchema6(
|
|
|
1548
1568
|
* per-request cap while budget remains (`CONTINUATION`) are continued
|
|
1549
1569
|
* automatically. Sent as the `continuationToken` body field.
|
|
1550
1570
|
*/
|
|
1551
|
-
continuationToken:
|
|
1571
|
+
continuationToken: z7.string().optional(),
|
|
1552
1572
|
/**
|
|
1553
1573
|
* Optional. Vertex AI only. Sent as the
|
|
1554
1574
|
* `X-Vertex-AI-LLM-Shared-Request-Type` request header to select a
|
|
@@ -1559,7 +1579,7 @@ var googleLanguageModelOptions = lazySchema6(
|
|
|
1559
1579
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/priority-paygo
|
|
1560
1580
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/flex-paygo
|
|
1561
1581
|
*/
|
|
1562
|
-
sharedRequestType:
|
|
1582
|
+
sharedRequestType: z7.enum(["priority", "flex", "standard"]).optional(),
|
|
1563
1583
|
/**
|
|
1564
1584
|
* Optional. Vertex AI only. Sent as the `X-Vertex-AI-LLM-Request-Type`
|
|
1565
1585
|
* request header. Set to `'shared'` together with `sharedRequestType`
|
|
@@ -1567,7 +1587,7 @@ var googleLanguageModelOptions = lazySchema6(
|
|
|
1567
1587
|
*
|
|
1568
1588
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/priority-paygo
|
|
1569
1589
|
*/
|
|
1570
|
-
requestType:
|
|
1590
|
+
requestType: z7.enum(["shared"]).optional()
|
|
1571
1591
|
})
|
|
1572
1592
|
)
|
|
1573
1593
|
);
|
|
@@ -3186,205 +3206,205 @@ function extractSources({
|
|
|
3186
3206
|
}
|
|
3187
3207
|
return sources.length > 0 ? sources : void 0;
|
|
3188
3208
|
}
|
|
3189
|
-
var getGroundingMetadataSchema = () =>
|
|
3190
|
-
webSearchQueries:
|
|
3191
|
-
imageSearchQueries:
|
|
3192
|
-
retrievalQueries:
|
|
3193
|
-
searchEntryPoint:
|
|
3194
|
-
groundingChunks:
|
|
3195
|
-
|
|
3196
|
-
web:
|
|
3197
|
-
image:
|
|
3198
|
-
sourceUri:
|
|
3199
|
-
imageUri:
|
|
3200
|
-
title:
|
|
3201
|
-
domain:
|
|
3209
|
+
var getGroundingMetadataSchema = () => z8.object({
|
|
3210
|
+
webSearchQueries: z8.array(z8.string()).nullish(),
|
|
3211
|
+
imageSearchQueries: z8.array(z8.string()).nullish(),
|
|
3212
|
+
retrievalQueries: z8.array(z8.string()).nullish(),
|
|
3213
|
+
searchEntryPoint: z8.object({ renderedContent: z8.string() }).nullish(),
|
|
3214
|
+
groundingChunks: z8.array(
|
|
3215
|
+
z8.object({
|
|
3216
|
+
web: z8.object({ uri: z8.string(), title: z8.string().nullish() }).nullish(),
|
|
3217
|
+
image: z8.object({
|
|
3218
|
+
sourceUri: z8.string(),
|
|
3219
|
+
imageUri: z8.string(),
|
|
3220
|
+
title: z8.string().nullish(),
|
|
3221
|
+
domain: z8.string().nullish()
|
|
3202
3222
|
}).nullish(),
|
|
3203
|
-
retrievedContext:
|
|
3204
|
-
uri:
|
|
3205
|
-
title:
|
|
3206
|
-
text:
|
|
3207
|
-
fileSearchStore:
|
|
3208
|
-
customMetadata:
|
|
3209
|
-
|
|
3210
|
-
key:
|
|
3211
|
-
stringValue:
|
|
3212
|
-
numericValue:
|
|
3213
|
-
stringListValue:
|
|
3223
|
+
retrievedContext: z8.object({
|
|
3224
|
+
uri: z8.string().nullish(),
|
|
3225
|
+
title: z8.string().nullish(),
|
|
3226
|
+
text: z8.string().nullish(),
|
|
3227
|
+
fileSearchStore: z8.string().nullish(),
|
|
3228
|
+
customMetadata: z8.array(
|
|
3229
|
+
z8.object({
|
|
3230
|
+
key: z8.string(),
|
|
3231
|
+
stringValue: z8.string().nullish(),
|
|
3232
|
+
numericValue: z8.number().nullish(),
|
|
3233
|
+
stringListValue: z8.object({ values: z8.array(z8.string()).nullish() }).nullish()
|
|
3214
3234
|
})
|
|
3215
3235
|
).nullish()
|
|
3216
3236
|
}).nullish(),
|
|
3217
|
-
maps:
|
|
3218
|
-
uri:
|
|
3219
|
-
title:
|
|
3220
|
-
text:
|
|
3221
|
-
placeId:
|
|
3237
|
+
maps: z8.object({
|
|
3238
|
+
uri: z8.string().nullish(),
|
|
3239
|
+
title: z8.string().nullish(),
|
|
3240
|
+
text: z8.string().nullish(),
|
|
3241
|
+
placeId: z8.string().nullish()
|
|
3222
3242
|
}).nullish()
|
|
3223
3243
|
})
|
|
3224
3244
|
).nullish(),
|
|
3225
|
-
groundingSupports:
|
|
3226
|
-
|
|
3227
|
-
segment:
|
|
3228
|
-
startIndex:
|
|
3229
|
-
endIndex:
|
|
3230
|
-
text:
|
|
3245
|
+
groundingSupports: z8.array(
|
|
3246
|
+
z8.object({
|
|
3247
|
+
segment: z8.object({
|
|
3248
|
+
startIndex: z8.number().nullish(),
|
|
3249
|
+
endIndex: z8.number().nullish(),
|
|
3250
|
+
text: z8.string().nullish()
|
|
3231
3251
|
}).nullish(),
|
|
3232
|
-
segment_text:
|
|
3233
|
-
groundingChunkIndices:
|
|
3234
|
-
supportChunkIndices:
|
|
3235
|
-
confidenceScores:
|
|
3236
|
-
confidenceScore:
|
|
3252
|
+
segment_text: z8.string().nullish(),
|
|
3253
|
+
groundingChunkIndices: z8.array(z8.number()).nullish(),
|
|
3254
|
+
supportChunkIndices: z8.array(z8.number()).nullish(),
|
|
3255
|
+
confidenceScores: z8.array(z8.number()).nullish(),
|
|
3256
|
+
confidenceScore: z8.array(z8.number()).nullish()
|
|
3237
3257
|
})
|
|
3238
3258
|
).nullish(),
|
|
3239
|
-
retrievalMetadata:
|
|
3240
|
-
|
|
3241
|
-
webDynamicRetrievalScore:
|
|
3259
|
+
retrievalMetadata: z8.union([
|
|
3260
|
+
z8.object({
|
|
3261
|
+
webDynamicRetrievalScore: z8.number()
|
|
3242
3262
|
}),
|
|
3243
|
-
|
|
3263
|
+
z8.object({})
|
|
3244
3264
|
]).nullish()
|
|
3245
3265
|
});
|
|
3246
|
-
var partialArgSchema = () =>
|
|
3247
|
-
jsonPath:
|
|
3248
|
-
stringValue:
|
|
3249
|
-
numberValue:
|
|
3250
|
-
boolValue:
|
|
3251
|
-
nullValue:
|
|
3252
|
-
willContinue:
|
|
3266
|
+
var partialArgSchema = () => z8.object({
|
|
3267
|
+
jsonPath: z8.string(),
|
|
3268
|
+
stringValue: z8.string().nullish(),
|
|
3269
|
+
numberValue: z8.number().nullish(),
|
|
3270
|
+
boolValue: z8.boolean().nullish(),
|
|
3271
|
+
nullValue: z8.unknown().nullish(),
|
|
3272
|
+
willContinue: z8.boolean().nullish()
|
|
3253
3273
|
});
|
|
3254
|
-
var getContentSchema = () =>
|
|
3255
|
-
parts:
|
|
3256
|
-
|
|
3274
|
+
var getContentSchema = () => z8.object({
|
|
3275
|
+
parts: z8.array(
|
|
3276
|
+
z8.union([
|
|
3257
3277
|
// note: order matters since text can be fully empty
|
|
3258
|
-
|
|
3259
|
-
functionCall:
|
|
3260
|
-
id:
|
|
3261
|
-
name:
|
|
3262
|
-
args:
|
|
3263
|
-
partialArgs:
|
|
3264
|
-
willContinue:
|
|
3278
|
+
z8.object({
|
|
3279
|
+
functionCall: z8.object({
|
|
3280
|
+
id: z8.string().nullish(),
|
|
3281
|
+
name: z8.string().nullish(),
|
|
3282
|
+
args: z8.unknown().nullish(),
|
|
3283
|
+
partialArgs: z8.array(partialArgSchema()).nullish(),
|
|
3284
|
+
willContinue: z8.boolean().nullish()
|
|
3265
3285
|
}),
|
|
3266
|
-
thoughtSignature:
|
|
3286
|
+
thoughtSignature: z8.string().nullish()
|
|
3267
3287
|
}),
|
|
3268
|
-
|
|
3269
|
-
inlineData:
|
|
3270
|
-
mimeType:
|
|
3271
|
-
data:
|
|
3288
|
+
z8.object({
|
|
3289
|
+
inlineData: z8.object({
|
|
3290
|
+
mimeType: z8.string(),
|
|
3291
|
+
data: z8.string()
|
|
3272
3292
|
}),
|
|
3273
|
-
thought:
|
|
3274
|
-
thoughtSignature:
|
|
3293
|
+
thought: z8.boolean().nullish(),
|
|
3294
|
+
thoughtSignature: z8.string().nullish()
|
|
3275
3295
|
}),
|
|
3276
|
-
|
|
3277
|
-
toolCall:
|
|
3278
|
-
toolType:
|
|
3279
|
-
args:
|
|
3280
|
-
id:
|
|
3296
|
+
z8.object({
|
|
3297
|
+
toolCall: z8.object({
|
|
3298
|
+
toolType: z8.string(),
|
|
3299
|
+
args: z8.unknown().nullish(),
|
|
3300
|
+
id: z8.string()
|
|
3281
3301
|
}),
|
|
3282
|
-
thoughtSignature:
|
|
3302
|
+
thoughtSignature: z8.string().nullish()
|
|
3283
3303
|
}),
|
|
3284
|
-
|
|
3285
|
-
toolResponse:
|
|
3286
|
-
toolType:
|
|
3287
|
-
response:
|
|
3288
|
-
id:
|
|
3304
|
+
z8.object({
|
|
3305
|
+
toolResponse: z8.object({
|
|
3306
|
+
toolType: z8.string(),
|
|
3307
|
+
response: z8.unknown().nullish(),
|
|
3308
|
+
id: z8.string()
|
|
3289
3309
|
}),
|
|
3290
|
-
thoughtSignature:
|
|
3310
|
+
thoughtSignature: z8.string().nullish()
|
|
3291
3311
|
}),
|
|
3292
|
-
|
|
3293
|
-
executableCode:
|
|
3294
|
-
language:
|
|
3295
|
-
code:
|
|
3312
|
+
z8.object({
|
|
3313
|
+
executableCode: z8.object({
|
|
3314
|
+
language: z8.string(),
|
|
3315
|
+
code: z8.string()
|
|
3296
3316
|
}).nullish(),
|
|
3297
|
-
codeExecutionResult:
|
|
3298
|
-
outcome:
|
|
3299
|
-
output:
|
|
3317
|
+
codeExecutionResult: z8.object({
|
|
3318
|
+
outcome: z8.string(),
|
|
3319
|
+
output: z8.string().nullish()
|
|
3300
3320
|
}).nullish(),
|
|
3301
|
-
text:
|
|
3302
|
-
thought:
|
|
3303
|
-
thoughtSignature:
|
|
3321
|
+
text: z8.string().nullish(),
|
|
3322
|
+
thought: z8.boolean().nullish(),
|
|
3323
|
+
thoughtSignature: z8.string().nullish()
|
|
3304
3324
|
})
|
|
3305
3325
|
])
|
|
3306
3326
|
).nullish()
|
|
3307
3327
|
});
|
|
3308
|
-
var getSafetyRatingSchema = () =>
|
|
3309
|
-
category:
|
|
3310
|
-
probability:
|
|
3311
|
-
probabilityScore:
|
|
3312
|
-
severity:
|
|
3313
|
-
severityScore:
|
|
3314
|
-
blocked:
|
|
3328
|
+
var getSafetyRatingSchema = () => z8.object({
|
|
3329
|
+
category: z8.string().nullish(),
|
|
3330
|
+
probability: z8.string().nullish(),
|
|
3331
|
+
probabilityScore: z8.number().nullish(),
|
|
3332
|
+
severity: z8.string().nullish(),
|
|
3333
|
+
severityScore: z8.number().nullish(),
|
|
3334
|
+
blocked: z8.boolean().nullish()
|
|
3315
3335
|
});
|
|
3316
|
-
var tokenDetailsSchema = () =>
|
|
3317
|
-
|
|
3318
|
-
modality:
|
|
3319
|
-
tokenCount:
|
|
3320
|
-
}).catchall(
|
|
3336
|
+
var tokenDetailsSchema = () => z8.array(
|
|
3337
|
+
z8.object({
|
|
3338
|
+
modality: z8.string(),
|
|
3339
|
+
tokenCount: z8.number()
|
|
3340
|
+
}).catchall(z8.json())
|
|
3321
3341
|
).nullish();
|
|
3322
|
-
var usageSchema = () =>
|
|
3323
|
-
cachedContentTokenCount:
|
|
3324
|
-
thoughtsTokenCount:
|
|
3325
|
-
promptTokenCount:
|
|
3326
|
-
candidatesTokenCount:
|
|
3327
|
-
toolUsePromptTokenCount:
|
|
3328
|
-
totalTokenCount:
|
|
3342
|
+
var usageSchema = () => z8.object({
|
|
3343
|
+
cachedContentTokenCount: z8.number().nullish(),
|
|
3344
|
+
thoughtsTokenCount: z8.number().nullish(),
|
|
3345
|
+
promptTokenCount: z8.number().nullish(),
|
|
3346
|
+
candidatesTokenCount: z8.number().nullish(),
|
|
3347
|
+
toolUsePromptTokenCount: z8.number().nullish(),
|
|
3348
|
+
totalTokenCount: z8.number().nullish(),
|
|
3329
3349
|
// https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerateContentResponse#TrafficType
|
|
3330
|
-
trafficType:
|
|
3331
|
-
serviceTier:
|
|
3350
|
+
trafficType: z8.string().nullish(),
|
|
3351
|
+
serviceTier: z8.string().nullish(),
|
|
3332
3352
|
// https://ai.google.dev/api/generate-content#Modality
|
|
3333
3353
|
promptTokensDetails: tokenDetailsSchema(),
|
|
3334
3354
|
cacheTokensDetails: tokenDetailsSchema(),
|
|
3335
3355
|
candidatesTokensDetails: tokenDetailsSchema(),
|
|
3336
3356
|
toolUsePromptTokensDetails: tokenDetailsSchema()
|
|
3337
|
-
}).catchall(
|
|
3338
|
-
var getUrlContextMetadataSchema = () =>
|
|
3339
|
-
urlMetadata:
|
|
3340
|
-
|
|
3341
|
-
retrievedUrl:
|
|
3342
|
-
urlRetrievalStatus:
|
|
3357
|
+
}).catchall(z8.json());
|
|
3358
|
+
var getUrlContextMetadataSchema = () => z8.object({
|
|
3359
|
+
urlMetadata: z8.array(
|
|
3360
|
+
z8.object({
|
|
3361
|
+
retrievedUrl: z8.string(),
|
|
3362
|
+
urlRetrievalStatus: z8.string()
|
|
3343
3363
|
})
|
|
3344
3364
|
).nullish()
|
|
3345
3365
|
});
|
|
3346
3366
|
var responseSchema = lazySchema7(
|
|
3347
3367
|
() => zodSchema7(
|
|
3348
|
-
|
|
3349
|
-
responseId:
|
|
3350
|
-
candidates:
|
|
3351
|
-
|
|
3352
|
-
content: getContentSchema().nullish().or(
|
|
3353
|
-
finishReason:
|
|
3354
|
-
finishMessage:
|
|
3355
|
-
continuationToken:
|
|
3356
|
-
safetyRatings:
|
|
3368
|
+
z8.object({
|
|
3369
|
+
responseId: z8.string().nullish(),
|
|
3370
|
+
candidates: z8.array(
|
|
3371
|
+
z8.object({
|
|
3372
|
+
content: getContentSchema().nullish().or(z8.object({}).strict()),
|
|
3373
|
+
finishReason: z8.string().nullish(),
|
|
3374
|
+
finishMessage: z8.string().nullish(),
|
|
3375
|
+
continuationToken: z8.string().nullish(),
|
|
3376
|
+
safetyRatings: z8.array(getSafetyRatingSchema()).nullish(),
|
|
3357
3377
|
groundingMetadata: getGroundingMetadataSchema().nullish(),
|
|
3358
3378
|
urlContextMetadata: getUrlContextMetadataSchema().nullish()
|
|
3359
3379
|
})
|
|
3360
3380
|
).nullish(),
|
|
3361
3381
|
usageMetadata: usageSchema().nullish(),
|
|
3362
|
-
promptFeedback:
|
|
3363
|
-
blockReason:
|
|
3364
|
-
safetyRatings:
|
|
3382
|
+
promptFeedback: z8.object({
|
|
3383
|
+
blockReason: z8.string().nullish(),
|
|
3384
|
+
safetyRatings: z8.array(getSafetyRatingSchema()).nullish()
|
|
3365
3385
|
}).nullish()
|
|
3366
3386
|
})
|
|
3367
3387
|
)
|
|
3368
3388
|
);
|
|
3369
3389
|
var chunkSchema = lazySchema7(
|
|
3370
3390
|
() => zodSchema7(
|
|
3371
|
-
|
|
3372
|
-
responseId:
|
|
3373
|
-
candidates:
|
|
3374
|
-
|
|
3391
|
+
z8.object({
|
|
3392
|
+
responseId: z8.string().nullish(),
|
|
3393
|
+
candidates: z8.array(
|
|
3394
|
+
z8.object({
|
|
3375
3395
|
content: getContentSchema().nullish(),
|
|
3376
|
-
finishReason:
|
|
3377
|
-
finishMessage:
|
|
3378
|
-
continuationToken:
|
|
3379
|
-
safetyRatings:
|
|
3396
|
+
finishReason: z8.string().nullish(),
|
|
3397
|
+
finishMessage: z8.string().nullish(),
|
|
3398
|
+
continuationToken: z8.string().nullish(),
|
|
3399
|
+
safetyRatings: z8.array(getSafetyRatingSchema()).nullish(),
|
|
3380
3400
|
groundingMetadata: getGroundingMetadataSchema().nullish(),
|
|
3381
3401
|
urlContextMetadata: getUrlContextMetadataSchema().nullish()
|
|
3382
3402
|
})
|
|
3383
3403
|
).nullish(),
|
|
3384
3404
|
usageMetadata: usageSchema().nullish(),
|
|
3385
|
-
promptFeedback:
|
|
3386
|
-
blockReason:
|
|
3387
|
-
safetyRatings:
|
|
3405
|
+
promptFeedback: z8.object({
|
|
3406
|
+
blockReason: z8.string().nullish(),
|
|
3407
|
+
safetyRatings: z8.array(getSafetyRatingSchema()).nullish()
|
|
3388
3408
|
}).nullish()
|
|
3389
3409
|
})
|
|
3390
3410
|
)
|
|
@@ -3395,16 +3415,16 @@ function isConfirmedPromptBlockReason(blockReason) {
|
|
|
3395
3415
|
|
|
3396
3416
|
// src/tool/code-execution.ts
|
|
3397
3417
|
import { createProviderToolFactoryWithOutputSchema } from "@ai-sdk/provider-utils";
|
|
3398
|
-
import { z as
|
|
3418
|
+
import { z as z9 } from "zod/v4";
|
|
3399
3419
|
var codeExecution = createProviderToolFactoryWithOutputSchema({
|
|
3400
3420
|
id: "google.code_execution",
|
|
3401
|
-
inputSchema:
|
|
3402
|
-
language:
|
|
3403
|
-
code:
|
|
3421
|
+
inputSchema: z9.object({
|
|
3422
|
+
language: z9.string().describe("The programming language of the code."),
|
|
3423
|
+
code: z9.string().describe("The code to be executed.")
|
|
3404
3424
|
}),
|
|
3405
|
-
outputSchema:
|
|
3406
|
-
outcome:
|
|
3407
|
-
output:
|
|
3425
|
+
outputSchema: z9.object({
|
|
3426
|
+
outcome: z9.string().describe('The outcome of the execution (e.g., "OUTCOME_OK").'),
|
|
3427
|
+
output: z9.string().describe("The output from the code execution.")
|
|
3408
3428
|
})
|
|
3409
3429
|
});
|
|
3410
3430
|
|
|
@@ -3414,10 +3434,10 @@ import {
|
|
|
3414
3434
|
lazySchema as lazySchema8,
|
|
3415
3435
|
zodSchema as zodSchema8
|
|
3416
3436
|
} from "@ai-sdk/provider-utils";
|
|
3417
|
-
import { z as
|
|
3437
|
+
import { z as z10 } from "zod/v4";
|
|
3418
3438
|
var enterpriseWebSearch = createProviderToolFactory({
|
|
3419
3439
|
id: "google.enterprise_web_search",
|
|
3420
|
-
inputSchema: lazySchema8(() => zodSchema8(
|
|
3440
|
+
inputSchema: lazySchema8(() => zodSchema8(z10.object({})))
|
|
3421
3441
|
});
|
|
3422
3442
|
|
|
3423
3443
|
// src/tool/file-search.ts
|
|
@@ -3426,20 +3446,20 @@ import {
|
|
|
3426
3446
|
lazySchema as lazySchema9,
|
|
3427
3447
|
zodSchema as zodSchema9
|
|
3428
3448
|
} from "@ai-sdk/provider-utils";
|
|
3429
|
-
import { z as
|
|
3430
|
-
var fileSearchArgsBaseSchema = () =>
|
|
3449
|
+
import { z as z11 } from "zod/v4";
|
|
3450
|
+
var fileSearchArgsBaseSchema = () => z11.object({
|
|
3431
3451
|
/** The names of the file_search_stores to retrieve from.
|
|
3432
3452
|
* Example: `fileSearchStores/my-file-search-store-123`
|
|
3433
3453
|
*/
|
|
3434
|
-
fileSearchStoreNames:
|
|
3454
|
+
fileSearchStoreNames: z11.array(z11.string()).describe(
|
|
3435
3455
|
"The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`"
|
|
3436
3456
|
),
|
|
3437
3457
|
/** The number of file search retrieval chunks to retrieve. */
|
|
3438
|
-
topK:
|
|
3458
|
+
topK: z11.number().int().positive().describe("The number of file search retrieval chunks to retrieve.").optional(),
|
|
3439
3459
|
/** Metadata filter to apply to the file search retrieval documents.
|
|
3440
3460
|
* See https://google.aip.dev/160 for the syntax of the filter expression.
|
|
3441
3461
|
*/
|
|
3442
|
-
metadataFilter:
|
|
3462
|
+
metadataFilter: z11.string().describe(
|
|
3443
3463
|
"Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression."
|
|
3444
3464
|
).optional()
|
|
3445
3465
|
}).passthrough();
|
|
@@ -3457,10 +3477,10 @@ import {
|
|
|
3457
3477
|
lazySchema as lazySchema10,
|
|
3458
3478
|
zodSchema as zodSchema10
|
|
3459
3479
|
} from "@ai-sdk/provider-utils";
|
|
3460
|
-
import { z as
|
|
3480
|
+
import { z as z12 } from "zod/v4";
|
|
3461
3481
|
var googleMaps = createProviderToolFactory3({
|
|
3462
3482
|
id: "google.google_maps",
|
|
3463
|
-
inputSchema: lazySchema10(() => zodSchema10(
|
|
3483
|
+
inputSchema: lazySchema10(() => zodSchema10(z12.object({})))
|
|
3464
3484
|
});
|
|
3465
3485
|
|
|
3466
3486
|
// src/tool/google-search.ts
|
|
@@ -3469,15 +3489,15 @@ import {
|
|
|
3469
3489
|
lazySchema as lazySchema11,
|
|
3470
3490
|
zodSchema as zodSchema11
|
|
3471
3491
|
} from "@ai-sdk/provider-utils";
|
|
3472
|
-
import { z as
|
|
3473
|
-
var googleSearchToolArgsBaseSchema = () =>
|
|
3474
|
-
searchTypes:
|
|
3475
|
-
webSearch:
|
|
3476
|
-
imageSearch:
|
|
3492
|
+
import { z as z13 } from "zod/v4";
|
|
3493
|
+
var googleSearchToolArgsBaseSchema = () => z13.object({
|
|
3494
|
+
searchTypes: z13.object({
|
|
3495
|
+
webSearch: z13.object({}).optional(),
|
|
3496
|
+
imageSearch: z13.object({}).optional()
|
|
3477
3497
|
}).optional(),
|
|
3478
|
-
timeRangeFilter:
|
|
3479
|
-
startTime:
|
|
3480
|
-
endTime:
|
|
3498
|
+
timeRangeFilter: z13.object({
|
|
3499
|
+
startTime: z13.string(),
|
|
3500
|
+
endTime: z13.string()
|
|
3481
3501
|
}).optional()
|
|
3482
3502
|
}).passthrough();
|
|
3483
3503
|
var googleSearchToolArgsSchema = lazySchema11(
|
|
@@ -3496,20 +3516,20 @@ import {
|
|
|
3496
3516
|
lazySchema as lazySchema12,
|
|
3497
3517
|
zodSchema as zodSchema12
|
|
3498
3518
|
} from "@ai-sdk/provider-utils";
|
|
3499
|
-
import { z as
|
|
3519
|
+
import { z as z14 } from "zod/v4";
|
|
3500
3520
|
var urlContext = createProviderToolFactory5({
|
|
3501
3521
|
id: "google.url_context",
|
|
3502
|
-
inputSchema: lazySchema12(() => zodSchema12(
|
|
3522
|
+
inputSchema: lazySchema12(() => zodSchema12(z14.object({})))
|
|
3503
3523
|
});
|
|
3504
3524
|
|
|
3505
3525
|
// src/tool/vertex-rag-store.ts
|
|
3506
3526
|
import { createProviderToolFactory as createProviderToolFactory6 } from "@ai-sdk/provider-utils";
|
|
3507
|
-
import { z as
|
|
3527
|
+
import { z as z15 } from "zod/v4";
|
|
3508
3528
|
var vertexRagStore = createProviderToolFactory6({
|
|
3509
3529
|
id: "google.vertex_rag_store",
|
|
3510
|
-
inputSchema:
|
|
3511
|
-
ragCorpus:
|
|
3512
|
-
topK:
|
|
3530
|
+
inputSchema: z15.object({
|
|
3531
|
+
ragCorpus: z15.string(),
|
|
3532
|
+
topK: z15.number().optional()
|
|
3513
3533
|
})
|
|
3514
3534
|
});
|
|
3515
3535
|
|
|
@@ -3585,7 +3605,7 @@ import {
|
|
|
3585
3605
|
resolve as resolve4,
|
|
3586
3606
|
zodSchema as zodSchema13
|
|
3587
3607
|
} from "@ai-sdk/provider-utils";
|
|
3588
|
-
import { z as
|
|
3608
|
+
import { z as z16 } from "zod/v4";
|
|
3589
3609
|
var GoogleGenerativeAIImageModel = class {
|
|
3590
3610
|
constructor(modelId, settings, config) {
|
|
3591
3611
|
this.modelId = modelId;
|
|
@@ -3841,11 +3861,11 @@ function isGeminiModel(modelId) {
|
|
|
3841
3861
|
}
|
|
3842
3862
|
var googleImageResponseSchema = lazySchema13(
|
|
3843
3863
|
() => zodSchema13(
|
|
3844
|
-
|
|
3845
|
-
predictions:
|
|
3846
|
-
|
|
3847
|
-
|
|
3848
|
-
|
|
3864
|
+
z16.object({
|
|
3865
|
+
predictions: z16.array(
|
|
3866
|
+
z16.union([
|
|
3867
|
+
z16.object({ bytesBase64Encoded: z16.string() }),
|
|
3868
|
+
z16.object({ raiFilteredReason: z16.string() })
|
|
3849
3869
|
])
|
|
3850
3870
|
).default([])
|
|
3851
3871
|
})
|
|
@@ -3853,9 +3873,9 @@ var googleImageResponseSchema = lazySchema13(
|
|
|
3853
3873
|
);
|
|
3854
3874
|
var googleImageModelOptionsSchema = lazySchema13(
|
|
3855
3875
|
() => zodSchema13(
|
|
3856
|
-
|
|
3857
|
-
personGeneration:
|
|
3858
|
-
aspectRatio:
|
|
3876
|
+
z16.object({
|
|
3877
|
+
personGeneration: z16.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
|
|
3878
|
+
aspectRatio: z16.enum(["1:1", "3:4", "4:3", "9:16", "16:9"]).nullish(),
|
|
3859
3879
|
/**
|
|
3860
3880
|
* Enable Google Search grounding for Gemini image models. The value is
|
|
3861
3881
|
* forwarded as the args of the `google.tools.googleSearch` provider
|
|
@@ -3887,7 +3907,7 @@ import {
|
|
|
3887
3907
|
resolve as resolve5,
|
|
3888
3908
|
zodSchema as zodSchema14
|
|
3889
3909
|
} from "@ai-sdk/provider-utils";
|
|
3890
|
-
import { z as
|
|
3910
|
+
import { z as z17 } from "zod/v4";
|
|
3891
3911
|
function getFirstFrameImage(options) {
|
|
3892
3912
|
var _a2, _b;
|
|
3893
3913
|
return (_b = (_a2 = options.frameImages) == null ? void 0 : _a2.find((frame) => frame.frameType === "first_frame")) == null ? void 0 : _b.image;
|
|
@@ -4154,20 +4174,20 @@ var GoogleGenerativeAIVideoModel = class {
|
|
|
4154
4174
|
};
|
|
4155
4175
|
var googleOperationSchema = lazySchema14(
|
|
4156
4176
|
() => zodSchema14(
|
|
4157
|
-
|
|
4158
|
-
name:
|
|
4159
|
-
done:
|
|
4160
|
-
error:
|
|
4161
|
-
code:
|
|
4162
|
-
message:
|
|
4163
|
-
status:
|
|
4177
|
+
z17.object({
|
|
4178
|
+
name: z17.string().nullish(),
|
|
4179
|
+
done: z17.boolean().nullish(),
|
|
4180
|
+
error: z17.object({
|
|
4181
|
+
code: z17.number().nullish(),
|
|
4182
|
+
message: z17.string(),
|
|
4183
|
+
status: z17.string().nullish()
|
|
4164
4184
|
}).nullish(),
|
|
4165
|
-
response:
|
|
4166
|
-
generateVideoResponse:
|
|
4167
|
-
generatedSamples:
|
|
4168
|
-
|
|
4169
|
-
video:
|
|
4170
|
-
uri:
|
|
4185
|
+
response: z17.object({
|
|
4186
|
+
generateVideoResponse: z17.object({
|
|
4187
|
+
generatedSamples: z17.array(
|
|
4188
|
+
z17.object({
|
|
4189
|
+
video: z17.object({
|
|
4190
|
+
uri: z17.string().nullish()
|
|
4171
4191
|
}).nullish()
|
|
4172
4192
|
})
|
|
4173
4193
|
).nullish()
|
|
@@ -4178,15 +4198,15 @@ var googleOperationSchema = lazySchema14(
|
|
|
4178
4198
|
);
|
|
4179
4199
|
var googleVideoModelOptionsSchema = lazySchema14(
|
|
4180
4200
|
() => zodSchema14(
|
|
4181
|
-
|
|
4182
|
-
pollIntervalMs:
|
|
4183
|
-
pollTimeoutMs:
|
|
4184
|
-
personGeneration:
|
|
4185
|
-
negativePrompt:
|
|
4186
|
-
referenceImages:
|
|
4187
|
-
|
|
4188
|
-
bytesBase64Encoded:
|
|
4189
|
-
gcsUri:
|
|
4201
|
+
z17.object({
|
|
4202
|
+
pollIntervalMs: z17.number().positive().nullish(),
|
|
4203
|
+
pollTimeoutMs: z17.number().positive().nullish(),
|
|
4204
|
+
personGeneration: z17.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
|
|
4205
|
+
negativePrompt: z17.string().nullish(),
|
|
4206
|
+
referenceImages: z17.array(
|
|
4207
|
+
z17.object({
|
|
4208
|
+
bytesBase64Encoded: z17.string().nullish(),
|
|
4209
|
+
gcsUri: z17.string().nullish()
|
|
4190
4210
|
})
|
|
4191
4211
|
).nullish()
|
|
4192
4212
|
}).passthrough()
|
|
@@ -5362,30 +5382,30 @@ import {
|
|
|
5362
5382
|
lazySchema as lazySchema15,
|
|
5363
5383
|
zodSchema as zodSchema15
|
|
5364
5384
|
} from "@ai-sdk/provider-utils";
|
|
5365
|
-
import { z as
|
|
5366
|
-
var tokenByModalitySchema = () =>
|
|
5367
|
-
modality:
|
|
5368
|
-
tokens:
|
|
5385
|
+
import { z as z18 } from "zod/v4";
|
|
5386
|
+
var tokenByModalitySchema = () => z18.object({
|
|
5387
|
+
modality: z18.string().nullish(),
|
|
5388
|
+
tokens: z18.number().nullish()
|
|
5369
5389
|
}).loose();
|
|
5370
|
-
var usageSchema2 = () =>
|
|
5371
|
-
total_input_tokens:
|
|
5372
|
-
total_output_tokens:
|
|
5373
|
-
total_thought_tokens:
|
|
5374
|
-
total_cached_tokens:
|
|
5375
|
-
total_tool_use_tokens:
|
|
5376
|
-
total_tokens:
|
|
5377
|
-
input_tokens_by_modality:
|
|
5378
|
-
output_tokens_by_modality:
|
|
5379
|
-
cached_tokens_by_modality:
|
|
5380
|
-
tool_use_tokens_by_modality:
|
|
5381
|
-
grounding_tool_count:
|
|
5382
|
-
|
|
5383
|
-
type:
|
|
5384
|
-
count:
|
|
5390
|
+
var usageSchema2 = () => z18.object({
|
|
5391
|
+
total_input_tokens: z18.number().nullish(),
|
|
5392
|
+
total_output_tokens: z18.number().nullish(),
|
|
5393
|
+
total_thought_tokens: z18.number().nullish(),
|
|
5394
|
+
total_cached_tokens: z18.number().nullish(),
|
|
5395
|
+
total_tool_use_tokens: z18.number().nullish(),
|
|
5396
|
+
total_tokens: z18.number().nullish(),
|
|
5397
|
+
input_tokens_by_modality: z18.array(tokenByModalitySchema()).nullish(),
|
|
5398
|
+
output_tokens_by_modality: z18.array(tokenByModalitySchema()).nullish(),
|
|
5399
|
+
cached_tokens_by_modality: z18.array(tokenByModalitySchema()).nullish(),
|
|
5400
|
+
tool_use_tokens_by_modality: z18.array(tokenByModalitySchema()).nullish(),
|
|
5401
|
+
grounding_tool_count: z18.array(
|
|
5402
|
+
z18.object({
|
|
5403
|
+
type: z18.string().nullish(),
|
|
5404
|
+
count: z18.number().nullish()
|
|
5385
5405
|
}).loose()
|
|
5386
5406
|
).nullish()
|
|
5387
5407
|
}).loose();
|
|
5388
|
-
var interactionStatusSchema = () =>
|
|
5408
|
+
var interactionStatusSchema = () => z18.enum([
|
|
5389
5409
|
"in_progress",
|
|
5390
5410
|
"requires_action",
|
|
5391
5411
|
"completed",
|
|
@@ -5394,69 +5414,69 @@ var interactionStatusSchema = () => z17.enum([
|
|
|
5394
5414
|
"incomplete"
|
|
5395
5415
|
]);
|
|
5396
5416
|
var annotationSchema = () => {
|
|
5397
|
-
const urlCitation =
|
|
5398
|
-
type:
|
|
5399
|
-
url:
|
|
5400
|
-
title:
|
|
5401
|
-
start_index:
|
|
5402
|
-
end_index:
|
|
5417
|
+
const urlCitation = z18.object({
|
|
5418
|
+
type: z18.literal("url_citation"),
|
|
5419
|
+
url: z18.string().nullish(),
|
|
5420
|
+
title: z18.string().nullish(),
|
|
5421
|
+
start_index: z18.number().nullish(),
|
|
5422
|
+
end_index: z18.number().nullish()
|
|
5403
5423
|
}).loose();
|
|
5404
|
-
const fileCitation =
|
|
5405
|
-
type:
|
|
5406
|
-
file_name:
|
|
5407
|
-
document_uri:
|
|
5408
|
-
url:
|
|
5409
|
-
page_number:
|
|
5410
|
-
media_id:
|
|
5411
|
-
start_index:
|
|
5412
|
-
end_index:
|
|
5413
|
-
custom_metadata:
|
|
5424
|
+
const fileCitation = z18.object({
|
|
5425
|
+
type: z18.literal("file_citation"),
|
|
5426
|
+
file_name: z18.string().nullish(),
|
|
5427
|
+
document_uri: z18.string().nullish(),
|
|
5428
|
+
url: z18.string().nullish(),
|
|
5429
|
+
page_number: z18.number().nullish(),
|
|
5430
|
+
media_id: z18.string().nullish(),
|
|
5431
|
+
start_index: z18.number().nullish(),
|
|
5432
|
+
end_index: z18.number().nullish(),
|
|
5433
|
+
custom_metadata: z18.record(z18.string(), z18.unknown()).nullish()
|
|
5414
5434
|
}).loose();
|
|
5415
|
-
const placeCitation =
|
|
5416
|
-
type:
|
|
5417
|
-
name:
|
|
5418
|
-
url:
|
|
5419
|
-
place_id:
|
|
5420
|
-
start_index:
|
|
5421
|
-
end_index:
|
|
5435
|
+
const placeCitation = z18.object({
|
|
5436
|
+
type: z18.literal("place_citation"),
|
|
5437
|
+
name: z18.string().nullish(),
|
|
5438
|
+
url: z18.string().nullish(),
|
|
5439
|
+
place_id: z18.string().nullish(),
|
|
5440
|
+
start_index: z18.number().nullish(),
|
|
5441
|
+
end_index: z18.number().nullish()
|
|
5422
5442
|
}).loose();
|
|
5423
|
-
return
|
|
5443
|
+
return z18.union([
|
|
5424
5444
|
urlCitation,
|
|
5425
5445
|
fileCitation,
|
|
5426
5446
|
placeCitation,
|
|
5427
|
-
|
|
5447
|
+
z18.object({ type: z18.string() }).loose()
|
|
5428
5448
|
]);
|
|
5429
5449
|
};
|
|
5430
|
-
var thoughtSummaryItemSchema = () =>
|
|
5431
|
-
type:
|
|
5432
|
-
text:
|
|
5433
|
-
data:
|
|
5434
|
-
mime_type:
|
|
5450
|
+
var thoughtSummaryItemSchema = () => z18.object({
|
|
5451
|
+
type: z18.string(),
|
|
5452
|
+
text: z18.string().nullish(),
|
|
5453
|
+
data: z18.string().nullish(),
|
|
5454
|
+
mime_type: z18.string().nullish()
|
|
5435
5455
|
}).loose();
|
|
5436
5456
|
var contentBlockSchema = () => {
|
|
5437
|
-
const textContent =
|
|
5438
|
-
type:
|
|
5439
|
-
text:
|
|
5440
|
-
annotations:
|
|
5457
|
+
const textContent = z18.object({
|
|
5458
|
+
type: z18.literal("text"),
|
|
5459
|
+
text: z18.string(),
|
|
5460
|
+
annotations: z18.array(annotationSchema()).nullish()
|
|
5441
5461
|
}).loose();
|
|
5442
|
-
const imageContent =
|
|
5443
|
-
type:
|
|
5444
|
-
data:
|
|
5445
|
-
mime_type:
|
|
5446
|
-
resolution:
|
|
5447
|
-
uri:
|
|
5462
|
+
const imageContent = z18.object({
|
|
5463
|
+
type: z18.literal("image"),
|
|
5464
|
+
data: z18.string().nullish(),
|
|
5465
|
+
mime_type: z18.string().nullish(),
|
|
5466
|
+
resolution: z18.enum(["low", "medium", "high", "ultra_high"]).nullish(),
|
|
5467
|
+
uri: z18.string().nullish()
|
|
5448
5468
|
}).loose();
|
|
5449
|
-
const videoContent =
|
|
5450
|
-
type:
|
|
5451
|
-
data:
|
|
5452
|
-
mime_type:
|
|
5453
|
-
uri:
|
|
5469
|
+
const videoContent = z18.object({
|
|
5470
|
+
type: z18.literal("video"),
|
|
5471
|
+
data: z18.string().nullish(),
|
|
5472
|
+
mime_type: z18.string().nullish(),
|
|
5473
|
+
uri: z18.string().nullish()
|
|
5454
5474
|
}).loose();
|
|
5455
|
-
return
|
|
5475
|
+
return z18.union([
|
|
5456
5476
|
textContent,
|
|
5457
5477
|
imageContent,
|
|
5458
5478
|
videoContent,
|
|
5459
|
-
|
|
5479
|
+
z18.object({ type: z18.string() }).loose()
|
|
5460
5480
|
]);
|
|
5461
5481
|
};
|
|
5462
5482
|
var BUILTIN_TOOL_CALL_STEP_TYPES = [
|
|
@@ -5476,73 +5496,73 @@ var BUILTIN_TOOL_RESULT_STEP_TYPES = [
|
|
|
5476
5496
|
"mcp_server_tool_result"
|
|
5477
5497
|
];
|
|
5478
5498
|
var stepSchema = () => {
|
|
5479
|
-
const userInputStep =
|
|
5480
|
-
type:
|
|
5481
|
-
content:
|
|
5499
|
+
const userInputStep = z18.object({
|
|
5500
|
+
type: z18.literal("user_input"),
|
|
5501
|
+
content: z18.array(contentBlockSchema()).nullish()
|
|
5482
5502
|
}).loose();
|
|
5483
|
-
const modelOutputStep =
|
|
5484
|
-
type:
|
|
5485
|
-
content:
|
|
5503
|
+
const modelOutputStep = z18.object({
|
|
5504
|
+
type: z18.literal("model_output"),
|
|
5505
|
+
content: z18.array(contentBlockSchema()).nullish()
|
|
5486
5506
|
}).loose();
|
|
5487
|
-
const functionCallStep =
|
|
5488
|
-
type:
|
|
5489
|
-
id:
|
|
5490
|
-
name:
|
|
5491
|
-
arguments:
|
|
5492
|
-
signature:
|
|
5507
|
+
const functionCallStep = z18.object({
|
|
5508
|
+
type: z18.literal("function_call"),
|
|
5509
|
+
id: z18.string(),
|
|
5510
|
+
name: z18.string(),
|
|
5511
|
+
arguments: z18.record(z18.string(), z18.unknown()).nullish(),
|
|
5512
|
+
signature: z18.string().nullish()
|
|
5493
5513
|
}).loose();
|
|
5494
|
-
const thoughtStep =
|
|
5495
|
-
type:
|
|
5496
|
-
signature:
|
|
5497
|
-
summary:
|
|
5514
|
+
const thoughtStep = z18.object({
|
|
5515
|
+
type: z18.literal("thought"),
|
|
5516
|
+
signature: z18.string().nullish(),
|
|
5517
|
+
summary: z18.array(thoughtSummaryItemSchema()).nullish()
|
|
5498
5518
|
}).loose();
|
|
5499
|
-
const builtinToolCallStep =
|
|
5500
|
-
type:
|
|
5501
|
-
id:
|
|
5502
|
-
arguments:
|
|
5503
|
-
name:
|
|
5504
|
-
server_name:
|
|
5505
|
-
search_type:
|
|
5506
|
-
signature:
|
|
5519
|
+
const builtinToolCallStep = z18.object({
|
|
5520
|
+
type: z18.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
|
|
5521
|
+
id: z18.string(),
|
|
5522
|
+
arguments: z18.record(z18.string(), z18.unknown()).nullish(),
|
|
5523
|
+
name: z18.string().nullish(),
|
|
5524
|
+
server_name: z18.string().nullish(),
|
|
5525
|
+
search_type: z18.string().nullish(),
|
|
5526
|
+
signature: z18.string().nullish()
|
|
5507
5527
|
}).loose();
|
|
5508
|
-
const builtinToolResultStep =
|
|
5509
|
-
type:
|
|
5510
|
-
call_id:
|
|
5511
|
-
result:
|
|
5512
|
-
is_error:
|
|
5513
|
-
name:
|
|
5514
|
-
server_name:
|
|
5515
|
-
signature:
|
|
5528
|
+
const builtinToolResultStep = z18.object({
|
|
5529
|
+
type: z18.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
|
|
5530
|
+
call_id: z18.string(),
|
|
5531
|
+
result: z18.unknown().nullish(),
|
|
5532
|
+
is_error: z18.boolean().nullish(),
|
|
5533
|
+
name: z18.string().nullish(),
|
|
5534
|
+
server_name: z18.string().nullish(),
|
|
5535
|
+
signature: z18.string().nullish()
|
|
5516
5536
|
}).loose();
|
|
5517
|
-
return
|
|
5537
|
+
return z18.union([
|
|
5518
5538
|
userInputStep,
|
|
5519
5539
|
modelOutputStep,
|
|
5520
5540
|
functionCallStep,
|
|
5521
5541
|
thoughtStep,
|
|
5522
5542
|
builtinToolCallStep,
|
|
5523
5543
|
builtinToolResultStep,
|
|
5524
|
-
|
|
5544
|
+
z18.object({ type: z18.string() }).loose()
|
|
5525
5545
|
]);
|
|
5526
5546
|
};
|
|
5527
5547
|
var googleInteractionsResponseSchema = lazySchema15(
|
|
5528
5548
|
() => zodSchema15(
|
|
5529
|
-
|
|
5549
|
+
z18.object({
|
|
5530
5550
|
/*
|
|
5531
5551
|
* `id` is omitted from the response body when `store: false` (fully
|
|
5532
5552
|
* stateless mode) — there is no server-side interaction record for the
|
|
5533
5553
|
* client to reference. `nullish` lets the schema accept that shape.
|
|
5534
5554
|
*/
|
|
5535
|
-
id:
|
|
5536
|
-
created:
|
|
5537
|
-
updated:
|
|
5555
|
+
id: z18.string().nullish(),
|
|
5556
|
+
created: z18.string().nullish(),
|
|
5557
|
+
updated: z18.string().nullish(),
|
|
5538
5558
|
status: interactionStatusSchema(),
|
|
5539
|
-
model:
|
|
5540
|
-
agent:
|
|
5541
|
-
steps:
|
|
5559
|
+
model: z18.string().nullish(),
|
|
5560
|
+
agent: z18.string().nullish(),
|
|
5561
|
+
steps: z18.array(stepSchema()).nullish(),
|
|
5542
5562
|
usage: usageSchema2().nullish(),
|
|
5543
|
-
service_tier:
|
|
5544
|
-
previous_interaction_id:
|
|
5545
|
-
response_modalities:
|
|
5563
|
+
service_tier: z18.string().nullish(),
|
|
5564
|
+
previous_interaction_id: z18.string().nullish(),
|
|
5565
|
+
response_modalities: z18.array(z18.string()).nullish()
|
|
5546
5566
|
}).loose()
|
|
5547
5567
|
)
|
|
5548
5568
|
);
|
|
@@ -5552,82 +5572,82 @@ var googleInteractionsEventSchema = lazySchema15(
|
|
|
5552
5572
|
const status = interactionStatusSchema();
|
|
5553
5573
|
const annotation = annotationSchema();
|
|
5554
5574
|
const thoughtSummaryItem = thoughtSummaryItemSchema();
|
|
5555
|
-
const interactionCreatedEvent =
|
|
5556
|
-
event_type:
|
|
5557
|
-
event_id:
|
|
5558
|
-
interaction:
|
|
5575
|
+
const interactionCreatedEvent = z18.object({
|
|
5576
|
+
event_type: z18.literal("interaction.created"),
|
|
5577
|
+
event_id: z18.string().nullish(),
|
|
5578
|
+
interaction: z18.object({
|
|
5559
5579
|
/*
|
|
5560
5580
|
* `id` is omitted when `store: false` (fully stateless mode);
|
|
5561
5581
|
* see the matching note on `googleInteractionsResponseSchema.id`.
|
|
5562
5582
|
*/
|
|
5563
|
-
id:
|
|
5564
|
-
created:
|
|
5565
|
-
model:
|
|
5566
|
-
agent:
|
|
5583
|
+
id: z18.string().nullish(),
|
|
5584
|
+
created: z18.string().nullish(),
|
|
5585
|
+
model: z18.string().nullish(),
|
|
5586
|
+
agent: z18.string().nullish(),
|
|
5567
5587
|
status: status.nullish()
|
|
5568
5588
|
}).loose()
|
|
5569
5589
|
}).loose();
|
|
5570
|
-
const stepStartEvent =
|
|
5571
|
-
event_type:
|
|
5572
|
-
event_id:
|
|
5573
|
-
index:
|
|
5590
|
+
const stepStartEvent = z18.object({
|
|
5591
|
+
event_type: z18.literal("step.start"),
|
|
5592
|
+
event_id: z18.string().nullish(),
|
|
5593
|
+
index: z18.number(),
|
|
5574
5594
|
step: stepSchema()
|
|
5575
5595
|
}).loose();
|
|
5576
|
-
const stepDeltaText =
|
|
5577
|
-
type:
|
|
5578
|
-
text:
|
|
5596
|
+
const stepDeltaText = z18.object({
|
|
5597
|
+
type: z18.literal("text"),
|
|
5598
|
+
text: z18.string()
|
|
5579
5599
|
}).loose();
|
|
5580
|
-
const stepDeltaThoughtSummary =
|
|
5581
|
-
type:
|
|
5600
|
+
const stepDeltaThoughtSummary = z18.object({
|
|
5601
|
+
type: z18.literal("thought_summary"),
|
|
5582
5602
|
content: thoughtSummaryItem.nullish()
|
|
5583
5603
|
}).loose();
|
|
5584
|
-
const stepDeltaThoughtSignature =
|
|
5585
|
-
type:
|
|
5586
|
-
signature:
|
|
5604
|
+
const stepDeltaThoughtSignature = z18.object({
|
|
5605
|
+
type: z18.literal("thought_signature"),
|
|
5606
|
+
signature: z18.string().nullish()
|
|
5587
5607
|
}).loose();
|
|
5588
|
-
const stepDeltaArgumentsDelta =
|
|
5589
|
-
type:
|
|
5590
|
-
arguments:
|
|
5591
|
-
id:
|
|
5592
|
-
signature:
|
|
5608
|
+
const stepDeltaArgumentsDelta = z18.object({
|
|
5609
|
+
type: z18.literal("arguments_delta"),
|
|
5610
|
+
arguments: z18.string().nullish(),
|
|
5611
|
+
id: z18.string().nullish(),
|
|
5612
|
+
signature: z18.string().nullish()
|
|
5593
5613
|
}).loose();
|
|
5594
|
-
const stepDeltaTextAnnotation =
|
|
5595
|
-
type:
|
|
5596
|
-
annotations:
|
|
5614
|
+
const stepDeltaTextAnnotation = z18.object({
|
|
5615
|
+
type: z18.enum(["text_annotation_delta", "text_annotation"]),
|
|
5616
|
+
annotations: z18.array(annotation).nullish()
|
|
5597
5617
|
}).loose();
|
|
5598
|
-
const stepDeltaImage =
|
|
5599
|
-
type:
|
|
5600
|
-
data:
|
|
5601
|
-
mime_type:
|
|
5602
|
-
resolution:
|
|
5603
|
-
uri:
|
|
5618
|
+
const stepDeltaImage = z18.object({
|
|
5619
|
+
type: z18.literal("image"),
|
|
5620
|
+
data: z18.string().nullish(),
|
|
5621
|
+
mime_type: z18.string().nullish(),
|
|
5622
|
+
resolution: z18.enum(["low", "medium", "high", "ultra_high"]).nullish(),
|
|
5623
|
+
uri: z18.string().nullish()
|
|
5604
5624
|
}).loose();
|
|
5605
|
-
const stepDeltaVideo =
|
|
5606
|
-
type:
|
|
5607
|
-
data:
|
|
5608
|
-
mime_type:
|
|
5609
|
-
uri:
|
|
5625
|
+
const stepDeltaVideo = z18.object({
|
|
5626
|
+
type: z18.literal("video"),
|
|
5627
|
+
data: z18.string().nullish(),
|
|
5628
|
+
mime_type: z18.string().nullish(),
|
|
5629
|
+
uri: z18.string().nullish()
|
|
5610
5630
|
}).loose();
|
|
5611
|
-
const stepDeltaBuiltinToolCall =
|
|
5612
|
-
type:
|
|
5613
|
-
id:
|
|
5614
|
-
arguments:
|
|
5615
|
-
name:
|
|
5616
|
-
server_name:
|
|
5617
|
-
search_type:
|
|
5618
|
-
signature:
|
|
5631
|
+
const stepDeltaBuiltinToolCall = z18.object({
|
|
5632
|
+
type: z18.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
|
|
5633
|
+
id: z18.string().nullish(),
|
|
5634
|
+
arguments: z18.record(z18.string(), z18.unknown()).nullish(),
|
|
5635
|
+
name: z18.string().nullish(),
|
|
5636
|
+
server_name: z18.string().nullish(),
|
|
5637
|
+
search_type: z18.string().nullish(),
|
|
5638
|
+
signature: z18.string().nullish()
|
|
5619
5639
|
}).loose();
|
|
5620
|
-
const stepDeltaBuiltinToolResult =
|
|
5621
|
-
type:
|
|
5622
|
-
call_id:
|
|
5623
|
-
result:
|
|
5624
|
-
is_error:
|
|
5625
|
-
name:
|
|
5626
|
-
server_name:
|
|
5627
|
-
signature:
|
|
5640
|
+
const stepDeltaBuiltinToolResult = z18.object({
|
|
5641
|
+
type: z18.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
|
|
5642
|
+
call_id: z18.string().nullish(),
|
|
5643
|
+
result: z18.unknown().nullish(),
|
|
5644
|
+
is_error: z18.boolean().nullish(),
|
|
5645
|
+
name: z18.string().nullish(),
|
|
5646
|
+
server_name: z18.string().nullish(),
|
|
5647
|
+
signature: z18.string().nullish()
|
|
5628
5648
|
}).loose();
|
|
5629
|
-
const stepDeltaUnknown =
|
|
5630
|
-
const stepDeltaUnion =
|
|
5649
|
+
const stepDeltaUnknown = z18.object({ type: z18.string() }).loose();
|
|
5650
|
+
const stepDeltaUnion = z18.union([
|
|
5631
5651
|
stepDeltaText,
|
|
5632
5652
|
stepDeltaImage,
|
|
5633
5653
|
stepDeltaVideo,
|
|
@@ -5639,55 +5659,55 @@ var googleInteractionsEventSchema = lazySchema15(
|
|
|
5639
5659
|
stepDeltaBuiltinToolResult,
|
|
5640
5660
|
stepDeltaUnknown
|
|
5641
5661
|
]);
|
|
5642
|
-
const stepDeltaEvent =
|
|
5643
|
-
event_type:
|
|
5644
|
-
event_id:
|
|
5645
|
-
index:
|
|
5662
|
+
const stepDeltaEvent = z18.object({
|
|
5663
|
+
event_type: z18.literal("step.delta"),
|
|
5664
|
+
event_id: z18.string().nullish(),
|
|
5665
|
+
index: z18.number(),
|
|
5646
5666
|
delta: stepDeltaUnion
|
|
5647
5667
|
}).loose();
|
|
5648
|
-
const stepStopEvent =
|
|
5649
|
-
event_type:
|
|
5650
|
-
event_id:
|
|
5651
|
-
index:
|
|
5668
|
+
const stepStopEvent = z18.object({
|
|
5669
|
+
event_type: z18.literal("step.stop"),
|
|
5670
|
+
event_id: z18.string().nullish(),
|
|
5671
|
+
index: z18.number()
|
|
5652
5672
|
}).loose();
|
|
5653
|
-
const interactionStatusUpdateEvent =
|
|
5654
|
-
event_type:
|
|
5655
|
-
event_id:
|
|
5656
|
-
interaction_id:
|
|
5673
|
+
const interactionStatusUpdateEvent = z18.object({
|
|
5674
|
+
event_type: z18.literal("interaction.status_update"),
|
|
5675
|
+
event_id: z18.string().nullish(),
|
|
5676
|
+
interaction_id: z18.string().nullish(),
|
|
5657
5677
|
status: status.nullish()
|
|
5658
5678
|
}).loose();
|
|
5659
|
-
const interactionInProgressEvent =
|
|
5660
|
-
event_type:
|
|
5661
|
-
event_id:
|
|
5662
|
-
interaction_id:
|
|
5679
|
+
const interactionInProgressEvent = z18.object({
|
|
5680
|
+
event_type: z18.literal("interaction.in_progress"),
|
|
5681
|
+
event_id: z18.string().nullish(),
|
|
5682
|
+
interaction_id: z18.string().nullish(),
|
|
5663
5683
|
status: status.nullish()
|
|
5664
5684
|
}).loose();
|
|
5665
|
-
const interactionRequiresActionEvent =
|
|
5666
|
-
event_type:
|
|
5667
|
-
event_id:
|
|
5668
|
-
interaction_id:
|
|
5685
|
+
const interactionRequiresActionEvent = z18.object({
|
|
5686
|
+
event_type: z18.literal("interaction.requires_action"),
|
|
5687
|
+
event_id: z18.string().nullish(),
|
|
5688
|
+
interaction_id: z18.string().nullish(),
|
|
5669
5689
|
status: status.nullish()
|
|
5670
5690
|
}).loose();
|
|
5671
|
-
const interactionCompletedEvent =
|
|
5672
|
-
event_type:
|
|
5673
|
-
event_id:
|
|
5674
|
-
interaction:
|
|
5675
|
-
id:
|
|
5691
|
+
const interactionCompletedEvent = z18.object({
|
|
5692
|
+
event_type: z18.literal("interaction.completed"),
|
|
5693
|
+
event_id: z18.string().nullish(),
|
|
5694
|
+
interaction: z18.object({
|
|
5695
|
+
id: z18.string().nullish(),
|
|
5676
5696
|
status: status.nullish(),
|
|
5677
5697
|
usage: usageSchema2().nullish(),
|
|
5678
|
-
service_tier:
|
|
5698
|
+
service_tier: z18.string().nullish()
|
|
5679
5699
|
}).loose()
|
|
5680
5700
|
}).loose();
|
|
5681
|
-
const errorEvent =
|
|
5682
|
-
event_type:
|
|
5683
|
-
event_id:
|
|
5684
|
-
error:
|
|
5685
|
-
code:
|
|
5686
|
-
message:
|
|
5701
|
+
const errorEvent = z18.object({
|
|
5702
|
+
event_type: z18.literal("error"),
|
|
5703
|
+
event_id: z18.string().nullish(),
|
|
5704
|
+
error: z18.object({
|
|
5705
|
+
code: z18.string().nullish(),
|
|
5706
|
+
message: z18.string().nullish()
|
|
5687
5707
|
}).loose().nullish()
|
|
5688
5708
|
}).loose();
|
|
5689
|
-
const unknownEvent =
|
|
5690
|
-
return
|
|
5709
|
+
const unknownEvent = z18.object({ event_type: z18.string() }).loose();
|
|
5710
|
+
return z18.union([
|
|
5691
5711
|
interactionCreatedEvent,
|
|
5692
5712
|
stepStartEvent,
|
|
5693
5713
|
stepDeltaEvent,
|
|
@@ -5708,26 +5728,26 @@ import {
|
|
|
5708
5728
|
lazySchema as lazySchema16,
|
|
5709
5729
|
zodSchema as zodSchema16
|
|
5710
5730
|
} from "@ai-sdk/provider-utils";
|
|
5711
|
-
import { z as
|
|
5731
|
+
import { z as z19 } from "zod/v4";
|
|
5712
5732
|
var googleInteractionsLanguageModelOptions = lazySchema16(
|
|
5713
5733
|
() => zodSchema16(
|
|
5714
|
-
|
|
5715
|
-
previousInteractionId:
|
|
5716
|
-
store:
|
|
5717
|
-
agent:
|
|
5718
|
-
agentConfig:
|
|
5719
|
-
|
|
5720
|
-
type:
|
|
5734
|
+
z19.object({
|
|
5735
|
+
previousInteractionId: z19.string().nullish(),
|
|
5736
|
+
store: z19.boolean().nullish(),
|
|
5737
|
+
agent: z19.string().nullish(),
|
|
5738
|
+
agentConfig: z19.union([
|
|
5739
|
+
z19.object({
|
|
5740
|
+
type: z19.literal("dynamic")
|
|
5721
5741
|
}).loose(),
|
|
5722
|
-
|
|
5723
|
-
type:
|
|
5724
|
-
thinkingSummaries:
|
|
5725
|
-
visualization:
|
|
5726
|
-
collaborativePlanning:
|
|
5742
|
+
z19.object({
|
|
5743
|
+
type: z19.literal("deep-research"),
|
|
5744
|
+
thinkingSummaries: z19.enum(["auto", "none"]).nullish(),
|
|
5745
|
+
visualization: z19.enum(["off", "auto"]).nullish(),
|
|
5746
|
+
collaborativePlanning: z19.boolean().nullish()
|
|
5727
5747
|
})
|
|
5728
5748
|
]).nullish(),
|
|
5729
|
-
thinkingLevel:
|
|
5730
|
-
thinkingSummaries:
|
|
5749
|
+
thinkingLevel: z19.enum(["minimal", "low", "medium", "high"]).nullish(),
|
|
5750
|
+
thinkingSummaries: z19.enum(["auto", "none"]).nullish(),
|
|
5731
5751
|
/**
|
|
5732
5752
|
* Output-format entries that map directly to the API's `response_format`
|
|
5733
5753
|
* array. Use this to request image, audio, video, or non-JSON text
|
|
@@ -5737,17 +5757,17 @@ var googleInteractionsLanguageModelOptions = lazySchema16(
|
|
|
5737
5757
|
* type: 'json', schema }` still drives JSON-mode and adds a matching
|
|
5738
5758
|
* text entry automatically; entries listed here are appended.
|
|
5739
5759
|
*/
|
|
5740
|
-
responseFormat:
|
|
5741
|
-
|
|
5742
|
-
|
|
5743
|
-
type:
|
|
5744
|
-
mimeType:
|
|
5745
|
-
schema:
|
|
5760
|
+
responseFormat: z19.array(
|
|
5761
|
+
z19.union([
|
|
5762
|
+
z19.object({
|
|
5763
|
+
type: z19.literal("text"),
|
|
5764
|
+
mimeType: z19.string().nullish(),
|
|
5765
|
+
schema: z19.unknown().nullish()
|
|
5746
5766
|
}).loose(),
|
|
5747
|
-
|
|
5748
|
-
type:
|
|
5749
|
-
mimeType:
|
|
5750
|
-
aspectRatio:
|
|
5767
|
+
z19.object({
|
|
5768
|
+
type: z19.literal("image"),
|
|
5769
|
+
mimeType: z19.string().nullish(),
|
|
5770
|
+
aspectRatio: z19.enum([
|
|
5751
5771
|
"1:1",
|
|
5752
5772
|
"2:3",
|
|
5753
5773
|
"3:2",
|
|
@@ -5763,19 +5783,19 @@ var googleInteractionsLanguageModelOptions = lazySchema16(
|
|
|
5763
5783
|
"1:4",
|
|
5764
5784
|
"4:1"
|
|
5765
5785
|
]).nullish(),
|
|
5766
|
-
imageSize:
|
|
5786
|
+
imageSize: z19.enum(["1K", "2K", "4K", "512"]).nullish()
|
|
5767
5787
|
}).loose(),
|
|
5768
|
-
|
|
5769
|
-
type:
|
|
5770
|
-
mimeType:
|
|
5788
|
+
z19.object({
|
|
5789
|
+
type: z19.literal("audio"),
|
|
5790
|
+
mimeType: z19.string().nullish()
|
|
5771
5791
|
}).loose(),
|
|
5772
|
-
|
|
5773
|
-
type:
|
|
5774
|
-
aspectRatio:
|
|
5775
|
-
resolution:
|
|
5776
|
-
duration:
|
|
5777
|
-
delivery:
|
|
5778
|
-
gcsUri:
|
|
5792
|
+
z19.object({
|
|
5793
|
+
type: z19.literal("video"),
|
|
5794
|
+
aspectRatio: z19.enum(["16:9", "9:16"]).nullish(),
|
|
5795
|
+
resolution: z19.enum(["360p", "720p", "1080p", "4k"]).nullish(),
|
|
5796
|
+
duration: z19.string().nullish(),
|
|
5797
|
+
delivery: z19.enum(["inline", "uri"]).nullish(),
|
|
5798
|
+
gcsUri: z19.string().nullish()
|
|
5779
5799
|
}).loose()
|
|
5780
5800
|
])
|
|
5781
5801
|
).nullish(),
|
|
@@ -5785,8 +5805,8 @@ var googleInteractionsLanguageModelOptions = lazySchema16(
|
|
|
5785
5805
|
* translates it into a matching `response_format` image entry and
|
|
5786
5806
|
* emits a warning when set.
|
|
5787
5807
|
*/
|
|
5788
|
-
imageConfig:
|
|
5789
|
-
aspectRatio:
|
|
5808
|
+
imageConfig: z19.object({
|
|
5809
|
+
aspectRatio: z19.enum([
|
|
5790
5810
|
"1:1",
|
|
5791
5811
|
"2:3",
|
|
5792
5812
|
"3:2",
|
|
@@ -5802,35 +5822,35 @@ var googleInteractionsLanguageModelOptions = lazySchema16(
|
|
|
5802
5822
|
"1:4",
|
|
5803
5823
|
"4:1"
|
|
5804
5824
|
]).nullish(),
|
|
5805
|
-
imageSize:
|
|
5825
|
+
imageSize: z19.enum(["1K", "2K", "4K", "512"]).nullish()
|
|
5806
5826
|
}).nullish(),
|
|
5807
|
-
mediaResolution:
|
|
5808
|
-
responseModalities:
|
|
5809
|
-
serviceTier:
|
|
5827
|
+
mediaResolution: z19.enum(["low", "medium", "high", "ultra_high"]).nullish(),
|
|
5828
|
+
responseModalities: z19.array(z19.enum(["text", "image", "audio", "video", "document"])).nullish(),
|
|
5829
|
+
serviceTier: z19.enum(["flex", "standard", "priority"]).nullish(),
|
|
5810
5830
|
/**
|
|
5811
5831
|
* Alternative to AI SDK `system` message. If both are set, the AI SDK
|
|
5812
5832
|
* `system` message wins and a warning is emitted.
|
|
5813
5833
|
*/
|
|
5814
|
-
systemInstruction:
|
|
5834
|
+
systemInstruction: z19.string().nullish(),
|
|
5815
5835
|
/**
|
|
5816
5836
|
* Per-block signature for round-tripping `thought.signature` and
|
|
5817
5837
|
* `function_call.signature` blocks. Set by the SDK on output reasoning /
|
|
5818
5838
|
* tool-call parts; passed back unchanged on input parts so the API
|
|
5819
5839
|
* accepts the prior turn.
|
|
5820
5840
|
*/
|
|
5821
|
-
signature:
|
|
5841
|
+
signature: z19.string().nullish(),
|
|
5822
5842
|
/**
|
|
5823
5843
|
* Set by the SDK on output assistant messages. The converter uses it to
|
|
5824
5844
|
* decide which messages to drop when compacting under
|
|
5825
5845
|
* `previousInteractionId`.
|
|
5826
5846
|
*/
|
|
5827
|
-
interactionId:
|
|
5847
|
+
interactionId: z19.string().nullish(),
|
|
5828
5848
|
/**
|
|
5829
5849
|
* Maximum time, in milliseconds, to poll a background interaction (agent
|
|
5830
5850
|
* call) before giving up. Defaults to 30 minutes. Long-running agents
|
|
5831
5851
|
* such as deep research can take tens of minutes — increase if needed.
|
|
5832
5852
|
*/
|
|
5833
|
-
pollingTimeoutMs:
|
|
5853
|
+
pollingTimeoutMs: z19.number().int().positive().nullish(),
|
|
5834
5854
|
/**
|
|
5835
5855
|
* Run the interaction in the background. Required for agents whose
|
|
5836
5856
|
* server-side workflow cannot complete within a single request/response.
|
|
@@ -5839,7 +5859,7 @@ var googleInteractionsLanguageModelOptions = lazySchema16(
|
|
|
5839
5859
|
* reject `true`; see the agent's documentation for which mode it
|
|
5840
5860
|
* requires.
|
|
5841
5861
|
*/
|
|
5842
|
-
background:
|
|
5862
|
+
background: z19.boolean().nullish(),
|
|
5843
5863
|
/**
|
|
5844
5864
|
* Environment configuration for the agent sandbox. Only applies to agent
|
|
5845
5865
|
* calls (`google.interactions({ agent })`); ignored on model-id calls.
|
|
@@ -5849,36 +5869,36 @@ var googleInteractionsLanguageModelOptions = lazySchema16(
|
|
|
5849
5869
|
* - object: provision a fresh sandbox and optionally preload `sources`
|
|
5850
5870
|
* and/or constrain outbound traffic via `network`.
|
|
5851
5871
|
*/
|
|
5852
|
-
environment:
|
|
5853
|
-
|
|
5854
|
-
|
|
5855
|
-
type:
|
|
5856
|
-
sources:
|
|
5857
|
-
|
|
5858
|
-
|
|
5859
|
-
type:
|
|
5860
|
-
source:
|
|
5861
|
-
target:
|
|
5872
|
+
environment: z19.union([
|
|
5873
|
+
z19.string(),
|
|
5874
|
+
z19.object({
|
|
5875
|
+
type: z19.literal("remote"),
|
|
5876
|
+
sources: z19.array(
|
|
5877
|
+
z19.union([
|
|
5878
|
+
z19.object({
|
|
5879
|
+
type: z19.literal("gcs"),
|
|
5880
|
+
source: z19.string(),
|
|
5881
|
+
target: z19.string().nullish()
|
|
5862
5882
|
}),
|
|
5863
|
-
|
|
5864
|
-
type:
|
|
5865
|
-
source:
|
|
5866
|
-
target:
|
|
5883
|
+
z19.object({
|
|
5884
|
+
type: z19.literal("repository"),
|
|
5885
|
+
source: z19.string(),
|
|
5886
|
+
target: z19.string().nullish()
|
|
5867
5887
|
}),
|
|
5868
|
-
|
|
5869
|
-
type:
|
|
5870
|
-
content:
|
|
5871
|
-
target:
|
|
5888
|
+
z19.object({
|
|
5889
|
+
type: z19.literal("inline"),
|
|
5890
|
+
content: z19.string(),
|
|
5891
|
+
target: z19.string()
|
|
5872
5892
|
})
|
|
5873
5893
|
])
|
|
5874
5894
|
).nullish(),
|
|
5875
|
-
network:
|
|
5876
|
-
|
|
5877
|
-
|
|
5878
|
-
allowlist:
|
|
5879
|
-
|
|
5880
|
-
domain:
|
|
5881
|
-
transform:
|
|
5895
|
+
network: z19.union([
|
|
5896
|
+
z19.literal("disabled"),
|
|
5897
|
+
z19.object({
|
|
5898
|
+
allowlist: z19.array(
|
|
5899
|
+
z19.object({
|
|
5900
|
+
domain: z19.string(),
|
|
5901
|
+
transform: z19.array(z19.record(z19.string(), z19.string())).nullish()
|
|
5882
5902
|
})
|
|
5883
5903
|
)
|
|
5884
5904
|
})
|