@ai-sdk/google 3.0.138 → 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 +16 -0
- package/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +570 -519
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +570 -519
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +544 -493
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +544 -493
- 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/google-json-accumulator.ts +52 -3
- 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
|
);
|
|
@@ -1876,8 +1896,10 @@ var GoogleJSONAccumulator = class {
|
|
|
1876
1896
|
processPartialArgs(partialArgs) {
|
|
1877
1897
|
let delta = "";
|
|
1878
1898
|
for (const arg of partialArgs) {
|
|
1879
|
-
const
|
|
1880
|
-
|
|
1899
|
+
const isArrayTerminator = arg.jsonPath.endsWith("[]");
|
|
1900
|
+
const jsonPath = isArrayTerminator ? arg.jsonPath.slice(0, -2) : arg.jsonPath;
|
|
1901
|
+
const rawPath = jsonPath.replace(/^\$\./, "");
|
|
1902
|
+
if (!rawPath || rawPath === "$") continue;
|
|
1881
1903
|
const segments = parsePath(rawPath);
|
|
1882
1904
|
const existingValue = getNestedValue(this.accumulatedArgs, segments);
|
|
1883
1905
|
const isStringContinuation = arg.stringValue != null && existingValue !== void 0;
|
|
@@ -1892,7 +1914,16 @@ var GoogleJSONAccumulator = class {
|
|
|
1892
1914
|
continue;
|
|
1893
1915
|
}
|
|
1894
1916
|
const resolved = resolvePartialArgValue(arg);
|
|
1895
|
-
if (resolved == null)
|
|
1917
|
+
if (resolved == null) {
|
|
1918
|
+
if (existingValue !== void 0 || arg.willContinue === true) continue;
|
|
1919
|
+
setNestedValue(
|
|
1920
|
+
this.accumulatedArgs,
|
|
1921
|
+
segments,
|
|
1922
|
+
isArrayTerminator ? [] : {}
|
|
1923
|
+
);
|
|
1924
|
+
delta += this.emitContainer(segments, isArrayTerminator);
|
|
1925
|
+
continue;
|
|
1926
|
+
}
|
|
1896
1927
|
setNestedValue(this.accumulatedArgs, segments, resolved.value);
|
|
1897
1928
|
delta += this.emitNavigationTo(segments, arg, resolved.json);
|
|
1898
1929
|
}
|
|
@@ -1944,6 +1975,26 @@ var GoogleJSONAccumulator = class {
|
|
|
1944
1975
|
fragment += this.emitLeaf(leafSegment, arg, valueJson);
|
|
1945
1976
|
return fragment;
|
|
1946
1977
|
}
|
|
1978
|
+
/**
|
|
1979
|
+
* Navigates to `targetSegments` and opens a container there. The container
|
|
1980
|
+
* stays open so later entries for its children continue inside it; it is
|
|
1981
|
+
* closed by subsequent navigation or by `finalize()`.
|
|
1982
|
+
*
|
|
1983
|
+
* Input: targetSegments=["nested","tags"], isArray=true
|
|
1984
|
+
* Output: '{"nested":{"tags":['
|
|
1985
|
+
*/
|
|
1986
|
+
emitContainer(targetSegments, isArray) {
|
|
1987
|
+
let fragment = "";
|
|
1988
|
+
if (this.stringOpen) {
|
|
1989
|
+
fragment += '"';
|
|
1990
|
+
this.stringOpen = false;
|
|
1991
|
+
}
|
|
1992
|
+
fragment += this.ensureRoot();
|
|
1993
|
+
const commonDepth = this.findCommonStackDepth(targetSegments);
|
|
1994
|
+
fragment += this.closeDownTo(commonDepth);
|
|
1995
|
+
fragment += this.openDownTo(targetSegments, isArray ? 0 : "");
|
|
1996
|
+
return fragment;
|
|
1997
|
+
}
|
|
1947
1998
|
/**
|
|
1948
1999
|
* Returns the stack depth to preserve when navigating to a new target
|
|
1949
2000
|
* container path. Always >= 1 (the root is never popped).
|
|
@@ -3155,205 +3206,205 @@ function extractSources({
|
|
|
3155
3206
|
}
|
|
3156
3207
|
return sources.length > 0 ? sources : void 0;
|
|
3157
3208
|
}
|
|
3158
|
-
var getGroundingMetadataSchema = () =>
|
|
3159
|
-
webSearchQueries:
|
|
3160
|
-
imageSearchQueries:
|
|
3161
|
-
retrievalQueries:
|
|
3162
|
-
searchEntryPoint:
|
|
3163
|
-
groundingChunks:
|
|
3164
|
-
|
|
3165
|
-
web:
|
|
3166
|
-
image:
|
|
3167
|
-
sourceUri:
|
|
3168
|
-
imageUri:
|
|
3169
|
-
title:
|
|
3170
|
-
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()
|
|
3171
3222
|
}).nullish(),
|
|
3172
|
-
retrievedContext:
|
|
3173
|
-
uri:
|
|
3174
|
-
title:
|
|
3175
|
-
text:
|
|
3176
|
-
fileSearchStore:
|
|
3177
|
-
customMetadata:
|
|
3178
|
-
|
|
3179
|
-
key:
|
|
3180
|
-
stringValue:
|
|
3181
|
-
numericValue:
|
|
3182
|
-
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()
|
|
3183
3234
|
})
|
|
3184
3235
|
).nullish()
|
|
3185
3236
|
}).nullish(),
|
|
3186
|
-
maps:
|
|
3187
|
-
uri:
|
|
3188
|
-
title:
|
|
3189
|
-
text:
|
|
3190
|
-
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()
|
|
3191
3242
|
}).nullish()
|
|
3192
3243
|
})
|
|
3193
3244
|
).nullish(),
|
|
3194
|
-
groundingSupports:
|
|
3195
|
-
|
|
3196
|
-
segment:
|
|
3197
|
-
startIndex:
|
|
3198
|
-
endIndex:
|
|
3199
|
-
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()
|
|
3200
3251
|
}).nullish(),
|
|
3201
|
-
segment_text:
|
|
3202
|
-
groundingChunkIndices:
|
|
3203
|
-
supportChunkIndices:
|
|
3204
|
-
confidenceScores:
|
|
3205
|
-
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()
|
|
3206
3257
|
})
|
|
3207
3258
|
).nullish(),
|
|
3208
|
-
retrievalMetadata:
|
|
3209
|
-
|
|
3210
|
-
webDynamicRetrievalScore:
|
|
3259
|
+
retrievalMetadata: z8.union([
|
|
3260
|
+
z8.object({
|
|
3261
|
+
webDynamicRetrievalScore: z8.number()
|
|
3211
3262
|
}),
|
|
3212
|
-
|
|
3263
|
+
z8.object({})
|
|
3213
3264
|
]).nullish()
|
|
3214
3265
|
});
|
|
3215
|
-
var partialArgSchema = () =>
|
|
3216
|
-
jsonPath:
|
|
3217
|
-
stringValue:
|
|
3218
|
-
numberValue:
|
|
3219
|
-
boolValue:
|
|
3220
|
-
nullValue:
|
|
3221
|
-
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()
|
|
3222
3273
|
});
|
|
3223
|
-
var getContentSchema = () =>
|
|
3224
|
-
parts:
|
|
3225
|
-
|
|
3274
|
+
var getContentSchema = () => z8.object({
|
|
3275
|
+
parts: z8.array(
|
|
3276
|
+
z8.union([
|
|
3226
3277
|
// note: order matters since text can be fully empty
|
|
3227
|
-
|
|
3228
|
-
functionCall:
|
|
3229
|
-
id:
|
|
3230
|
-
name:
|
|
3231
|
-
args:
|
|
3232
|
-
partialArgs:
|
|
3233
|
-
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()
|
|
3234
3285
|
}),
|
|
3235
|
-
thoughtSignature:
|
|
3286
|
+
thoughtSignature: z8.string().nullish()
|
|
3236
3287
|
}),
|
|
3237
|
-
|
|
3238
|
-
inlineData:
|
|
3239
|
-
mimeType:
|
|
3240
|
-
data:
|
|
3288
|
+
z8.object({
|
|
3289
|
+
inlineData: z8.object({
|
|
3290
|
+
mimeType: z8.string(),
|
|
3291
|
+
data: z8.string()
|
|
3241
3292
|
}),
|
|
3242
|
-
thought:
|
|
3243
|
-
thoughtSignature:
|
|
3293
|
+
thought: z8.boolean().nullish(),
|
|
3294
|
+
thoughtSignature: z8.string().nullish()
|
|
3244
3295
|
}),
|
|
3245
|
-
|
|
3246
|
-
toolCall:
|
|
3247
|
-
toolType:
|
|
3248
|
-
args:
|
|
3249
|
-
id:
|
|
3296
|
+
z8.object({
|
|
3297
|
+
toolCall: z8.object({
|
|
3298
|
+
toolType: z8.string(),
|
|
3299
|
+
args: z8.unknown().nullish(),
|
|
3300
|
+
id: z8.string()
|
|
3250
3301
|
}),
|
|
3251
|
-
thoughtSignature:
|
|
3302
|
+
thoughtSignature: z8.string().nullish()
|
|
3252
3303
|
}),
|
|
3253
|
-
|
|
3254
|
-
toolResponse:
|
|
3255
|
-
toolType:
|
|
3256
|
-
response:
|
|
3257
|
-
id:
|
|
3304
|
+
z8.object({
|
|
3305
|
+
toolResponse: z8.object({
|
|
3306
|
+
toolType: z8.string(),
|
|
3307
|
+
response: z8.unknown().nullish(),
|
|
3308
|
+
id: z8.string()
|
|
3258
3309
|
}),
|
|
3259
|
-
thoughtSignature:
|
|
3310
|
+
thoughtSignature: z8.string().nullish()
|
|
3260
3311
|
}),
|
|
3261
|
-
|
|
3262
|
-
executableCode:
|
|
3263
|
-
language:
|
|
3264
|
-
code:
|
|
3312
|
+
z8.object({
|
|
3313
|
+
executableCode: z8.object({
|
|
3314
|
+
language: z8.string(),
|
|
3315
|
+
code: z8.string()
|
|
3265
3316
|
}).nullish(),
|
|
3266
|
-
codeExecutionResult:
|
|
3267
|
-
outcome:
|
|
3268
|
-
output:
|
|
3317
|
+
codeExecutionResult: z8.object({
|
|
3318
|
+
outcome: z8.string(),
|
|
3319
|
+
output: z8.string().nullish()
|
|
3269
3320
|
}).nullish(),
|
|
3270
|
-
text:
|
|
3271
|
-
thought:
|
|
3272
|
-
thoughtSignature:
|
|
3321
|
+
text: z8.string().nullish(),
|
|
3322
|
+
thought: z8.boolean().nullish(),
|
|
3323
|
+
thoughtSignature: z8.string().nullish()
|
|
3273
3324
|
})
|
|
3274
3325
|
])
|
|
3275
3326
|
).nullish()
|
|
3276
3327
|
});
|
|
3277
|
-
var getSafetyRatingSchema = () =>
|
|
3278
|
-
category:
|
|
3279
|
-
probability:
|
|
3280
|
-
probabilityScore:
|
|
3281
|
-
severity:
|
|
3282
|
-
severityScore:
|
|
3283
|
-
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()
|
|
3284
3335
|
});
|
|
3285
|
-
var tokenDetailsSchema = () =>
|
|
3286
|
-
|
|
3287
|
-
modality:
|
|
3288
|
-
tokenCount:
|
|
3289
|
-
}).catchall(
|
|
3336
|
+
var tokenDetailsSchema = () => z8.array(
|
|
3337
|
+
z8.object({
|
|
3338
|
+
modality: z8.string(),
|
|
3339
|
+
tokenCount: z8.number()
|
|
3340
|
+
}).catchall(z8.json())
|
|
3290
3341
|
).nullish();
|
|
3291
|
-
var usageSchema = () =>
|
|
3292
|
-
cachedContentTokenCount:
|
|
3293
|
-
thoughtsTokenCount:
|
|
3294
|
-
promptTokenCount:
|
|
3295
|
-
candidatesTokenCount:
|
|
3296
|
-
toolUsePromptTokenCount:
|
|
3297
|
-
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(),
|
|
3298
3349
|
// https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerateContentResponse#TrafficType
|
|
3299
|
-
trafficType:
|
|
3300
|
-
serviceTier:
|
|
3350
|
+
trafficType: z8.string().nullish(),
|
|
3351
|
+
serviceTier: z8.string().nullish(),
|
|
3301
3352
|
// https://ai.google.dev/api/generate-content#Modality
|
|
3302
3353
|
promptTokensDetails: tokenDetailsSchema(),
|
|
3303
3354
|
cacheTokensDetails: tokenDetailsSchema(),
|
|
3304
3355
|
candidatesTokensDetails: tokenDetailsSchema(),
|
|
3305
3356
|
toolUsePromptTokensDetails: tokenDetailsSchema()
|
|
3306
|
-
}).catchall(
|
|
3307
|
-
var getUrlContextMetadataSchema = () =>
|
|
3308
|
-
urlMetadata:
|
|
3309
|
-
|
|
3310
|
-
retrievedUrl:
|
|
3311
|
-
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()
|
|
3312
3363
|
})
|
|
3313
3364
|
).nullish()
|
|
3314
3365
|
});
|
|
3315
3366
|
var responseSchema = lazySchema7(
|
|
3316
3367
|
() => zodSchema7(
|
|
3317
|
-
|
|
3318
|
-
responseId:
|
|
3319
|
-
candidates:
|
|
3320
|
-
|
|
3321
|
-
content: getContentSchema().nullish().or(
|
|
3322
|
-
finishReason:
|
|
3323
|
-
finishMessage:
|
|
3324
|
-
continuationToken:
|
|
3325
|
-
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(),
|
|
3326
3377
|
groundingMetadata: getGroundingMetadataSchema().nullish(),
|
|
3327
3378
|
urlContextMetadata: getUrlContextMetadataSchema().nullish()
|
|
3328
3379
|
})
|
|
3329
3380
|
).nullish(),
|
|
3330
3381
|
usageMetadata: usageSchema().nullish(),
|
|
3331
|
-
promptFeedback:
|
|
3332
|
-
blockReason:
|
|
3333
|
-
safetyRatings:
|
|
3382
|
+
promptFeedback: z8.object({
|
|
3383
|
+
blockReason: z8.string().nullish(),
|
|
3384
|
+
safetyRatings: z8.array(getSafetyRatingSchema()).nullish()
|
|
3334
3385
|
}).nullish()
|
|
3335
3386
|
})
|
|
3336
3387
|
)
|
|
3337
3388
|
);
|
|
3338
3389
|
var chunkSchema = lazySchema7(
|
|
3339
3390
|
() => zodSchema7(
|
|
3340
|
-
|
|
3341
|
-
responseId:
|
|
3342
|
-
candidates:
|
|
3343
|
-
|
|
3391
|
+
z8.object({
|
|
3392
|
+
responseId: z8.string().nullish(),
|
|
3393
|
+
candidates: z8.array(
|
|
3394
|
+
z8.object({
|
|
3344
3395
|
content: getContentSchema().nullish(),
|
|
3345
|
-
finishReason:
|
|
3346
|
-
finishMessage:
|
|
3347
|
-
continuationToken:
|
|
3348
|
-
safetyRatings:
|
|
3396
|
+
finishReason: z8.string().nullish(),
|
|
3397
|
+
finishMessage: z8.string().nullish(),
|
|
3398
|
+
continuationToken: z8.string().nullish(),
|
|
3399
|
+
safetyRatings: z8.array(getSafetyRatingSchema()).nullish(),
|
|
3349
3400
|
groundingMetadata: getGroundingMetadataSchema().nullish(),
|
|
3350
3401
|
urlContextMetadata: getUrlContextMetadataSchema().nullish()
|
|
3351
3402
|
})
|
|
3352
3403
|
).nullish(),
|
|
3353
3404
|
usageMetadata: usageSchema().nullish(),
|
|
3354
|
-
promptFeedback:
|
|
3355
|
-
blockReason:
|
|
3356
|
-
safetyRatings:
|
|
3405
|
+
promptFeedback: z8.object({
|
|
3406
|
+
blockReason: z8.string().nullish(),
|
|
3407
|
+
safetyRatings: z8.array(getSafetyRatingSchema()).nullish()
|
|
3357
3408
|
}).nullish()
|
|
3358
3409
|
})
|
|
3359
3410
|
)
|
|
@@ -3364,16 +3415,16 @@ function isConfirmedPromptBlockReason(blockReason) {
|
|
|
3364
3415
|
|
|
3365
3416
|
// src/tool/code-execution.ts
|
|
3366
3417
|
import { createProviderToolFactoryWithOutputSchema } from "@ai-sdk/provider-utils";
|
|
3367
|
-
import { z as
|
|
3418
|
+
import { z as z9 } from "zod/v4";
|
|
3368
3419
|
var codeExecution = createProviderToolFactoryWithOutputSchema({
|
|
3369
3420
|
id: "google.code_execution",
|
|
3370
|
-
inputSchema:
|
|
3371
|
-
language:
|
|
3372
|
-
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.")
|
|
3373
3424
|
}),
|
|
3374
|
-
outputSchema:
|
|
3375
|
-
outcome:
|
|
3376
|
-
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.")
|
|
3377
3428
|
})
|
|
3378
3429
|
});
|
|
3379
3430
|
|
|
@@ -3383,10 +3434,10 @@ import {
|
|
|
3383
3434
|
lazySchema as lazySchema8,
|
|
3384
3435
|
zodSchema as zodSchema8
|
|
3385
3436
|
} from "@ai-sdk/provider-utils";
|
|
3386
|
-
import { z as
|
|
3437
|
+
import { z as z10 } from "zod/v4";
|
|
3387
3438
|
var enterpriseWebSearch = createProviderToolFactory({
|
|
3388
3439
|
id: "google.enterprise_web_search",
|
|
3389
|
-
inputSchema: lazySchema8(() => zodSchema8(
|
|
3440
|
+
inputSchema: lazySchema8(() => zodSchema8(z10.object({})))
|
|
3390
3441
|
});
|
|
3391
3442
|
|
|
3392
3443
|
// src/tool/file-search.ts
|
|
@@ -3395,20 +3446,20 @@ import {
|
|
|
3395
3446
|
lazySchema as lazySchema9,
|
|
3396
3447
|
zodSchema as zodSchema9
|
|
3397
3448
|
} from "@ai-sdk/provider-utils";
|
|
3398
|
-
import { z as
|
|
3399
|
-
var fileSearchArgsBaseSchema = () =>
|
|
3449
|
+
import { z as z11 } from "zod/v4";
|
|
3450
|
+
var fileSearchArgsBaseSchema = () => z11.object({
|
|
3400
3451
|
/** The names of the file_search_stores to retrieve from.
|
|
3401
3452
|
* Example: `fileSearchStores/my-file-search-store-123`
|
|
3402
3453
|
*/
|
|
3403
|
-
fileSearchStoreNames:
|
|
3454
|
+
fileSearchStoreNames: z11.array(z11.string()).describe(
|
|
3404
3455
|
"The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`"
|
|
3405
3456
|
),
|
|
3406
3457
|
/** The number of file search retrieval chunks to retrieve. */
|
|
3407
|
-
topK:
|
|
3458
|
+
topK: z11.number().int().positive().describe("The number of file search retrieval chunks to retrieve.").optional(),
|
|
3408
3459
|
/** Metadata filter to apply to the file search retrieval documents.
|
|
3409
3460
|
* See https://google.aip.dev/160 for the syntax of the filter expression.
|
|
3410
3461
|
*/
|
|
3411
|
-
metadataFilter:
|
|
3462
|
+
metadataFilter: z11.string().describe(
|
|
3412
3463
|
"Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression."
|
|
3413
3464
|
).optional()
|
|
3414
3465
|
}).passthrough();
|
|
@@ -3426,10 +3477,10 @@ import {
|
|
|
3426
3477
|
lazySchema as lazySchema10,
|
|
3427
3478
|
zodSchema as zodSchema10
|
|
3428
3479
|
} from "@ai-sdk/provider-utils";
|
|
3429
|
-
import { z as
|
|
3480
|
+
import { z as z12 } from "zod/v4";
|
|
3430
3481
|
var googleMaps = createProviderToolFactory3({
|
|
3431
3482
|
id: "google.google_maps",
|
|
3432
|
-
inputSchema: lazySchema10(() => zodSchema10(
|
|
3483
|
+
inputSchema: lazySchema10(() => zodSchema10(z12.object({})))
|
|
3433
3484
|
});
|
|
3434
3485
|
|
|
3435
3486
|
// src/tool/google-search.ts
|
|
@@ -3438,15 +3489,15 @@ import {
|
|
|
3438
3489
|
lazySchema as lazySchema11,
|
|
3439
3490
|
zodSchema as zodSchema11
|
|
3440
3491
|
} from "@ai-sdk/provider-utils";
|
|
3441
|
-
import { z as
|
|
3442
|
-
var googleSearchToolArgsBaseSchema = () =>
|
|
3443
|
-
searchTypes:
|
|
3444
|
-
webSearch:
|
|
3445
|
-
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()
|
|
3446
3497
|
}).optional(),
|
|
3447
|
-
timeRangeFilter:
|
|
3448
|
-
startTime:
|
|
3449
|
-
endTime:
|
|
3498
|
+
timeRangeFilter: z13.object({
|
|
3499
|
+
startTime: z13.string(),
|
|
3500
|
+
endTime: z13.string()
|
|
3450
3501
|
}).optional()
|
|
3451
3502
|
}).passthrough();
|
|
3452
3503
|
var googleSearchToolArgsSchema = lazySchema11(
|
|
@@ -3465,20 +3516,20 @@ import {
|
|
|
3465
3516
|
lazySchema as lazySchema12,
|
|
3466
3517
|
zodSchema as zodSchema12
|
|
3467
3518
|
} from "@ai-sdk/provider-utils";
|
|
3468
|
-
import { z as
|
|
3519
|
+
import { z as z14 } from "zod/v4";
|
|
3469
3520
|
var urlContext = createProviderToolFactory5({
|
|
3470
3521
|
id: "google.url_context",
|
|
3471
|
-
inputSchema: lazySchema12(() => zodSchema12(
|
|
3522
|
+
inputSchema: lazySchema12(() => zodSchema12(z14.object({})))
|
|
3472
3523
|
});
|
|
3473
3524
|
|
|
3474
3525
|
// src/tool/vertex-rag-store.ts
|
|
3475
3526
|
import { createProviderToolFactory as createProviderToolFactory6 } from "@ai-sdk/provider-utils";
|
|
3476
|
-
import { z as
|
|
3527
|
+
import { z as z15 } from "zod/v4";
|
|
3477
3528
|
var vertexRagStore = createProviderToolFactory6({
|
|
3478
3529
|
id: "google.vertex_rag_store",
|
|
3479
|
-
inputSchema:
|
|
3480
|
-
ragCorpus:
|
|
3481
|
-
topK:
|
|
3530
|
+
inputSchema: z15.object({
|
|
3531
|
+
ragCorpus: z15.string(),
|
|
3532
|
+
topK: z15.number().optional()
|
|
3482
3533
|
})
|
|
3483
3534
|
});
|
|
3484
3535
|
|
|
@@ -3554,7 +3605,7 @@ import {
|
|
|
3554
3605
|
resolve as resolve4,
|
|
3555
3606
|
zodSchema as zodSchema13
|
|
3556
3607
|
} from "@ai-sdk/provider-utils";
|
|
3557
|
-
import { z as
|
|
3608
|
+
import { z as z16 } from "zod/v4";
|
|
3558
3609
|
var GoogleGenerativeAIImageModel = class {
|
|
3559
3610
|
constructor(modelId, settings, config) {
|
|
3560
3611
|
this.modelId = modelId;
|
|
@@ -3810,11 +3861,11 @@ function isGeminiModel(modelId) {
|
|
|
3810
3861
|
}
|
|
3811
3862
|
var googleImageResponseSchema = lazySchema13(
|
|
3812
3863
|
() => zodSchema13(
|
|
3813
|
-
|
|
3814
|
-
predictions:
|
|
3815
|
-
|
|
3816
|
-
|
|
3817
|
-
|
|
3864
|
+
z16.object({
|
|
3865
|
+
predictions: z16.array(
|
|
3866
|
+
z16.union([
|
|
3867
|
+
z16.object({ bytesBase64Encoded: z16.string() }),
|
|
3868
|
+
z16.object({ raiFilteredReason: z16.string() })
|
|
3818
3869
|
])
|
|
3819
3870
|
).default([])
|
|
3820
3871
|
})
|
|
@@ -3822,9 +3873,9 @@ var googleImageResponseSchema = lazySchema13(
|
|
|
3822
3873
|
);
|
|
3823
3874
|
var googleImageModelOptionsSchema = lazySchema13(
|
|
3824
3875
|
() => zodSchema13(
|
|
3825
|
-
|
|
3826
|
-
personGeneration:
|
|
3827
|
-
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(),
|
|
3828
3879
|
/**
|
|
3829
3880
|
* Enable Google Search grounding for Gemini image models. The value is
|
|
3830
3881
|
* forwarded as the args of the `google.tools.googleSearch` provider
|
|
@@ -3856,7 +3907,7 @@ import {
|
|
|
3856
3907
|
resolve as resolve5,
|
|
3857
3908
|
zodSchema as zodSchema14
|
|
3858
3909
|
} from "@ai-sdk/provider-utils";
|
|
3859
|
-
import { z as
|
|
3910
|
+
import { z as z17 } from "zod/v4";
|
|
3860
3911
|
function getFirstFrameImage(options) {
|
|
3861
3912
|
var _a2, _b;
|
|
3862
3913
|
return (_b = (_a2 = options.frameImages) == null ? void 0 : _a2.find((frame) => frame.frameType === "first_frame")) == null ? void 0 : _b.image;
|
|
@@ -4123,20 +4174,20 @@ var GoogleGenerativeAIVideoModel = class {
|
|
|
4123
4174
|
};
|
|
4124
4175
|
var googleOperationSchema = lazySchema14(
|
|
4125
4176
|
() => zodSchema14(
|
|
4126
|
-
|
|
4127
|
-
name:
|
|
4128
|
-
done:
|
|
4129
|
-
error:
|
|
4130
|
-
code:
|
|
4131
|
-
message:
|
|
4132
|
-
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()
|
|
4133
4184
|
}).nullish(),
|
|
4134
|
-
response:
|
|
4135
|
-
generateVideoResponse:
|
|
4136
|
-
generatedSamples:
|
|
4137
|
-
|
|
4138
|
-
video:
|
|
4139
|
-
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()
|
|
4140
4191
|
}).nullish()
|
|
4141
4192
|
})
|
|
4142
4193
|
).nullish()
|
|
@@ -4147,15 +4198,15 @@ var googleOperationSchema = lazySchema14(
|
|
|
4147
4198
|
);
|
|
4148
4199
|
var googleVideoModelOptionsSchema = lazySchema14(
|
|
4149
4200
|
() => zodSchema14(
|
|
4150
|
-
|
|
4151
|
-
pollIntervalMs:
|
|
4152
|
-
pollTimeoutMs:
|
|
4153
|
-
personGeneration:
|
|
4154
|
-
negativePrompt:
|
|
4155
|
-
referenceImages:
|
|
4156
|
-
|
|
4157
|
-
bytesBase64Encoded:
|
|
4158
|
-
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()
|
|
4159
4210
|
})
|
|
4160
4211
|
).nullish()
|
|
4161
4212
|
}).passthrough()
|
|
@@ -5331,30 +5382,30 @@ import {
|
|
|
5331
5382
|
lazySchema as lazySchema15,
|
|
5332
5383
|
zodSchema as zodSchema15
|
|
5333
5384
|
} from "@ai-sdk/provider-utils";
|
|
5334
|
-
import { z as
|
|
5335
|
-
var tokenByModalitySchema = () =>
|
|
5336
|
-
modality:
|
|
5337
|
-
tokens:
|
|
5385
|
+
import { z as z18 } from "zod/v4";
|
|
5386
|
+
var tokenByModalitySchema = () => z18.object({
|
|
5387
|
+
modality: z18.string().nullish(),
|
|
5388
|
+
tokens: z18.number().nullish()
|
|
5338
5389
|
}).loose();
|
|
5339
|
-
var usageSchema2 = () =>
|
|
5340
|
-
total_input_tokens:
|
|
5341
|
-
total_output_tokens:
|
|
5342
|
-
total_thought_tokens:
|
|
5343
|
-
total_cached_tokens:
|
|
5344
|
-
total_tool_use_tokens:
|
|
5345
|
-
total_tokens:
|
|
5346
|
-
input_tokens_by_modality:
|
|
5347
|
-
output_tokens_by_modality:
|
|
5348
|
-
cached_tokens_by_modality:
|
|
5349
|
-
tool_use_tokens_by_modality:
|
|
5350
|
-
grounding_tool_count:
|
|
5351
|
-
|
|
5352
|
-
type:
|
|
5353
|
-
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()
|
|
5354
5405
|
}).loose()
|
|
5355
5406
|
).nullish()
|
|
5356
5407
|
}).loose();
|
|
5357
|
-
var interactionStatusSchema = () =>
|
|
5408
|
+
var interactionStatusSchema = () => z18.enum([
|
|
5358
5409
|
"in_progress",
|
|
5359
5410
|
"requires_action",
|
|
5360
5411
|
"completed",
|
|
@@ -5363,69 +5414,69 @@ var interactionStatusSchema = () => z17.enum([
|
|
|
5363
5414
|
"incomplete"
|
|
5364
5415
|
]);
|
|
5365
5416
|
var annotationSchema = () => {
|
|
5366
|
-
const urlCitation =
|
|
5367
|
-
type:
|
|
5368
|
-
url:
|
|
5369
|
-
title:
|
|
5370
|
-
start_index:
|
|
5371
|
-
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()
|
|
5372
5423
|
}).loose();
|
|
5373
|
-
const fileCitation =
|
|
5374
|
-
type:
|
|
5375
|
-
file_name:
|
|
5376
|
-
document_uri:
|
|
5377
|
-
url:
|
|
5378
|
-
page_number:
|
|
5379
|
-
media_id:
|
|
5380
|
-
start_index:
|
|
5381
|
-
end_index:
|
|
5382
|
-
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()
|
|
5383
5434
|
}).loose();
|
|
5384
|
-
const placeCitation =
|
|
5385
|
-
type:
|
|
5386
|
-
name:
|
|
5387
|
-
url:
|
|
5388
|
-
place_id:
|
|
5389
|
-
start_index:
|
|
5390
|
-
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()
|
|
5391
5442
|
}).loose();
|
|
5392
|
-
return
|
|
5443
|
+
return z18.union([
|
|
5393
5444
|
urlCitation,
|
|
5394
5445
|
fileCitation,
|
|
5395
5446
|
placeCitation,
|
|
5396
|
-
|
|
5447
|
+
z18.object({ type: z18.string() }).loose()
|
|
5397
5448
|
]);
|
|
5398
5449
|
};
|
|
5399
|
-
var thoughtSummaryItemSchema = () =>
|
|
5400
|
-
type:
|
|
5401
|
-
text:
|
|
5402
|
-
data:
|
|
5403
|
-
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()
|
|
5404
5455
|
}).loose();
|
|
5405
5456
|
var contentBlockSchema = () => {
|
|
5406
|
-
const textContent =
|
|
5407
|
-
type:
|
|
5408
|
-
text:
|
|
5409
|
-
annotations:
|
|
5457
|
+
const textContent = z18.object({
|
|
5458
|
+
type: z18.literal("text"),
|
|
5459
|
+
text: z18.string(),
|
|
5460
|
+
annotations: z18.array(annotationSchema()).nullish()
|
|
5410
5461
|
}).loose();
|
|
5411
|
-
const imageContent =
|
|
5412
|
-
type:
|
|
5413
|
-
data:
|
|
5414
|
-
mime_type:
|
|
5415
|
-
resolution:
|
|
5416
|
-
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()
|
|
5417
5468
|
}).loose();
|
|
5418
|
-
const videoContent =
|
|
5419
|
-
type:
|
|
5420
|
-
data:
|
|
5421
|
-
mime_type:
|
|
5422
|
-
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()
|
|
5423
5474
|
}).loose();
|
|
5424
|
-
return
|
|
5475
|
+
return z18.union([
|
|
5425
5476
|
textContent,
|
|
5426
5477
|
imageContent,
|
|
5427
5478
|
videoContent,
|
|
5428
|
-
|
|
5479
|
+
z18.object({ type: z18.string() }).loose()
|
|
5429
5480
|
]);
|
|
5430
5481
|
};
|
|
5431
5482
|
var BUILTIN_TOOL_CALL_STEP_TYPES = [
|
|
@@ -5445,73 +5496,73 @@ var BUILTIN_TOOL_RESULT_STEP_TYPES = [
|
|
|
5445
5496
|
"mcp_server_tool_result"
|
|
5446
5497
|
];
|
|
5447
5498
|
var stepSchema = () => {
|
|
5448
|
-
const userInputStep =
|
|
5449
|
-
type:
|
|
5450
|
-
content:
|
|
5499
|
+
const userInputStep = z18.object({
|
|
5500
|
+
type: z18.literal("user_input"),
|
|
5501
|
+
content: z18.array(contentBlockSchema()).nullish()
|
|
5451
5502
|
}).loose();
|
|
5452
|
-
const modelOutputStep =
|
|
5453
|
-
type:
|
|
5454
|
-
content:
|
|
5503
|
+
const modelOutputStep = z18.object({
|
|
5504
|
+
type: z18.literal("model_output"),
|
|
5505
|
+
content: z18.array(contentBlockSchema()).nullish()
|
|
5455
5506
|
}).loose();
|
|
5456
|
-
const functionCallStep =
|
|
5457
|
-
type:
|
|
5458
|
-
id:
|
|
5459
|
-
name:
|
|
5460
|
-
arguments:
|
|
5461
|
-
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()
|
|
5462
5513
|
}).loose();
|
|
5463
|
-
const thoughtStep =
|
|
5464
|
-
type:
|
|
5465
|
-
signature:
|
|
5466
|
-
summary:
|
|
5514
|
+
const thoughtStep = z18.object({
|
|
5515
|
+
type: z18.literal("thought"),
|
|
5516
|
+
signature: z18.string().nullish(),
|
|
5517
|
+
summary: z18.array(thoughtSummaryItemSchema()).nullish()
|
|
5467
5518
|
}).loose();
|
|
5468
|
-
const builtinToolCallStep =
|
|
5469
|
-
type:
|
|
5470
|
-
id:
|
|
5471
|
-
arguments:
|
|
5472
|
-
name:
|
|
5473
|
-
server_name:
|
|
5474
|
-
search_type:
|
|
5475
|
-
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()
|
|
5476
5527
|
}).loose();
|
|
5477
|
-
const builtinToolResultStep =
|
|
5478
|
-
type:
|
|
5479
|
-
call_id:
|
|
5480
|
-
result:
|
|
5481
|
-
is_error:
|
|
5482
|
-
name:
|
|
5483
|
-
server_name:
|
|
5484
|
-
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()
|
|
5485
5536
|
}).loose();
|
|
5486
|
-
return
|
|
5537
|
+
return z18.union([
|
|
5487
5538
|
userInputStep,
|
|
5488
5539
|
modelOutputStep,
|
|
5489
5540
|
functionCallStep,
|
|
5490
5541
|
thoughtStep,
|
|
5491
5542
|
builtinToolCallStep,
|
|
5492
5543
|
builtinToolResultStep,
|
|
5493
|
-
|
|
5544
|
+
z18.object({ type: z18.string() }).loose()
|
|
5494
5545
|
]);
|
|
5495
5546
|
};
|
|
5496
5547
|
var googleInteractionsResponseSchema = lazySchema15(
|
|
5497
5548
|
() => zodSchema15(
|
|
5498
|
-
|
|
5549
|
+
z18.object({
|
|
5499
5550
|
/*
|
|
5500
5551
|
* `id` is omitted from the response body when `store: false` (fully
|
|
5501
5552
|
* stateless mode) — there is no server-side interaction record for the
|
|
5502
5553
|
* client to reference. `nullish` lets the schema accept that shape.
|
|
5503
5554
|
*/
|
|
5504
|
-
id:
|
|
5505
|
-
created:
|
|
5506
|
-
updated:
|
|
5555
|
+
id: z18.string().nullish(),
|
|
5556
|
+
created: z18.string().nullish(),
|
|
5557
|
+
updated: z18.string().nullish(),
|
|
5507
5558
|
status: interactionStatusSchema(),
|
|
5508
|
-
model:
|
|
5509
|
-
agent:
|
|
5510
|
-
steps:
|
|
5559
|
+
model: z18.string().nullish(),
|
|
5560
|
+
agent: z18.string().nullish(),
|
|
5561
|
+
steps: z18.array(stepSchema()).nullish(),
|
|
5511
5562
|
usage: usageSchema2().nullish(),
|
|
5512
|
-
service_tier:
|
|
5513
|
-
previous_interaction_id:
|
|
5514
|
-
response_modalities:
|
|
5563
|
+
service_tier: z18.string().nullish(),
|
|
5564
|
+
previous_interaction_id: z18.string().nullish(),
|
|
5565
|
+
response_modalities: z18.array(z18.string()).nullish()
|
|
5515
5566
|
}).loose()
|
|
5516
5567
|
)
|
|
5517
5568
|
);
|
|
@@ -5521,82 +5572,82 @@ var googleInteractionsEventSchema = lazySchema15(
|
|
|
5521
5572
|
const status = interactionStatusSchema();
|
|
5522
5573
|
const annotation = annotationSchema();
|
|
5523
5574
|
const thoughtSummaryItem = thoughtSummaryItemSchema();
|
|
5524
|
-
const interactionCreatedEvent =
|
|
5525
|
-
event_type:
|
|
5526
|
-
event_id:
|
|
5527
|
-
interaction:
|
|
5575
|
+
const interactionCreatedEvent = z18.object({
|
|
5576
|
+
event_type: z18.literal("interaction.created"),
|
|
5577
|
+
event_id: z18.string().nullish(),
|
|
5578
|
+
interaction: z18.object({
|
|
5528
5579
|
/*
|
|
5529
5580
|
* `id` is omitted when `store: false` (fully stateless mode);
|
|
5530
5581
|
* see the matching note on `googleInteractionsResponseSchema.id`.
|
|
5531
5582
|
*/
|
|
5532
|
-
id:
|
|
5533
|
-
created:
|
|
5534
|
-
model:
|
|
5535
|
-
agent:
|
|
5583
|
+
id: z18.string().nullish(),
|
|
5584
|
+
created: z18.string().nullish(),
|
|
5585
|
+
model: z18.string().nullish(),
|
|
5586
|
+
agent: z18.string().nullish(),
|
|
5536
5587
|
status: status.nullish()
|
|
5537
5588
|
}).loose()
|
|
5538
5589
|
}).loose();
|
|
5539
|
-
const stepStartEvent =
|
|
5540
|
-
event_type:
|
|
5541
|
-
event_id:
|
|
5542
|
-
index:
|
|
5590
|
+
const stepStartEvent = z18.object({
|
|
5591
|
+
event_type: z18.literal("step.start"),
|
|
5592
|
+
event_id: z18.string().nullish(),
|
|
5593
|
+
index: z18.number(),
|
|
5543
5594
|
step: stepSchema()
|
|
5544
5595
|
}).loose();
|
|
5545
|
-
const stepDeltaText =
|
|
5546
|
-
type:
|
|
5547
|
-
text:
|
|
5596
|
+
const stepDeltaText = z18.object({
|
|
5597
|
+
type: z18.literal("text"),
|
|
5598
|
+
text: z18.string()
|
|
5548
5599
|
}).loose();
|
|
5549
|
-
const stepDeltaThoughtSummary =
|
|
5550
|
-
type:
|
|
5600
|
+
const stepDeltaThoughtSummary = z18.object({
|
|
5601
|
+
type: z18.literal("thought_summary"),
|
|
5551
5602
|
content: thoughtSummaryItem.nullish()
|
|
5552
5603
|
}).loose();
|
|
5553
|
-
const stepDeltaThoughtSignature =
|
|
5554
|
-
type:
|
|
5555
|
-
signature:
|
|
5604
|
+
const stepDeltaThoughtSignature = z18.object({
|
|
5605
|
+
type: z18.literal("thought_signature"),
|
|
5606
|
+
signature: z18.string().nullish()
|
|
5556
5607
|
}).loose();
|
|
5557
|
-
const stepDeltaArgumentsDelta =
|
|
5558
|
-
type:
|
|
5559
|
-
arguments:
|
|
5560
|
-
id:
|
|
5561
|
-
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()
|
|
5562
5613
|
}).loose();
|
|
5563
|
-
const stepDeltaTextAnnotation =
|
|
5564
|
-
type:
|
|
5565
|
-
annotations:
|
|
5614
|
+
const stepDeltaTextAnnotation = z18.object({
|
|
5615
|
+
type: z18.enum(["text_annotation_delta", "text_annotation"]),
|
|
5616
|
+
annotations: z18.array(annotation).nullish()
|
|
5566
5617
|
}).loose();
|
|
5567
|
-
const stepDeltaImage =
|
|
5568
|
-
type:
|
|
5569
|
-
data:
|
|
5570
|
-
mime_type:
|
|
5571
|
-
resolution:
|
|
5572
|
-
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()
|
|
5573
5624
|
}).loose();
|
|
5574
|
-
const stepDeltaVideo =
|
|
5575
|
-
type:
|
|
5576
|
-
data:
|
|
5577
|
-
mime_type:
|
|
5578
|
-
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()
|
|
5579
5630
|
}).loose();
|
|
5580
|
-
const stepDeltaBuiltinToolCall =
|
|
5581
|
-
type:
|
|
5582
|
-
id:
|
|
5583
|
-
arguments:
|
|
5584
|
-
name:
|
|
5585
|
-
server_name:
|
|
5586
|
-
search_type:
|
|
5587
|
-
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()
|
|
5588
5639
|
}).loose();
|
|
5589
|
-
const stepDeltaBuiltinToolResult =
|
|
5590
|
-
type:
|
|
5591
|
-
call_id:
|
|
5592
|
-
result:
|
|
5593
|
-
is_error:
|
|
5594
|
-
name:
|
|
5595
|
-
server_name:
|
|
5596
|
-
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()
|
|
5597
5648
|
}).loose();
|
|
5598
|
-
const stepDeltaUnknown =
|
|
5599
|
-
const stepDeltaUnion =
|
|
5649
|
+
const stepDeltaUnknown = z18.object({ type: z18.string() }).loose();
|
|
5650
|
+
const stepDeltaUnion = z18.union([
|
|
5600
5651
|
stepDeltaText,
|
|
5601
5652
|
stepDeltaImage,
|
|
5602
5653
|
stepDeltaVideo,
|
|
@@ -5608,55 +5659,55 @@ var googleInteractionsEventSchema = lazySchema15(
|
|
|
5608
5659
|
stepDeltaBuiltinToolResult,
|
|
5609
5660
|
stepDeltaUnknown
|
|
5610
5661
|
]);
|
|
5611
|
-
const stepDeltaEvent =
|
|
5612
|
-
event_type:
|
|
5613
|
-
event_id:
|
|
5614
|
-
index:
|
|
5662
|
+
const stepDeltaEvent = z18.object({
|
|
5663
|
+
event_type: z18.literal("step.delta"),
|
|
5664
|
+
event_id: z18.string().nullish(),
|
|
5665
|
+
index: z18.number(),
|
|
5615
5666
|
delta: stepDeltaUnion
|
|
5616
5667
|
}).loose();
|
|
5617
|
-
const stepStopEvent =
|
|
5618
|
-
event_type:
|
|
5619
|
-
event_id:
|
|
5620
|
-
index:
|
|
5668
|
+
const stepStopEvent = z18.object({
|
|
5669
|
+
event_type: z18.literal("step.stop"),
|
|
5670
|
+
event_id: z18.string().nullish(),
|
|
5671
|
+
index: z18.number()
|
|
5621
5672
|
}).loose();
|
|
5622
|
-
const interactionStatusUpdateEvent =
|
|
5623
|
-
event_type:
|
|
5624
|
-
event_id:
|
|
5625
|
-
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(),
|
|
5626
5677
|
status: status.nullish()
|
|
5627
5678
|
}).loose();
|
|
5628
|
-
const interactionInProgressEvent =
|
|
5629
|
-
event_type:
|
|
5630
|
-
event_id:
|
|
5631
|
-
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(),
|
|
5632
5683
|
status: status.nullish()
|
|
5633
5684
|
}).loose();
|
|
5634
|
-
const interactionRequiresActionEvent =
|
|
5635
|
-
event_type:
|
|
5636
|
-
event_id:
|
|
5637
|
-
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(),
|
|
5638
5689
|
status: status.nullish()
|
|
5639
5690
|
}).loose();
|
|
5640
|
-
const interactionCompletedEvent =
|
|
5641
|
-
event_type:
|
|
5642
|
-
event_id:
|
|
5643
|
-
interaction:
|
|
5644
|
-
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(),
|
|
5645
5696
|
status: status.nullish(),
|
|
5646
5697
|
usage: usageSchema2().nullish(),
|
|
5647
|
-
service_tier:
|
|
5698
|
+
service_tier: z18.string().nullish()
|
|
5648
5699
|
}).loose()
|
|
5649
5700
|
}).loose();
|
|
5650
|
-
const errorEvent =
|
|
5651
|
-
event_type:
|
|
5652
|
-
event_id:
|
|
5653
|
-
error:
|
|
5654
|
-
code:
|
|
5655
|
-
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()
|
|
5656
5707
|
}).loose().nullish()
|
|
5657
5708
|
}).loose();
|
|
5658
|
-
const unknownEvent =
|
|
5659
|
-
return
|
|
5709
|
+
const unknownEvent = z18.object({ event_type: z18.string() }).loose();
|
|
5710
|
+
return z18.union([
|
|
5660
5711
|
interactionCreatedEvent,
|
|
5661
5712
|
stepStartEvent,
|
|
5662
5713
|
stepDeltaEvent,
|
|
@@ -5677,26 +5728,26 @@ import {
|
|
|
5677
5728
|
lazySchema as lazySchema16,
|
|
5678
5729
|
zodSchema as zodSchema16
|
|
5679
5730
|
} from "@ai-sdk/provider-utils";
|
|
5680
|
-
import { z as
|
|
5731
|
+
import { z as z19 } from "zod/v4";
|
|
5681
5732
|
var googleInteractionsLanguageModelOptions = lazySchema16(
|
|
5682
5733
|
() => zodSchema16(
|
|
5683
|
-
|
|
5684
|
-
previousInteractionId:
|
|
5685
|
-
store:
|
|
5686
|
-
agent:
|
|
5687
|
-
agentConfig:
|
|
5688
|
-
|
|
5689
|
-
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")
|
|
5690
5741
|
}).loose(),
|
|
5691
|
-
|
|
5692
|
-
type:
|
|
5693
|
-
thinkingSummaries:
|
|
5694
|
-
visualization:
|
|
5695
|
-
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()
|
|
5696
5747
|
})
|
|
5697
5748
|
]).nullish(),
|
|
5698
|
-
thinkingLevel:
|
|
5699
|
-
thinkingSummaries:
|
|
5749
|
+
thinkingLevel: z19.enum(["minimal", "low", "medium", "high"]).nullish(),
|
|
5750
|
+
thinkingSummaries: z19.enum(["auto", "none"]).nullish(),
|
|
5700
5751
|
/**
|
|
5701
5752
|
* Output-format entries that map directly to the API's `response_format`
|
|
5702
5753
|
* array. Use this to request image, audio, video, or non-JSON text
|
|
@@ -5706,17 +5757,17 @@ var googleInteractionsLanguageModelOptions = lazySchema16(
|
|
|
5706
5757
|
* type: 'json', schema }` still drives JSON-mode and adds a matching
|
|
5707
5758
|
* text entry automatically; entries listed here are appended.
|
|
5708
5759
|
*/
|
|
5709
|
-
responseFormat:
|
|
5710
|
-
|
|
5711
|
-
|
|
5712
|
-
type:
|
|
5713
|
-
mimeType:
|
|
5714
|
-
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()
|
|
5715
5766
|
}).loose(),
|
|
5716
|
-
|
|
5717
|
-
type:
|
|
5718
|
-
mimeType:
|
|
5719
|
-
aspectRatio:
|
|
5767
|
+
z19.object({
|
|
5768
|
+
type: z19.literal("image"),
|
|
5769
|
+
mimeType: z19.string().nullish(),
|
|
5770
|
+
aspectRatio: z19.enum([
|
|
5720
5771
|
"1:1",
|
|
5721
5772
|
"2:3",
|
|
5722
5773
|
"3:2",
|
|
@@ -5732,19 +5783,19 @@ var googleInteractionsLanguageModelOptions = lazySchema16(
|
|
|
5732
5783
|
"1:4",
|
|
5733
5784
|
"4:1"
|
|
5734
5785
|
]).nullish(),
|
|
5735
|
-
imageSize:
|
|
5786
|
+
imageSize: z19.enum(["1K", "2K", "4K", "512"]).nullish()
|
|
5736
5787
|
}).loose(),
|
|
5737
|
-
|
|
5738
|
-
type:
|
|
5739
|
-
mimeType:
|
|
5788
|
+
z19.object({
|
|
5789
|
+
type: z19.literal("audio"),
|
|
5790
|
+
mimeType: z19.string().nullish()
|
|
5740
5791
|
}).loose(),
|
|
5741
|
-
|
|
5742
|
-
type:
|
|
5743
|
-
aspectRatio:
|
|
5744
|
-
resolution:
|
|
5745
|
-
duration:
|
|
5746
|
-
delivery:
|
|
5747
|
-
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()
|
|
5748
5799
|
}).loose()
|
|
5749
5800
|
])
|
|
5750
5801
|
).nullish(),
|
|
@@ -5754,8 +5805,8 @@ var googleInteractionsLanguageModelOptions = lazySchema16(
|
|
|
5754
5805
|
* translates it into a matching `response_format` image entry and
|
|
5755
5806
|
* emits a warning when set.
|
|
5756
5807
|
*/
|
|
5757
|
-
imageConfig:
|
|
5758
|
-
aspectRatio:
|
|
5808
|
+
imageConfig: z19.object({
|
|
5809
|
+
aspectRatio: z19.enum([
|
|
5759
5810
|
"1:1",
|
|
5760
5811
|
"2:3",
|
|
5761
5812
|
"3:2",
|
|
@@ -5771,35 +5822,35 @@ var googleInteractionsLanguageModelOptions = lazySchema16(
|
|
|
5771
5822
|
"1:4",
|
|
5772
5823
|
"4:1"
|
|
5773
5824
|
]).nullish(),
|
|
5774
|
-
imageSize:
|
|
5825
|
+
imageSize: z19.enum(["1K", "2K", "4K", "512"]).nullish()
|
|
5775
5826
|
}).nullish(),
|
|
5776
|
-
mediaResolution:
|
|
5777
|
-
responseModalities:
|
|
5778
|
-
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(),
|
|
5779
5830
|
/**
|
|
5780
5831
|
* Alternative to AI SDK `system` message. If both are set, the AI SDK
|
|
5781
5832
|
* `system` message wins and a warning is emitted.
|
|
5782
5833
|
*/
|
|
5783
|
-
systemInstruction:
|
|
5834
|
+
systemInstruction: z19.string().nullish(),
|
|
5784
5835
|
/**
|
|
5785
5836
|
* Per-block signature for round-tripping `thought.signature` and
|
|
5786
5837
|
* `function_call.signature` blocks. Set by the SDK on output reasoning /
|
|
5787
5838
|
* tool-call parts; passed back unchanged on input parts so the API
|
|
5788
5839
|
* accepts the prior turn.
|
|
5789
5840
|
*/
|
|
5790
|
-
signature:
|
|
5841
|
+
signature: z19.string().nullish(),
|
|
5791
5842
|
/**
|
|
5792
5843
|
* Set by the SDK on output assistant messages. The converter uses it to
|
|
5793
5844
|
* decide which messages to drop when compacting under
|
|
5794
5845
|
* `previousInteractionId`.
|
|
5795
5846
|
*/
|
|
5796
|
-
interactionId:
|
|
5847
|
+
interactionId: z19.string().nullish(),
|
|
5797
5848
|
/**
|
|
5798
5849
|
* Maximum time, in milliseconds, to poll a background interaction (agent
|
|
5799
5850
|
* call) before giving up. Defaults to 30 minutes. Long-running agents
|
|
5800
5851
|
* such as deep research can take tens of minutes — increase if needed.
|
|
5801
5852
|
*/
|
|
5802
|
-
pollingTimeoutMs:
|
|
5853
|
+
pollingTimeoutMs: z19.number().int().positive().nullish(),
|
|
5803
5854
|
/**
|
|
5804
5855
|
* Run the interaction in the background. Required for agents whose
|
|
5805
5856
|
* server-side workflow cannot complete within a single request/response.
|
|
@@ -5808,7 +5859,7 @@ var googleInteractionsLanguageModelOptions = lazySchema16(
|
|
|
5808
5859
|
* reject `true`; see the agent's documentation for which mode it
|
|
5809
5860
|
* requires.
|
|
5810
5861
|
*/
|
|
5811
|
-
background:
|
|
5862
|
+
background: z19.boolean().nullish(),
|
|
5812
5863
|
/**
|
|
5813
5864
|
* Environment configuration for the agent sandbox. Only applies to agent
|
|
5814
5865
|
* calls (`google.interactions({ agent })`); ignored on model-id calls.
|
|
@@ -5818,36 +5869,36 @@ var googleInteractionsLanguageModelOptions = lazySchema16(
|
|
|
5818
5869
|
* - object: provision a fresh sandbox and optionally preload `sources`
|
|
5819
5870
|
* and/or constrain outbound traffic via `network`.
|
|
5820
5871
|
*/
|
|
5821
|
-
environment:
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
type:
|
|
5825
|
-
sources:
|
|
5826
|
-
|
|
5827
|
-
|
|
5828
|
-
type:
|
|
5829
|
-
source:
|
|
5830
|
-
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()
|
|
5831
5882
|
}),
|
|
5832
|
-
|
|
5833
|
-
type:
|
|
5834
|
-
source:
|
|
5835
|
-
target:
|
|
5883
|
+
z19.object({
|
|
5884
|
+
type: z19.literal("repository"),
|
|
5885
|
+
source: z19.string(),
|
|
5886
|
+
target: z19.string().nullish()
|
|
5836
5887
|
}),
|
|
5837
|
-
|
|
5838
|
-
type:
|
|
5839
|
-
content:
|
|
5840
|
-
target:
|
|
5888
|
+
z19.object({
|
|
5889
|
+
type: z19.literal("inline"),
|
|
5890
|
+
content: z19.string(),
|
|
5891
|
+
target: z19.string()
|
|
5841
5892
|
})
|
|
5842
5893
|
])
|
|
5843
5894
|
).nullish(),
|
|
5844
|
-
network:
|
|
5845
|
-
|
|
5846
|
-
|
|
5847
|
-
allowlist:
|
|
5848
|
-
|
|
5849
|
-
domain:
|
|
5850
|
-
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()
|
|
5851
5902
|
})
|
|
5852
5903
|
)
|
|
5853
5904
|
})
|