@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/internal/index.js
CHANGED
|
@@ -30,7 +30,7 @@ module.exports = __toCommonJS(index_exports);
|
|
|
30
30
|
|
|
31
31
|
// src/google-generative-ai-language-model.ts
|
|
32
32
|
var import_provider_utils5 = require("@ai-sdk/provider-utils");
|
|
33
|
-
var
|
|
33
|
+
var import_v44 = require("zod/v4");
|
|
34
34
|
|
|
35
35
|
// src/continue-google-stream.ts
|
|
36
36
|
function continueGoogleStream({
|
|
@@ -453,6 +453,19 @@ function isEmptyObjectSchema(jsonSchema) {
|
|
|
453
453
|
// src/convert-to-google-generative-ai-messages.ts
|
|
454
454
|
var import_provider2 = require("@ai-sdk/provider");
|
|
455
455
|
var import_provider_utils = require("@ai-sdk/provider-utils");
|
|
456
|
+
|
|
457
|
+
// src/google-generative-ai-prompt.ts
|
|
458
|
+
var import_v4 = require("zod/v4");
|
|
459
|
+
var googleVideoMetadataSchema = import_v4.z.object({
|
|
460
|
+
/** Start offset as a duration in seconds, e.g. `'3.5s'`. */
|
|
461
|
+
startOffset: import_v4.z.string().optional(),
|
|
462
|
+
/** End offset as a duration in seconds, e.g. `'10s'`. */
|
|
463
|
+
endOffset: import_v4.z.string().optional(),
|
|
464
|
+
/** Frames per second in the range (0, 24]. Defaults to 1. */
|
|
465
|
+
fps: import_v4.z.number().gt(0).max(24).optional()
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
// src/convert-to-google-generative-ai-messages.ts
|
|
456
469
|
var SKIP_THOUGHT_SIGNATURE_VALIDATOR = "skip_thought_signature_validator";
|
|
457
470
|
function getGoogleProviderOptions(providerOptions, providerOptionsName) {
|
|
458
471
|
const namespaces = [
|
|
@@ -591,7 +604,7 @@ function appendLegacyToolResultParts(parts, toolName, outputValue, toolCallId, i
|
|
|
591
604
|
}
|
|
592
605
|
}
|
|
593
606
|
function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
594
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
607
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
595
608
|
const systemInstructionParts = [];
|
|
596
609
|
const contents = [];
|
|
597
610
|
let systemMessagesAllowed = true;
|
|
@@ -631,17 +644,24 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
|
631
644
|
}
|
|
632
645
|
case "file": {
|
|
633
646
|
const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType;
|
|
647
|
+
const rawVideoMetadata = (_g = getGoogleProviderOptions(
|
|
648
|
+
part.providerOptions,
|
|
649
|
+
providerOptionsName
|
|
650
|
+
)) == null ? void 0 : _g.videoMetadata;
|
|
651
|
+
const videoMetadata = rawVideoMetadata == null ? void 0 : googleVideoMetadataSchema.parse(rawVideoMetadata);
|
|
634
652
|
parts.push(
|
|
635
653
|
part.data instanceof URL ? {
|
|
636
654
|
fileData: {
|
|
637
655
|
mimeType: mediaType,
|
|
638
656
|
fileUri: part.data.protocol === "gs:" && part.originalUrl != null ? part.originalUrl : part.data.toString()
|
|
639
|
-
}
|
|
657
|
+
},
|
|
658
|
+
...videoMetadata != null ? { videoMetadata } : {}
|
|
640
659
|
} : {
|
|
641
660
|
inlineData: {
|
|
642
661
|
mimeType: mediaType,
|
|
643
662
|
data: (0, import_provider_utils.convertToBase64)(part.data)
|
|
644
|
-
}
|
|
663
|
+
},
|
|
664
|
+
...videoMetadata != null ? { videoMetadata } : {}
|
|
645
665
|
}
|
|
646
666
|
);
|
|
647
667
|
break;
|
|
@@ -802,7 +822,7 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
|
802
822
|
name: part.toolName,
|
|
803
823
|
response: {
|
|
804
824
|
name: part.toolName,
|
|
805
|
-
content: output.type === "execution-denied" ? (
|
|
825
|
+
content: output.type === "execution-denied" ? (_h = output.reason) != null ? _h : "Tool call execution denied." : output.value
|
|
806
826
|
}
|
|
807
827
|
}
|
|
808
828
|
});
|
|
@@ -906,15 +926,15 @@ function getModelPath(modelId) {
|
|
|
906
926
|
|
|
907
927
|
// src/google-error.ts
|
|
908
928
|
var import_provider_utils3 = require("@ai-sdk/provider-utils");
|
|
909
|
-
var
|
|
929
|
+
var import_v42 = require("zod/v4");
|
|
910
930
|
var googleErrorDataSchema = (0, import_provider_utils3.lazySchema)(
|
|
911
931
|
() => (0, import_provider_utils3.zodSchema)(
|
|
912
|
-
|
|
913
|
-
error:
|
|
914
|
-
code:
|
|
915
|
-
message:
|
|
916
|
-
status:
|
|
917
|
-
details:
|
|
932
|
+
import_v42.z.object({
|
|
933
|
+
error: import_v42.z.object({
|
|
934
|
+
code: import_v42.z.number().nullable(),
|
|
935
|
+
message: import_v42.z.string(),
|
|
936
|
+
status: import_v42.z.string(),
|
|
937
|
+
details: import_v42.z.array(import_v42.z.unknown()).nullish()
|
|
918
938
|
})
|
|
919
939
|
})
|
|
920
940
|
)
|
|
@@ -926,23 +946,23 @@ var googleFailedResponseHandler = (0, import_provider_utils3.createJsonErrorResp
|
|
|
926
946
|
|
|
927
947
|
// src/google-generative-ai-options.ts
|
|
928
948
|
var import_provider_utils4 = require("@ai-sdk/provider-utils");
|
|
929
|
-
var
|
|
949
|
+
var import_v43 = require("zod/v4");
|
|
930
950
|
var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
|
|
931
951
|
() => (0, import_provider_utils4.zodSchema)(
|
|
932
|
-
|
|
933
|
-
responseModalities:
|
|
934
|
-
thinkingConfig:
|
|
935
|
-
thinkingBudget:
|
|
936
|
-
includeThoughts:
|
|
952
|
+
import_v43.z.object({
|
|
953
|
+
responseModalities: import_v43.z.array(import_v43.z.enum(["TEXT", "IMAGE"])).optional(),
|
|
954
|
+
thinkingConfig: import_v43.z.object({
|
|
955
|
+
thinkingBudget: import_v43.z.number().optional(),
|
|
956
|
+
includeThoughts: import_v43.z.boolean().optional(),
|
|
937
957
|
// https://ai.google.dev/gemini-api/docs/gemini-3?thinking=high#thinking_level
|
|
938
|
-
thinkingLevel:
|
|
958
|
+
thinkingLevel: import_v43.z.enum(["minimal", "low", "medium", "high"]).optional()
|
|
939
959
|
}).optional(),
|
|
940
960
|
/**
|
|
941
961
|
* Optional.
|
|
942
962
|
* The name of the cached content used as context to serve the prediction.
|
|
943
963
|
* Format: cachedContents/{cachedContent}
|
|
944
964
|
*/
|
|
945
|
-
cachedContent:
|
|
965
|
+
cachedContent: import_v43.z.string().optional(),
|
|
946
966
|
/**
|
|
947
967
|
* Optional. Enable structured output. Default is true.
|
|
948
968
|
*
|
|
@@ -951,13 +971,13 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
|
|
|
951
971
|
* Google Generative AI uses. You can use this to disable
|
|
952
972
|
* structured outputs if you need to.
|
|
953
973
|
*/
|
|
954
|
-
structuredOutputs:
|
|
974
|
+
structuredOutputs: import_v43.z.boolean().optional(),
|
|
955
975
|
/**
|
|
956
976
|
* Optional. A list of unique safety settings for blocking unsafe content.
|
|
957
977
|
*/
|
|
958
|
-
safetySettings:
|
|
959
|
-
|
|
960
|
-
category:
|
|
978
|
+
safetySettings: import_v43.z.array(
|
|
979
|
+
import_v43.z.object({
|
|
980
|
+
category: import_v43.z.enum([
|
|
961
981
|
"HARM_CATEGORY_UNSPECIFIED",
|
|
962
982
|
"HARM_CATEGORY_HATE_SPEECH",
|
|
963
983
|
"HARM_CATEGORY_DANGEROUS_CONTENT",
|
|
@@ -965,7 +985,7 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
|
|
|
965
985
|
"HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
|
966
986
|
"HARM_CATEGORY_CIVIC_INTEGRITY"
|
|
967
987
|
]),
|
|
968
|
-
threshold:
|
|
988
|
+
threshold: import_v43.z.enum([
|
|
969
989
|
"HARM_BLOCK_THRESHOLD_UNSPECIFIED",
|
|
970
990
|
"BLOCK_LOW_AND_ABOVE",
|
|
971
991
|
"BLOCK_MEDIUM_AND_ABOVE",
|
|
@@ -975,7 +995,7 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
|
|
|
975
995
|
])
|
|
976
996
|
})
|
|
977
997
|
).optional(),
|
|
978
|
-
threshold:
|
|
998
|
+
threshold: import_v43.z.enum([
|
|
979
999
|
"HARM_BLOCK_THRESHOLD_UNSPECIFIED",
|
|
980
1000
|
"BLOCK_LOW_AND_ABOVE",
|
|
981
1001
|
"BLOCK_MEDIUM_AND_ABOVE",
|
|
@@ -988,19 +1008,19 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
|
|
|
988
1008
|
*
|
|
989
1009
|
* https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
|
|
990
1010
|
*/
|
|
991
|
-
audioTimestamp:
|
|
1011
|
+
audioTimestamp: import_v43.z.boolean().optional(),
|
|
992
1012
|
/**
|
|
993
1013
|
* Optional. Defines labels used in billing reports. Available on Vertex AI only.
|
|
994
1014
|
*
|
|
995
1015
|
* https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls
|
|
996
1016
|
*/
|
|
997
|
-
labels:
|
|
1017
|
+
labels: import_v43.z.record(import_v43.z.string(), import_v43.z.string()).optional(),
|
|
998
1018
|
/**
|
|
999
1019
|
* Optional. If specified, the media resolution specified will be used.
|
|
1000
1020
|
*
|
|
1001
1021
|
* https://ai.google.dev/api/generate-content#MediaResolution
|
|
1002
1022
|
*/
|
|
1003
|
-
mediaResolution:
|
|
1023
|
+
mediaResolution: import_v43.z.enum([
|
|
1004
1024
|
"MEDIA_RESOLUTION_UNSPECIFIED",
|
|
1005
1025
|
"MEDIA_RESOLUTION_LOW",
|
|
1006
1026
|
"MEDIA_RESOLUTION_MEDIUM",
|
|
@@ -1011,8 +1031,8 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
|
|
|
1011
1031
|
*
|
|
1012
1032
|
* https://ai.google.dev/gemini-api/docs/image-generation#aspect_ratios
|
|
1013
1033
|
*/
|
|
1014
|
-
imageConfig:
|
|
1015
|
-
aspectRatio:
|
|
1034
|
+
imageConfig: import_v43.z.object({
|
|
1035
|
+
aspectRatio: import_v43.z.enum([
|
|
1016
1036
|
"1:1",
|
|
1017
1037
|
"2:3",
|
|
1018
1038
|
"3:2",
|
|
@@ -1028,12 +1048,12 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
|
|
|
1028
1048
|
"1:4",
|
|
1029
1049
|
"4:1"
|
|
1030
1050
|
]).optional(),
|
|
1031
|
-
imageSize:
|
|
1051
|
+
imageSize: import_v43.z.enum(["1K", "2K", "4K", "512"]).optional(),
|
|
1032
1052
|
/**
|
|
1033
1053
|
* Optional. Controls the generation of people in images.
|
|
1034
1054
|
* Vertex AI only.
|
|
1035
1055
|
*/
|
|
1036
|
-
personGeneration:
|
|
1056
|
+
personGeneration: import_v43.z.enum([
|
|
1037
1057
|
"PERSON_GENERATION_UNSPECIFIED",
|
|
1038
1058
|
"ALLOW_ALL",
|
|
1039
1059
|
"ALLOW_ADULT",
|
|
@@ -1047,7 +1067,7 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
|
|
|
1047
1067
|
*
|
|
1048
1068
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerationConfig
|
|
1049
1069
|
*/
|
|
1050
|
-
prominentPeople:
|
|
1070
|
+
prominentPeople: import_v43.z.enum([
|
|
1051
1071
|
"PROMINENT_PEOPLE_UNSPECIFIED",
|
|
1052
1072
|
"ALLOW_PROMINENT_PEOPLE",
|
|
1053
1073
|
"BLOCK_PROMINENT_PEOPLE"
|
|
@@ -1056,9 +1076,9 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
|
|
|
1056
1076
|
* Optional. The image output format for generated images.
|
|
1057
1077
|
* Vertex AI only.
|
|
1058
1078
|
*/
|
|
1059
|
-
imageOutputOptions:
|
|
1060
|
-
mimeType:
|
|
1061
|
-
compressionQuality:
|
|
1079
|
+
imageOutputOptions: import_v43.z.object({
|
|
1080
|
+
mimeType: import_v43.z.enum(["image/jpeg", "image/png"]).optional(),
|
|
1081
|
+
compressionQuality: import_v43.z.number().optional()
|
|
1062
1082
|
}).optional()
|
|
1063
1083
|
}).optional(),
|
|
1064
1084
|
/**
|
|
@@ -1067,10 +1087,10 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
|
|
|
1067
1087
|
*
|
|
1068
1088
|
* https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps
|
|
1069
1089
|
*/
|
|
1070
|
-
retrievalConfig:
|
|
1071
|
-
latLng:
|
|
1072
|
-
latitude:
|
|
1073
|
-
longitude:
|
|
1090
|
+
retrievalConfig: import_v43.z.object({
|
|
1091
|
+
latLng: import_v43.z.object({
|
|
1092
|
+
latitude: import_v43.z.number(),
|
|
1093
|
+
longitude: import_v43.z.number()
|
|
1074
1094
|
}).optional()
|
|
1075
1095
|
}).optional(),
|
|
1076
1096
|
/**
|
|
@@ -1083,12 +1103,12 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
|
|
|
1083
1103
|
*
|
|
1084
1104
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling#streaming-fc
|
|
1085
1105
|
*/
|
|
1086
|
-
streamFunctionCallArguments:
|
|
1106
|
+
streamFunctionCallArguments: import_v43.z.boolean().optional(),
|
|
1087
1107
|
/**
|
|
1088
1108
|
* Optional. The service tier to use for the request. Sent as the
|
|
1089
1109
|
* `serviceTier` body field. Gemini API only.
|
|
1090
1110
|
*/
|
|
1091
|
-
serviceTier:
|
|
1111
|
+
serviceTier: import_v43.z.enum(["standard", "flex", "priority"]).optional(),
|
|
1092
1112
|
/**
|
|
1093
1113
|
* Optional. Resumes a response that stopped with `MAX_TOKENS` because it
|
|
1094
1114
|
* used up its `maxOutputTokens` budget (Gemini 4 long decode). Pass the
|
|
@@ -1098,7 +1118,7 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
|
|
|
1098
1118
|
* per-request cap while budget remains (`CONTINUATION`) are continued
|
|
1099
1119
|
* automatically. Sent as the `continuationToken` body field.
|
|
1100
1120
|
*/
|
|
1101
|
-
continuationToken:
|
|
1121
|
+
continuationToken: import_v43.z.string().optional(),
|
|
1102
1122
|
/**
|
|
1103
1123
|
* Optional. Vertex AI only. Sent as the
|
|
1104
1124
|
* `X-Vertex-AI-LLM-Shared-Request-Type` request header to select a
|
|
@@ -1109,7 +1129,7 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
|
|
|
1109
1129
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/priority-paygo
|
|
1110
1130
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/flex-paygo
|
|
1111
1131
|
*/
|
|
1112
|
-
sharedRequestType:
|
|
1132
|
+
sharedRequestType: import_v43.z.enum(["priority", "flex", "standard"]).optional(),
|
|
1113
1133
|
/**
|
|
1114
1134
|
* Optional. Vertex AI only. Sent as the `X-Vertex-AI-LLM-Request-Type`
|
|
1115
1135
|
* request header. Set to `'shared'` together with `sharedRequestType`
|
|
@@ -1117,7 +1137,7 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
|
|
|
1117
1137
|
*
|
|
1118
1138
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/priority-paygo
|
|
1119
1139
|
*/
|
|
1120
|
-
requestType:
|
|
1140
|
+
requestType: import_v43.z.enum(["shared"]).optional()
|
|
1121
1141
|
})
|
|
1122
1142
|
)
|
|
1123
1143
|
);
|
|
@@ -1424,8 +1444,10 @@ var GoogleJSONAccumulator = class {
|
|
|
1424
1444
|
processPartialArgs(partialArgs) {
|
|
1425
1445
|
let delta = "";
|
|
1426
1446
|
for (const arg of partialArgs) {
|
|
1427
|
-
const
|
|
1428
|
-
|
|
1447
|
+
const isArrayTerminator = arg.jsonPath.endsWith("[]");
|
|
1448
|
+
const jsonPath = isArrayTerminator ? arg.jsonPath.slice(0, -2) : arg.jsonPath;
|
|
1449
|
+
const rawPath = jsonPath.replace(/^\$\./, "");
|
|
1450
|
+
if (!rawPath || rawPath === "$") continue;
|
|
1429
1451
|
const segments = parsePath(rawPath);
|
|
1430
1452
|
const existingValue = getNestedValue(this.accumulatedArgs, segments);
|
|
1431
1453
|
const isStringContinuation = arg.stringValue != null && existingValue !== void 0;
|
|
@@ -1440,7 +1462,16 @@ var GoogleJSONAccumulator = class {
|
|
|
1440
1462
|
continue;
|
|
1441
1463
|
}
|
|
1442
1464
|
const resolved = resolvePartialArgValue(arg);
|
|
1443
|
-
if (resolved == null)
|
|
1465
|
+
if (resolved == null) {
|
|
1466
|
+
if (existingValue !== void 0 || arg.willContinue === true) continue;
|
|
1467
|
+
setNestedValue(
|
|
1468
|
+
this.accumulatedArgs,
|
|
1469
|
+
segments,
|
|
1470
|
+
isArrayTerminator ? [] : {}
|
|
1471
|
+
);
|
|
1472
|
+
delta += this.emitContainer(segments, isArrayTerminator);
|
|
1473
|
+
continue;
|
|
1474
|
+
}
|
|
1444
1475
|
setNestedValue(this.accumulatedArgs, segments, resolved.value);
|
|
1445
1476
|
delta += this.emitNavigationTo(segments, arg, resolved.json);
|
|
1446
1477
|
}
|
|
@@ -1492,6 +1523,26 @@ var GoogleJSONAccumulator = class {
|
|
|
1492
1523
|
fragment += this.emitLeaf(leafSegment, arg, valueJson);
|
|
1493
1524
|
return fragment;
|
|
1494
1525
|
}
|
|
1526
|
+
/**
|
|
1527
|
+
* Navigates to `targetSegments` and opens a container there. The container
|
|
1528
|
+
* stays open so later entries for its children continue inside it; it is
|
|
1529
|
+
* closed by subsequent navigation or by `finalize()`.
|
|
1530
|
+
*
|
|
1531
|
+
* Input: targetSegments=["nested","tags"], isArray=true
|
|
1532
|
+
* Output: '{"nested":{"tags":['
|
|
1533
|
+
*/
|
|
1534
|
+
emitContainer(targetSegments, isArray) {
|
|
1535
|
+
let fragment = "";
|
|
1536
|
+
if (this.stringOpen) {
|
|
1537
|
+
fragment += '"';
|
|
1538
|
+
this.stringOpen = false;
|
|
1539
|
+
}
|
|
1540
|
+
fragment += this.ensureRoot();
|
|
1541
|
+
const commonDepth = this.findCommonStackDepth(targetSegments);
|
|
1542
|
+
fragment += this.closeDownTo(commonDepth);
|
|
1543
|
+
fragment += this.openDownTo(targetSegments, isArray ? 0 : "");
|
|
1544
|
+
return fragment;
|
|
1545
|
+
}
|
|
1495
1546
|
/**
|
|
1496
1547
|
* Returns the stack depth to preserve when navigating to a new target
|
|
1497
1548
|
* container path. Always >= 1 (the root is never popped).
|
|
@@ -2703,205 +2754,205 @@ function extractSources({
|
|
|
2703
2754
|
}
|
|
2704
2755
|
return sources.length > 0 ? sources : void 0;
|
|
2705
2756
|
}
|
|
2706
|
-
var getGroundingMetadataSchema = () =>
|
|
2707
|
-
webSearchQueries:
|
|
2708
|
-
imageSearchQueries:
|
|
2709
|
-
retrievalQueries:
|
|
2710
|
-
searchEntryPoint:
|
|
2711
|
-
groundingChunks:
|
|
2712
|
-
|
|
2713
|
-
web:
|
|
2714
|
-
image:
|
|
2715
|
-
sourceUri:
|
|
2716
|
-
imageUri:
|
|
2717
|
-
title:
|
|
2718
|
-
domain:
|
|
2757
|
+
var getGroundingMetadataSchema = () => import_v44.z.object({
|
|
2758
|
+
webSearchQueries: import_v44.z.array(import_v44.z.string()).nullish(),
|
|
2759
|
+
imageSearchQueries: import_v44.z.array(import_v44.z.string()).nullish(),
|
|
2760
|
+
retrievalQueries: import_v44.z.array(import_v44.z.string()).nullish(),
|
|
2761
|
+
searchEntryPoint: import_v44.z.object({ renderedContent: import_v44.z.string() }).nullish(),
|
|
2762
|
+
groundingChunks: import_v44.z.array(
|
|
2763
|
+
import_v44.z.object({
|
|
2764
|
+
web: import_v44.z.object({ uri: import_v44.z.string(), title: import_v44.z.string().nullish() }).nullish(),
|
|
2765
|
+
image: import_v44.z.object({
|
|
2766
|
+
sourceUri: import_v44.z.string(),
|
|
2767
|
+
imageUri: import_v44.z.string(),
|
|
2768
|
+
title: import_v44.z.string().nullish(),
|
|
2769
|
+
domain: import_v44.z.string().nullish()
|
|
2719
2770
|
}).nullish(),
|
|
2720
|
-
retrievedContext:
|
|
2721
|
-
uri:
|
|
2722
|
-
title:
|
|
2723
|
-
text:
|
|
2724
|
-
fileSearchStore:
|
|
2725
|
-
customMetadata:
|
|
2726
|
-
|
|
2727
|
-
key:
|
|
2728
|
-
stringValue:
|
|
2729
|
-
numericValue:
|
|
2730
|
-
stringListValue:
|
|
2771
|
+
retrievedContext: import_v44.z.object({
|
|
2772
|
+
uri: import_v44.z.string().nullish(),
|
|
2773
|
+
title: import_v44.z.string().nullish(),
|
|
2774
|
+
text: import_v44.z.string().nullish(),
|
|
2775
|
+
fileSearchStore: import_v44.z.string().nullish(),
|
|
2776
|
+
customMetadata: import_v44.z.array(
|
|
2777
|
+
import_v44.z.object({
|
|
2778
|
+
key: import_v44.z.string(),
|
|
2779
|
+
stringValue: import_v44.z.string().nullish(),
|
|
2780
|
+
numericValue: import_v44.z.number().nullish(),
|
|
2781
|
+
stringListValue: import_v44.z.object({ values: import_v44.z.array(import_v44.z.string()).nullish() }).nullish()
|
|
2731
2782
|
})
|
|
2732
2783
|
).nullish()
|
|
2733
2784
|
}).nullish(),
|
|
2734
|
-
maps:
|
|
2735
|
-
uri:
|
|
2736
|
-
title:
|
|
2737
|
-
text:
|
|
2738
|
-
placeId:
|
|
2785
|
+
maps: import_v44.z.object({
|
|
2786
|
+
uri: import_v44.z.string().nullish(),
|
|
2787
|
+
title: import_v44.z.string().nullish(),
|
|
2788
|
+
text: import_v44.z.string().nullish(),
|
|
2789
|
+
placeId: import_v44.z.string().nullish()
|
|
2739
2790
|
}).nullish()
|
|
2740
2791
|
})
|
|
2741
2792
|
).nullish(),
|
|
2742
|
-
groundingSupports:
|
|
2743
|
-
|
|
2744
|
-
segment:
|
|
2745
|
-
startIndex:
|
|
2746
|
-
endIndex:
|
|
2747
|
-
text:
|
|
2793
|
+
groundingSupports: import_v44.z.array(
|
|
2794
|
+
import_v44.z.object({
|
|
2795
|
+
segment: import_v44.z.object({
|
|
2796
|
+
startIndex: import_v44.z.number().nullish(),
|
|
2797
|
+
endIndex: import_v44.z.number().nullish(),
|
|
2798
|
+
text: import_v44.z.string().nullish()
|
|
2748
2799
|
}).nullish(),
|
|
2749
|
-
segment_text:
|
|
2750
|
-
groundingChunkIndices:
|
|
2751
|
-
supportChunkIndices:
|
|
2752
|
-
confidenceScores:
|
|
2753
|
-
confidenceScore:
|
|
2800
|
+
segment_text: import_v44.z.string().nullish(),
|
|
2801
|
+
groundingChunkIndices: import_v44.z.array(import_v44.z.number()).nullish(),
|
|
2802
|
+
supportChunkIndices: import_v44.z.array(import_v44.z.number()).nullish(),
|
|
2803
|
+
confidenceScores: import_v44.z.array(import_v44.z.number()).nullish(),
|
|
2804
|
+
confidenceScore: import_v44.z.array(import_v44.z.number()).nullish()
|
|
2754
2805
|
})
|
|
2755
2806
|
).nullish(),
|
|
2756
|
-
retrievalMetadata:
|
|
2757
|
-
|
|
2758
|
-
webDynamicRetrievalScore:
|
|
2807
|
+
retrievalMetadata: import_v44.z.union([
|
|
2808
|
+
import_v44.z.object({
|
|
2809
|
+
webDynamicRetrievalScore: import_v44.z.number()
|
|
2759
2810
|
}),
|
|
2760
|
-
|
|
2811
|
+
import_v44.z.object({})
|
|
2761
2812
|
]).nullish()
|
|
2762
2813
|
});
|
|
2763
|
-
var partialArgSchema = () =>
|
|
2764
|
-
jsonPath:
|
|
2765
|
-
stringValue:
|
|
2766
|
-
numberValue:
|
|
2767
|
-
boolValue:
|
|
2768
|
-
nullValue:
|
|
2769
|
-
willContinue:
|
|
2814
|
+
var partialArgSchema = () => import_v44.z.object({
|
|
2815
|
+
jsonPath: import_v44.z.string(),
|
|
2816
|
+
stringValue: import_v44.z.string().nullish(),
|
|
2817
|
+
numberValue: import_v44.z.number().nullish(),
|
|
2818
|
+
boolValue: import_v44.z.boolean().nullish(),
|
|
2819
|
+
nullValue: import_v44.z.unknown().nullish(),
|
|
2820
|
+
willContinue: import_v44.z.boolean().nullish()
|
|
2770
2821
|
});
|
|
2771
|
-
var getContentSchema = () =>
|
|
2772
|
-
parts:
|
|
2773
|
-
|
|
2822
|
+
var getContentSchema = () => import_v44.z.object({
|
|
2823
|
+
parts: import_v44.z.array(
|
|
2824
|
+
import_v44.z.union([
|
|
2774
2825
|
// note: order matters since text can be fully empty
|
|
2775
|
-
|
|
2776
|
-
functionCall:
|
|
2777
|
-
id:
|
|
2778
|
-
name:
|
|
2779
|
-
args:
|
|
2780
|
-
partialArgs:
|
|
2781
|
-
willContinue:
|
|
2826
|
+
import_v44.z.object({
|
|
2827
|
+
functionCall: import_v44.z.object({
|
|
2828
|
+
id: import_v44.z.string().nullish(),
|
|
2829
|
+
name: import_v44.z.string().nullish(),
|
|
2830
|
+
args: import_v44.z.unknown().nullish(),
|
|
2831
|
+
partialArgs: import_v44.z.array(partialArgSchema()).nullish(),
|
|
2832
|
+
willContinue: import_v44.z.boolean().nullish()
|
|
2782
2833
|
}),
|
|
2783
|
-
thoughtSignature:
|
|
2834
|
+
thoughtSignature: import_v44.z.string().nullish()
|
|
2784
2835
|
}),
|
|
2785
|
-
|
|
2786
|
-
inlineData:
|
|
2787
|
-
mimeType:
|
|
2788
|
-
data:
|
|
2836
|
+
import_v44.z.object({
|
|
2837
|
+
inlineData: import_v44.z.object({
|
|
2838
|
+
mimeType: import_v44.z.string(),
|
|
2839
|
+
data: import_v44.z.string()
|
|
2789
2840
|
}),
|
|
2790
|
-
thought:
|
|
2791
|
-
thoughtSignature:
|
|
2841
|
+
thought: import_v44.z.boolean().nullish(),
|
|
2842
|
+
thoughtSignature: import_v44.z.string().nullish()
|
|
2792
2843
|
}),
|
|
2793
|
-
|
|
2794
|
-
toolCall:
|
|
2795
|
-
toolType:
|
|
2796
|
-
args:
|
|
2797
|
-
id:
|
|
2844
|
+
import_v44.z.object({
|
|
2845
|
+
toolCall: import_v44.z.object({
|
|
2846
|
+
toolType: import_v44.z.string(),
|
|
2847
|
+
args: import_v44.z.unknown().nullish(),
|
|
2848
|
+
id: import_v44.z.string()
|
|
2798
2849
|
}),
|
|
2799
|
-
thoughtSignature:
|
|
2850
|
+
thoughtSignature: import_v44.z.string().nullish()
|
|
2800
2851
|
}),
|
|
2801
|
-
|
|
2802
|
-
toolResponse:
|
|
2803
|
-
toolType:
|
|
2804
|
-
response:
|
|
2805
|
-
id:
|
|
2852
|
+
import_v44.z.object({
|
|
2853
|
+
toolResponse: import_v44.z.object({
|
|
2854
|
+
toolType: import_v44.z.string(),
|
|
2855
|
+
response: import_v44.z.unknown().nullish(),
|
|
2856
|
+
id: import_v44.z.string()
|
|
2806
2857
|
}),
|
|
2807
|
-
thoughtSignature:
|
|
2858
|
+
thoughtSignature: import_v44.z.string().nullish()
|
|
2808
2859
|
}),
|
|
2809
|
-
|
|
2810
|
-
executableCode:
|
|
2811
|
-
language:
|
|
2812
|
-
code:
|
|
2860
|
+
import_v44.z.object({
|
|
2861
|
+
executableCode: import_v44.z.object({
|
|
2862
|
+
language: import_v44.z.string(),
|
|
2863
|
+
code: import_v44.z.string()
|
|
2813
2864
|
}).nullish(),
|
|
2814
|
-
codeExecutionResult:
|
|
2815
|
-
outcome:
|
|
2816
|
-
output:
|
|
2865
|
+
codeExecutionResult: import_v44.z.object({
|
|
2866
|
+
outcome: import_v44.z.string(),
|
|
2867
|
+
output: import_v44.z.string().nullish()
|
|
2817
2868
|
}).nullish(),
|
|
2818
|
-
text:
|
|
2819
|
-
thought:
|
|
2820
|
-
thoughtSignature:
|
|
2869
|
+
text: import_v44.z.string().nullish(),
|
|
2870
|
+
thought: import_v44.z.boolean().nullish(),
|
|
2871
|
+
thoughtSignature: import_v44.z.string().nullish()
|
|
2821
2872
|
})
|
|
2822
2873
|
])
|
|
2823
2874
|
).nullish()
|
|
2824
2875
|
});
|
|
2825
|
-
var getSafetyRatingSchema = () =>
|
|
2826
|
-
category:
|
|
2827
|
-
probability:
|
|
2828
|
-
probabilityScore:
|
|
2829
|
-
severity:
|
|
2830
|
-
severityScore:
|
|
2831
|
-
blocked:
|
|
2876
|
+
var getSafetyRatingSchema = () => import_v44.z.object({
|
|
2877
|
+
category: import_v44.z.string().nullish(),
|
|
2878
|
+
probability: import_v44.z.string().nullish(),
|
|
2879
|
+
probabilityScore: import_v44.z.number().nullish(),
|
|
2880
|
+
severity: import_v44.z.string().nullish(),
|
|
2881
|
+
severityScore: import_v44.z.number().nullish(),
|
|
2882
|
+
blocked: import_v44.z.boolean().nullish()
|
|
2832
2883
|
});
|
|
2833
|
-
var tokenDetailsSchema = () =>
|
|
2834
|
-
|
|
2835
|
-
modality:
|
|
2836
|
-
tokenCount:
|
|
2837
|
-
}).catchall(
|
|
2884
|
+
var tokenDetailsSchema = () => import_v44.z.array(
|
|
2885
|
+
import_v44.z.object({
|
|
2886
|
+
modality: import_v44.z.string(),
|
|
2887
|
+
tokenCount: import_v44.z.number()
|
|
2888
|
+
}).catchall(import_v44.z.json())
|
|
2838
2889
|
).nullish();
|
|
2839
|
-
var usageSchema = () =>
|
|
2840
|
-
cachedContentTokenCount:
|
|
2841
|
-
thoughtsTokenCount:
|
|
2842
|
-
promptTokenCount:
|
|
2843
|
-
candidatesTokenCount:
|
|
2844
|
-
toolUsePromptTokenCount:
|
|
2845
|
-
totalTokenCount:
|
|
2890
|
+
var usageSchema = () => import_v44.z.object({
|
|
2891
|
+
cachedContentTokenCount: import_v44.z.number().nullish(),
|
|
2892
|
+
thoughtsTokenCount: import_v44.z.number().nullish(),
|
|
2893
|
+
promptTokenCount: import_v44.z.number().nullish(),
|
|
2894
|
+
candidatesTokenCount: import_v44.z.number().nullish(),
|
|
2895
|
+
toolUsePromptTokenCount: import_v44.z.number().nullish(),
|
|
2896
|
+
totalTokenCount: import_v44.z.number().nullish(),
|
|
2846
2897
|
// https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerateContentResponse#TrafficType
|
|
2847
|
-
trafficType:
|
|
2848
|
-
serviceTier:
|
|
2898
|
+
trafficType: import_v44.z.string().nullish(),
|
|
2899
|
+
serviceTier: import_v44.z.string().nullish(),
|
|
2849
2900
|
// https://ai.google.dev/api/generate-content#Modality
|
|
2850
2901
|
promptTokensDetails: tokenDetailsSchema(),
|
|
2851
2902
|
cacheTokensDetails: tokenDetailsSchema(),
|
|
2852
2903
|
candidatesTokensDetails: tokenDetailsSchema(),
|
|
2853
2904
|
toolUsePromptTokensDetails: tokenDetailsSchema()
|
|
2854
|
-
}).catchall(
|
|
2855
|
-
var getUrlContextMetadataSchema = () =>
|
|
2856
|
-
urlMetadata:
|
|
2857
|
-
|
|
2858
|
-
retrievedUrl:
|
|
2859
|
-
urlRetrievalStatus:
|
|
2905
|
+
}).catchall(import_v44.z.json());
|
|
2906
|
+
var getUrlContextMetadataSchema = () => import_v44.z.object({
|
|
2907
|
+
urlMetadata: import_v44.z.array(
|
|
2908
|
+
import_v44.z.object({
|
|
2909
|
+
retrievedUrl: import_v44.z.string(),
|
|
2910
|
+
urlRetrievalStatus: import_v44.z.string()
|
|
2860
2911
|
})
|
|
2861
2912
|
).nullish()
|
|
2862
2913
|
});
|
|
2863
2914
|
var responseSchema = (0, import_provider_utils5.lazySchema)(
|
|
2864
2915
|
() => (0, import_provider_utils5.zodSchema)(
|
|
2865
|
-
|
|
2866
|
-
responseId:
|
|
2867
|
-
candidates:
|
|
2868
|
-
|
|
2869
|
-
content: getContentSchema().nullish().or(
|
|
2870
|
-
finishReason:
|
|
2871
|
-
finishMessage:
|
|
2872
|
-
continuationToken:
|
|
2873
|
-
safetyRatings:
|
|
2916
|
+
import_v44.z.object({
|
|
2917
|
+
responseId: import_v44.z.string().nullish(),
|
|
2918
|
+
candidates: import_v44.z.array(
|
|
2919
|
+
import_v44.z.object({
|
|
2920
|
+
content: getContentSchema().nullish().or(import_v44.z.object({}).strict()),
|
|
2921
|
+
finishReason: import_v44.z.string().nullish(),
|
|
2922
|
+
finishMessage: import_v44.z.string().nullish(),
|
|
2923
|
+
continuationToken: import_v44.z.string().nullish(),
|
|
2924
|
+
safetyRatings: import_v44.z.array(getSafetyRatingSchema()).nullish(),
|
|
2874
2925
|
groundingMetadata: getGroundingMetadataSchema().nullish(),
|
|
2875
2926
|
urlContextMetadata: getUrlContextMetadataSchema().nullish()
|
|
2876
2927
|
})
|
|
2877
2928
|
).nullish(),
|
|
2878
2929
|
usageMetadata: usageSchema().nullish(),
|
|
2879
|
-
promptFeedback:
|
|
2880
|
-
blockReason:
|
|
2881
|
-
safetyRatings:
|
|
2930
|
+
promptFeedback: import_v44.z.object({
|
|
2931
|
+
blockReason: import_v44.z.string().nullish(),
|
|
2932
|
+
safetyRatings: import_v44.z.array(getSafetyRatingSchema()).nullish()
|
|
2882
2933
|
}).nullish()
|
|
2883
2934
|
})
|
|
2884
2935
|
)
|
|
2885
2936
|
);
|
|
2886
2937
|
var chunkSchema = (0, import_provider_utils5.lazySchema)(
|
|
2887
2938
|
() => (0, import_provider_utils5.zodSchema)(
|
|
2888
|
-
|
|
2889
|
-
responseId:
|
|
2890
|
-
candidates:
|
|
2891
|
-
|
|
2939
|
+
import_v44.z.object({
|
|
2940
|
+
responseId: import_v44.z.string().nullish(),
|
|
2941
|
+
candidates: import_v44.z.array(
|
|
2942
|
+
import_v44.z.object({
|
|
2892
2943
|
content: getContentSchema().nullish(),
|
|
2893
|
-
finishReason:
|
|
2894
|
-
finishMessage:
|
|
2895
|
-
continuationToken:
|
|
2896
|
-
safetyRatings:
|
|
2944
|
+
finishReason: import_v44.z.string().nullish(),
|
|
2945
|
+
finishMessage: import_v44.z.string().nullish(),
|
|
2946
|
+
continuationToken: import_v44.z.string().nullish(),
|
|
2947
|
+
safetyRatings: import_v44.z.array(getSafetyRatingSchema()).nullish(),
|
|
2897
2948
|
groundingMetadata: getGroundingMetadataSchema().nullish(),
|
|
2898
2949
|
urlContextMetadata: getUrlContextMetadataSchema().nullish()
|
|
2899
2950
|
})
|
|
2900
2951
|
).nullish(),
|
|
2901
2952
|
usageMetadata: usageSchema().nullish(),
|
|
2902
|
-
promptFeedback:
|
|
2903
|
-
blockReason:
|
|
2904
|
-
safetyRatings:
|
|
2953
|
+
promptFeedback: import_v44.z.object({
|
|
2954
|
+
blockReason: import_v44.z.string().nullish(),
|
|
2955
|
+
safetyRatings: import_v44.z.array(getSafetyRatingSchema()).nullish()
|
|
2905
2956
|
}).nullish()
|
|
2906
2957
|
})
|
|
2907
2958
|
)
|
|
@@ -2912,43 +2963,43 @@ function isConfirmedPromptBlockReason(blockReason) {
|
|
|
2912
2963
|
|
|
2913
2964
|
// src/tool/code-execution.ts
|
|
2914
2965
|
var import_provider_utils6 = require("@ai-sdk/provider-utils");
|
|
2915
|
-
var
|
|
2966
|
+
var import_v45 = require("zod/v4");
|
|
2916
2967
|
var codeExecution = (0, import_provider_utils6.createProviderToolFactoryWithOutputSchema)({
|
|
2917
2968
|
id: "google.code_execution",
|
|
2918
|
-
inputSchema:
|
|
2919
|
-
language:
|
|
2920
|
-
code:
|
|
2969
|
+
inputSchema: import_v45.z.object({
|
|
2970
|
+
language: import_v45.z.string().describe("The programming language of the code."),
|
|
2971
|
+
code: import_v45.z.string().describe("The code to be executed.")
|
|
2921
2972
|
}),
|
|
2922
|
-
outputSchema:
|
|
2923
|
-
outcome:
|
|
2924
|
-
output:
|
|
2973
|
+
outputSchema: import_v45.z.object({
|
|
2974
|
+
outcome: import_v45.z.string().describe('The outcome of the execution (e.g., "OUTCOME_OK").'),
|
|
2975
|
+
output: import_v45.z.string().describe("The output from the code execution.")
|
|
2925
2976
|
})
|
|
2926
2977
|
});
|
|
2927
2978
|
|
|
2928
2979
|
// src/tool/enterprise-web-search.ts
|
|
2929
2980
|
var import_provider_utils7 = require("@ai-sdk/provider-utils");
|
|
2930
|
-
var
|
|
2981
|
+
var import_v46 = require("zod/v4");
|
|
2931
2982
|
var enterpriseWebSearch = (0, import_provider_utils7.createProviderToolFactory)({
|
|
2932
2983
|
id: "google.enterprise_web_search",
|
|
2933
|
-
inputSchema: (0, import_provider_utils7.lazySchema)(() => (0, import_provider_utils7.zodSchema)(
|
|
2984
|
+
inputSchema: (0, import_provider_utils7.lazySchema)(() => (0, import_provider_utils7.zodSchema)(import_v46.z.object({})))
|
|
2934
2985
|
});
|
|
2935
2986
|
|
|
2936
2987
|
// src/tool/file-search.ts
|
|
2937
2988
|
var import_provider_utils8 = require("@ai-sdk/provider-utils");
|
|
2938
|
-
var
|
|
2939
|
-
var fileSearchArgsBaseSchema = () =>
|
|
2989
|
+
var import_v47 = require("zod/v4");
|
|
2990
|
+
var fileSearchArgsBaseSchema = () => import_v47.z.object({
|
|
2940
2991
|
/** The names of the file_search_stores to retrieve from.
|
|
2941
2992
|
* Example: `fileSearchStores/my-file-search-store-123`
|
|
2942
2993
|
*/
|
|
2943
|
-
fileSearchStoreNames:
|
|
2994
|
+
fileSearchStoreNames: import_v47.z.array(import_v47.z.string()).describe(
|
|
2944
2995
|
"The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`"
|
|
2945
2996
|
),
|
|
2946
2997
|
/** The number of file search retrieval chunks to retrieve. */
|
|
2947
|
-
topK:
|
|
2998
|
+
topK: import_v47.z.number().int().positive().describe("The number of file search retrieval chunks to retrieve.").optional(),
|
|
2948
2999
|
/** Metadata filter to apply to the file search retrieval documents.
|
|
2949
3000
|
* See https://google.aip.dev/160 for the syntax of the filter expression.
|
|
2950
3001
|
*/
|
|
2951
|
-
metadataFilter:
|
|
3002
|
+
metadataFilter: import_v47.z.string().describe(
|
|
2952
3003
|
"Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression."
|
|
2953
3004
|
).optional()
|
|
2954
3005
|
}).passthrough();
|
|
@@ -2962,23 +3013,23 @@ var fileSearch = (0, import_provider_utils8.createProviderToolFactory)({
|
|
|
2962
3013
|
|
|
2963
3014
|
// src/tool/google-maps.ts
|
|
2964
3015
|
var import_provider_utils9 = require("@ai-sdk/provider-utils");
|
|
2965
|
-
var
|
|
3016
|
+
var import_v48 = require("zod/v4");
|
|
2966
3017
|
var googleMaps = (0, import_provider_utils9.createProviderToolFactory)({
|
|
2967
3018
|
id: "google.google_maps",
|
|
2968
|
-
inputSchema: (0, import_provider_utils9.lazySchema)(() => (0, import_provider_utils9.zodSchema)(
|
|
3019
|
+
inputSchema: (0, import_provider_utils9.lazySchema)(() => (0, import_provider_utils9.zodSchema)(import_v48.z.object({})))
|
|
2969
3020
|
});
|
|
2970
3021
|
|
|
2971
3022
|
// src/tool/google-search.ts
|
|
2972
3023
|
var import_provider_utils10 = require("@ai-sdk/provider-utils");
|
|
2973
|
-
var
|
|
2974
|
-
var googleSearchToolArgsBaseSchema = () =>
|
|
2975
|
-
searchTypes:
|
|
2976
|
-
webSearch:
|
|
2977
|
-
imageSearch:
|
|
3024
|
+
var import_v49 = require("zod/v4");
|
|
3025
|
+
var googleSearchToolArgsBaseSchema = () => import_v49.z.object({
|
|
3026
|
+
searchTypes: import_v49.z.object({
|
|
3027
|
+
webSearch: import_v49.z.object({}).optional(),
|
|
3028
|
+
imageSearch: import_v49.z.object({}).optional()
|
|
2978
3029
|
}).optional(),
|
|
2979
|
-
timeRangeFilter:
|
|
2980
|
-
startTime:
|
|
2981
|
-
endTime:
|
|
3030
|
+
timeRangeFilter: import_v49.z.object({
|
|
3031
|
+
startTime: import_v49.z.string(),
|
|
3032
|
+
endTime: import_v49.z.string()
|
|
2982
3033
|
}).optional()
|
|
2983
3034
|
}).passthrough();
|
|
2984
3035
|
var googleSearchToolArgsSchema = (0, import_provider_utils10.lazySchema)(
|
|
@@ -2993,20 +3044,20 @@ var googleSearch = (0, import_provider_utils10.createProviderToolFactory)(
|
|
|
2993
3044
|
|
|
2994
3045
|
// src/tool/url-context.ts
|
|
2995
3046
|
var import_provider_utils11 = require("@ai-sdk/provider-utils");
|
|
2996
|
-
var
|
|
3047
|
+
var import_v410 = require("zod/v4");
|
|
2997
3048
|
var urlContext = (0, import_provider_utils11.createProviderToolFactory)({
|
|
2998
3049
|
id: "google.url_context",
|
|
2999
|
-
inputSchema: (0, import_provider_utils11.lazySchema)(() => (0, import_provider_utils11.zodSchema)(
|
|
3050
|
+
inputSchema: (0, import_provider_utils11.lazySchema)(() => (0, import_provider_utils11.zodSchema)(import_v410.z.object({})))
|
|
3000
3051
|
});
|
|
3001
3052
|
|
|
3002
3053
|
// src/tool/vertex-rag-store.ts
|
|
3003
3054
|
var import_provider_utils12 = require("@ai-sdk/provider-utils");
|
|
3004
|
-
var
|
|
3055
|
+
var import_v411 = require("zod/v4");
|
|
3005
3056
|
var vertexRagStore = (0, import_provider_utils12.createProviderToolFactory)({
|
|
3006
3057
|
id: "google.vertex_rag_store",
|
|
3007
|
-
inputSchema:
|
|
3008
|
-
ragCorpus:
|
|
3009
|
-
topK:
|
|
3058
|
+
inputSchema: import_v411.z.object({
|
|
3059
|
+
ragCorpus: import_v411.z.string(),
|
|
3060
|
+
topK: import_v411.z.number().optional()
|
|
3010
3061
|
})
|
|
3011
3062
|
});
|
|
3012
3063
|
|
|
@@ -4228,30 +4279,30 @@ ${block.text}`
|
|
|
4228
4279
|
|
|
4229
4280
|
// src/interactions/google-interactions-api.ts
|
|
4230
4281
|
var import_provider_utils14 = require("@ai-sdk/provider-utils");
|
|
4231
|
-
var
|
|
4232
|
-
var tokenByModalitySchema = () =>
|
|
4233
|
-
modality:
|
|
4234
|
-
tokens:
|
|
4282
|
+
var import_v412 = require("zod/v4");
|
|
4283
|
+
var tokenByModalitySchema = () => import_v412.z.object({
|
|
4284
|
+
modality: import_v412.z.string().nullish(),
|
|
4285
|
+
tokens: import_v412.z.number().nullish()
|
|
4235
4286
|
}).loose();
|
|
4236
|
-
var usageSchema2 = () =>
|
|
4237
|
-
total_input_tokens:
|
|
4238
|
-
total_output_tokens:
|
|
4239
|
-
total_thought_tokens:
|
|
4240
|
-
total_cached_tokens:
|
|
4241
|
-
total_tool_use_tokens:
|
|
4242
|
-
total_tokens:
|
|
4243
|
-
input_tokens_by_modality:
|
|
4244
|
-
output_tokens_by_modality:
|
|
4245
|
-
cached_tokens_by_modality:
|
|
4246
|
-
tool_use_tokens_by_modality:
|
|
4247
|
-
grounding_tool_count:
|
|
4248
|
-
|
|
4249
|
-
type:
|
|
4250
|
-
count:
|
|
4287
|
+
var usageSchema2 = () => import_v412.z.object({
|
|
4288
|
+
total_input_tokens: import_v412.z.number().nullish(),
|
|
4289
|
+
total_output_tokens: import_v412.z.number().nullish(),
|
|
4290
|
+
total_thought_tokens: import_v412.z.number().nullish(),
|
|
4291
|
+
total_cached_tokens: import_v412.z.number().nullish(),
|
|
4292
|
+
total_tool_use_tokens: import_v412.z.number().nullish(),
|
|
4293
|
+
total_tokens: import_v412.z.number().nullish(),
|
|
4294
|
+
input_tokens_by_modality: import_v412.z.array(tokenByModalitySchema()).nullish(),
|
|
4295
|
+
output_tokens_by_modality: import_v412.z.array(tokenByModalitySchema()).nullish(),
|
|
4296
|
+
cached_tokens_by_modality: import_v412.z.array(tokenByModalitySchema()).nullish(),
|
|
4297
|
+
tool_use_tokens_by_modality: import_v412.z.array(tokenByModalitySchema()).nullish(),
|
|
4298
|
+
grounding_tool_count: import_v412.z.array(
|
|
4299
|
+
import_v412.z.object({
|
|
4300
|
+
type: import_v412.z.string().nullish(),
|
|
4301
|
+
count: import_v412.z.number().nullish()
|
|
4251
4302
|
}).loose()
|
|
4252
4303
|
).nullish()
|
|
4253
4304
|
}).loose();
|
|
4254
|
-
var interactionStatusSchema = () =>
|
|
4305
|
+
var interactionStatusSchema = () => import_v412.z.enum([
|
|
4255
4306
|
"in_progress",
|
|
4256
4307
|
"requires_action",
|
|
4257
4308
|
"completed",
|
|
@@ -4260,69 +4311,69 @@ var interactionStatusSchema = () => import_v411.z.enum([
|
|
|
4260
4311
|
"incomplete"
|
|
4261
4312
|
]);
|
|
4262
4313
|
var annotationSchema = () => {
|
|
4263
|
-
const urlCitation =
|
|
4264
|
-
type:
|
|
4265
|
-
url:
|
|
4266
|
-
title:
|
|
4267
|
-
start_index:
|
|
4268
|
-
end_index:
|
|
4314
|
+
const urlCitation = import_v412.z.object({
|
|
4315
|
+
type: import_v412.z.literal("url_citation"),
|
|
4316
|
+
url: import_v412.z.string().nullish(),
|
|
4317
|
+
title: import_v412.z.string().nullish(),
|
|
4318
|
+
start_index: import_v412.z.number().nullish(),
|
|
4319
|
+
end_index: import_v412.z.number().nullish()
|
|
4269
4320
|
}).loose();
|
|
4270
|
-
const fileCitation =
|
|
4271
|
-
type:
|
|
4272
|
-
file_name:
|
|
4273
|
-
document_uri:
|
|
4274
|
-
url:
|
|
4275
|
-
page_number:
|
|
4276
|
-
media_id:
|
|
4277
|
-
start_index:
|
|
4278
|
-
end_index:
|
|
4279
|
-
custom_metadata:
|
|
4321
|
+
const fileCitation = import_v412.z.object({
|
|
4322
|
+
type: import_v412.z.literal("file_citation"),
|
|
4323
|
+
file_name: import_v412.z.string().nullish(),
|
|
4324
|
+
document_uri: import_v412.z.string().nullish(),
|
|
4325
|
+
url: import_v412.z.string().nullish(),
|
|
4326
|
+
page_number: import_v412.z.number().nullish(),
|
|
4327
|
+
media_id: import_v412.z.string().nullish(),
|
|
4328
|
+
start_index: import_v412.z.number().nullish(),
|
|
4329
|
+
end_index: import_v412.z.number().nullish(),
|
|
4330
|
+
custom_metadata: import_v412.z.record(import_v412.z.string(), import_v412.z.unknown()).nullish()
|
|
4280
4331
|
}).loose();
|
|
4281
|
-
const placeCitation =
|
|
4282
|
-
type:
|
|
4283
|
-
name:
|
|
4284
|
-
url:
|
|
4285
|
-
place_id:
|
|
4286
|
-
start_index:
|
|
4287
|
-
end_index:
|
|
4332
|
+
const placeCitation = import_v412.z.object({
|
|
4333
|
+
type: import_v412.z.literal("place_citation"),
|
|
4334
|
+
name: import_v412.z.string().nullish(),
|
|
4335
|
+
url: import_v412.z.string().nullish(),
|
|
4336
|
+
place_id: import_v412.z.string().nullish(),
|
|
4337
|
+
start_index: import_v412.z.number().nullish(),
|
|
4338
|
+
end_index: import_v412.z.number().nullish()
|
|
4288
4339
|
}).loose();
|
|
4289
|
-
return
|
|
4340
|
+
return import_v412.z.union([
|
|
4290
4341
|
urlCitation,
|
|
4291
4342
|
fileCitation,
|
|
4292
4343
|
placeCitation,
|
|
4293
|
-
|
|
4344
|
+
import_v412.z.object({ type: import_v412.z.string() }).loose()
|
|
4294
4345
|
]);
|
|
4295
4346
|
};
|
|
4296
|
-
var thoughtSummaryItemSchema = () =>
|
|
4297
|
-
type:
|
|
4298
|
-
text:
|
|
4299
|
-
data:
|
|
4300
|
-
mime_type:
|
|
4347
|
+
var thoughtSummaryItemSchema = () => import_v412.z.object({
|
|
4348
|
+
type: import_v412.z.string(),
|
|
4349
|
+
text: import_v412.z.string().nullish(),
|
|
4350
|
+
data: import_v412.z.string().nullish(),
|
|
4351
|
+
mime_type: import_v412.z.string().nullish()
|
|
4301
4352
|
}).loose();
|
|
4302
4353
|
var contentBlockSchema = () => {
|
|
4303
|
-
const textContent =
|
|
4304
|
-
type:
|
|
4305
|
-
text:
|
|
4306
|
-
annotations:
|
|
4354
|
+
const textContent = import_v412.z.object({
|
|
4355
|
+
type: import_v412.z.literal("text"),
|
|
4356
|
+
text: import_v412.z.string(),
|
|
4357
|
+
annotations: import_v412.z.array(annotationSchema()).nullish()
|
|
4307
4358
|
}).loose();
|
|
4308
|
-
const imageContent =
|
|
4309
|
-
type:
|
|
4310
|
-
data:
|
|
4311
|
-
mime_type:
|
|
4312
|
-
resolution:
|
|
4313
|
-
uri:
|
|
4359
|
+
const imageContent = import_v412.z.object({
|
|
4360
|
+
type: import_v412.z.literal("image"),
|
|
4361
|
+
data: import_v412.z.string().nullish(),
|
|
4362
|
+
mime_type: import_v412.z.string().nullish(),
|
|
4363
|
+
resolution: import_v412.z.enum(["low", "medium", "high", "ultra_high"]).nullish(),
|
|
4364
|
+
uri: import_v412.z.string().nullish()
|
|
4314
4365
|
}).loose();
|
|
4315
|
-
const videoContent =
|
|
4316
|
-
type:
|
|
4317
|
-
data:
|
|
4318
|
-
mime_type:
|
|
4319
|
-
uri:
|
|
4366
|
+
const videoContent = import_v412.z.object({
|
|
4367
|
+
type: import_v412.z.literal("video"),
|
|
4368
|
+
data: import_v412.z.string().nullish(),
|
|
4369
|
+
mime_type: import_v412.z.string().nullish(),
|
|
4370
|
+
uri: import_v412.z.string().nullish()
|
|
4320
4371
|
}).loose();
|
|
4321
|
-
return
|
|
4372
|
+
return import_v412.z.union([
|
|
4322
4373
|
textContent,
|
|
4323
4374
|
imageContent,
|
|
4324
4375
|
videoContent,
|
|
4325
|
-
|
|
4376
|
+
import_v412.z.object({ type: import_v412.z.string() }).loose()
|
|
4326
4377
|
]);
|
|
4327
4378
|
};
|
|
4328
4379
|
var BUILTIN_TOOL_CALL_STEP_TYPES = [
|
|
@@ -4342,73 +4393,73 @@ var BUILTIN_TOOL_RESULT_STEP_TYPES = [
|
|
|
4342
4393
|
"mcp_server_tool_result"
|
|
4343
4394
|
];
|
|
4344
4395
|
var stepSchema = () => {
|
|
4345
|
-
const userInputStep =
|
|
4346
|
-
type:
|
|
4347
|
-
content:
|
|
4396
|
+
const userInputStep = import_v412.z.object({
|
|
4397
|
+
type: import_v412.z.literal("user_input"),
|
|
4398
|
+
content: import_v412.z.array(contentBlockSchema()).nullish()
|
|
4348
4399
|
}).loose();
|
|
4349
|
-
const modelOutputStep =
|
|
4350
|
-
type:
|
|
4351
|
-
content:
|
|
4400
|
+
const modelOutputStep = import_v412.z.object({
|
|
4401
|
+
type: import_v412.z.literal("model_output"),
|
|
4402
|
+
content: import_v412.z.array(contentBlockSchema()).nullish()
|
|
4352
4403
|
}).loose();
|
|
4353
|
-
const functionCallStep =
|
|
4354
|
-
type:
|
|
4355
|
-
id:
|
|
4356
|
-
name:
|
|
4357
|
-
arguments:
|
|
4358
|
-
signature:
|
|
4404
|
+
const functionCallStep = import_v412.z.object({
|
|
4405
|
+
type: import_v412.z.literal("function_call"),
|
|
4406
|
+
id: import_v412.z.string(),
|
|
4407
|
+
name: import_v412.z.string(),
|
|
4408
|
+
arguments: import_v412.z.record(import_v412.z.string(), import_v412.z.unknown()).nullish(),
|
|
4409
|
+
signature: import_v412.z.string().nullish()
|
|
4359
4410
|
}).loose();
|
|
4360
|
-
const thoughtStep =
|
|
4361
|
-
type:
|
|
4362
|
-
signature:
|
|
4363
|
-
summary:
|
|
4411
|
+
const thoughtStep = import_v412.z.object({
|
|
4412
|
+
type: import_v412.z.literal("thought"),
|
|
4413
|
+
signature: import_v412.z.string().nullish(),
|
|
4414
|
+
summary: import_v412.z.array(thoughtSummaryItemSchema()).nullish()
|
|
4364
4415
|
}).loose();
|
|
4365
|
-
const builtinToolCallStep =
|
|
4366
|
-
type:
|
|
4367
|
-
id:
|
|
4368
|
-
arguments:
|
|
4369
|
-
name:
|
|
4370
|
-
server_name:
|
|
4371
|
-
search_type:
|
|
4372
|
-
signature:
|
|
4416
|
+
const builtinToolCallStep = import_v412.z.object({
|
|
4417
|
+
type: import_v412.z.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
|
|
4418
|
+
id: import_v412.z.string(),
|
|
4419
|
+
arguments: import_v412.z.record(import_v412.z.string(), import_v412.z.unknown()).nullish(),
|
|
4420
|
+
name: import_v412.z.string().nullish(),
|
|
4421
|
+
server_name: import_v412.z.string().nullish(),
|
|
4422
|
+
search_type: import_v412.z.string().nullish(),
|
|
4423
|
+
signature: import_v412.z.string().nullish()
|
|
4373
4424
|
}).loose();
|
|
4374
|
-
const builtinToolResultStep =
|
|
4375
|
-
type:
|
|
4376
|
-
call_id:
|
|
4377
|
-
result:
|
|
4378
|
-
is_error:
|
|
4379
|
-
name:
|
|
4380
|
-
server_name:
|
|
4381
|
-
signature:
|
|
4425
|
+
const builtinToolResultStep = import_v412.z.object({
|
|
4426
|
+
type: import_v412.z.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
|
|
4427
|
+
call_id: import_v412.z.string(),
|
|
4428
|
+
result: import_v412.z.unknown().nullish(),
|
|
4429
|
+
is_error: import_v412.z.boolean().nullish(),
|
|
4430
|
+
name: import_v412.z.string().nullish(),
|
|
4431
|
+
server_name: import_v412.z.string().nullish(),
|
|
4432
|
+
signature: import_v412.z.string().nullish()
|
|
4382
4433
|
}).loose();
|
|
4383
|
-
return
|
|
4434
|
+
return import_v412.z.union([
|
|
4384
4435
|
userInputStep,
|
|
4385
4436
|
modelOutputStep,
|
|
4386
4437
|
functionCallStep,
|
|
4387
4438
|
thoughtStep,
|
|
4388
4439
|
builtinToolCallStep,
|
|
4389
4440
|
builtinToolResultStep,
|
|
4390
|
-
|
|
4441
|
+
import_v412.z.object({ type: import_v412.z.string() }).loose()
|
|
4391
4442
|
]);
|
|
4392
4443
|
};
|
|
4393
4444
|
var googleInteractionsResponseSchema = (0, import_provider_utils14.lazySchema)(
|
|
4394
4445
|
() => (0, import_provider_utils14.zodSchema)(
|
|
4395
|
-
|
|
4446
|
+
import_v412.z.object({
|
|
4396
4447
|
/*
|
|
4397
4448
|
* `id` is omitted from the response body when `store: false` (fully
|
|
4398
4449
|
* stateless mode) — there is no server-side interaction record for the
|
|
4399
4450
|
* client to reference. `nullish` lets the schema accept that shape.
|
|
4400
4451
|
*/
|
|
4401
|
-
id:
|
|
4402
|
-
created:
|
|
4403
|
-
updated:
|
|
4452
|
+
id: import_v412.z.string().nullish(),
|
|
4453
|
+
created: import_v412.z.string().nullish(),
|
|
4454
|
+
updated: import_v412.z.string().nullish(),
|
|
4404
4455
|
status: interactionStatusSchema(),
|
|
4405
|
-
model:
|
|
4406
|
-
agent:
|
|
4407
|
-
steps:
|
|
4456
|
+
model: import_v412.z.string().nullish(),
|
|
4457
|
+
agent: import_v412.z.string().nullish(),
|
|
4458
|
+
steps: import_v412.z.array(stepSchema()).nullish(),
|
|
4408
4459
|
usage: usageSchema2().nullish(),
|
|
4409
|
-
service_tier:
|
|
4410
|
-
previous_interaction_id:
|
|
4411
|
-
response_modalities:
|
|
4460
|
+
service_tier: import_v412.z.string().nullish(),
|
|
4461
|
+
previous_interaction_id: import_v412.z.string().nullish(),
|
|
4462
|
+
response_modalities: import_v412.z.array(import_v412.z.string()).nullish()
|
|
4412
4463
|
}).loose()
|
|
4413
4464
|
)
|
|
4414
4465
|
);
|
|
@@ -4418,82 +4469,82 @@ var googleInteractionsEventSchema = (0, import_provider_utils14.lazySchema)(
|
|
|
4418
4469
|
const status = interactionStatusSchema();
|
|
4419
4470
|
const annotation = annotationSchema();
|
|
4420
4471
|
const thoughtSummaryItem = thoughtSummaryItemSchema();
|
|
4421
|
-
const interactionCreatedEvent =
|
|
4422
|
-
event_type:
|
|
4423
|
-
event_id:
|
|
4424
|
-
interaction:
|
|
4472
|
+
const interactionCreatedEvent = import_v412.z.object({
|
|
4473
|
+
event_type: import_v412.z.literal("interaction.created"),
|
|
4474
|
+
event_id: import_v412.z.string().nullish(),
|
|
4475
|
+
interaction: import_v412.z.object({
|
|
4425
4476
|
/*
|
|
4426
4477
|
* `id` is omitted when `store: false` (fully stateless mode);
|
|
4427
4478
|
* see the matching note on `googleInteractionsResponseSchema.id`.
|
|
4428
4479
|
*/
|
|
4429
|
-
id:
|
|
4430
|
-
created:
|
|
4431
|
-
model:
|
|
4432
|
-
agent:
|
|
4480
|
+
id: import_v412.z.string().nullish(),
|
|
4481
|
+
created: import_v412.z.string().nullish(),
|
|
4482
|
+
model: import_v412.z.string().nullish(),
|
|
4483
|
+
agent: import_v412.z.string().nullish(),
|
|
4433
4484
|
status: status.nullish()
|
|
4434
4485
|
}).loose()
|
|
4435
4486
|
}).loose();
|
|
4436
|
-
const stepStartEvent =
|
|
4437
|
-
event_type:
|
|
4438
|
-
event_id:
|
|
4439
|
-
index:
|
|
4487
|
+
const stepStartEvent = import_v412.z.object({
|
|
4488
|
+
event_type: import_v412.z.literal("step.start"),
|
|
4489
|
+
event_id: import_v412.z.string().nullish(),
|
|
4490
|
+
index: import_v412.z.number(),
|
|
4440
4491
|
step: stepSchema()
|
|
4441
4492
|
}).loose();
|
|
4442
|
-
const stepDeltaText =
|
|
4443
|
-
type:
|
|
4444
|
-
text:
|
|
4493
|
+
const stepDeltaText = import_v412.z.object({
|
|
4494
|
+
type: import_v412.z.literal("text"),
|
|
4495
|
+
text: import_v412.z.string()
|
|
4445
4496
|
}).loose();
|
|
4446
|
-
const stepDeltaThoughtSummary =
|
|
4447
|
-
type:
|
|
4497
|
+
const stepDeltaThoughtSummary = import_v412.z.object({
|
|
4498
|
+
type: import_v412.z.literal("thought_summary"),
|
|
4448
4499
|
content: thoughtSummaryItem.nullish()
|
|
4449
4500
|
}).loose();
|
|
4450
|
-
const stepDeltaThoughtSignature =
|
|
4451
|
-
type:
|
|
4452
|
-
signature:
|
|
4501
|
+
const stepDeltaThoughtSignature = import_v412.z.object({
|
|
4502
|
+
type: import_v412.z.literal("thought_signature"),
|
|
4503
|
+
signature: import_v412.z.string().nullish()
|
|
4453
4504
|
}).loose();
|
|
4454
|
-
const stepDeltaArgumentsDelta =
|
|
4455
|
-
type:
|
|
4456
|
-
arguments:
|
|
4457
|
-
id:
|
|
4458
|
-
signature:
|
|
4505
|
+
const stepDeltaArgumentsDelta = import_v412.z.object({
|
|
4506
|
+
type: import_v412.z.literal("arguments_delta"),
|
|
4507
|
+
arguments: import_v412.z.string().nullish(),
|
|
4508
|
+
id: import_v412.z.string().nullish(),
|
|
4509
|
+
signature: import_v412.z.string().nullish()
|
|
4459
4510
|
}).loose();
|
|
4460
|
-
const stepDeltaTextAnnotation =
|
|
4461
|
-
type:
|
|
4462
|
-
annotations:
|
|
4511
|
+
const stepDeltaTextAnnotation = import_v412.z.object({
|
|
4512
|
+
type: import_v412.z.enum(["text_annotation_delta", "text_annotation"]),
|
|
4513
|
+
annotations: import_v412.z.array(annotation).nullish()
|
|
4463
4514
|
}).loose();
|
|
4464
|
-
const stepDeltaImage =
|
|
4465
|
-
type:
|
|
4466
|
-
data:
|
|
4467
|
-
mime_type:
|
|
4468
|
-
resolution:
|
|
4469
|
-
uri:
|
|
4515
|
+
const stepDeltaImage = import_v412.z.object({
|
|
4516
|
+
type: import_v412.z.literal("image"),
|
|
4517
|
+
data: import_v412.z.string().nullish(),
|
|
4518
|
+
mime_type: import_v412.z.string().nullish(),
|
|
4519
|
+
resolution: import_v412.z.enum(["low", "medium", "high", "ultra_high"]).nullish(),
|
|
4520
|
+
uri: import_v412.z.string().nullish()
|
|
4470
4521
|
}).loose();
|
|
4471
|
-
const stepDeltaVideo =
|
|
4472
|
-
type:
|
|
4473
|
-
data:
|
|
4474
|
-
mime_type:
|
|
4475
|
-
uri:
|
|
4522
|
+
const stepDeltaVideo = import_v412.z.object({
|
|
4523
|
+
type: import_v412.z.literal("video"),
|
|
4524
|
+
data: import_v412.z.string().nullish(),
|
|
4525
|
+
mime_type: import_v412.z.string().nullish(),
|
|
4526
|
+
uri: import_v412.z.string().nullish()
|
|
4476
4527
|
}).loose();
|
|
4477
|
-
const stepDeltaBuiltinToolCall =
|
|
4478
|
-
type:
|
|
4479
|
-
id:
|
|
4480
|
-
arguments:
|
|
4481
|
-
name:
|
|
4482
|
-
server_name:
|
|
4483
|
-
search_type:
|
|
4484
|
-
signature:
|
|
4528
|
+
const stepDeltaBuiltinToolCall = import_v412.z.object({
|
|
4529
|
+
type: import_v412.z.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
|
|
4530
|
+
id: import_v412.z.string().nullish(),
|
|
4531
|
+
arguments: import_v412.z.record(import_v412.z.string(), import_v412.z.unknown()).nullish(),
|
|
4532
|
+
name: import_v412.z.string().nullish(),
|
|
4533
|
+
server_name: import_v412.z.string().nullish(),
|
|
4534
|
+
search_type: import_v412.z.string().nullish(),
|
|
4535
|
+
signature: import_v412.z.string().nullish()
|
|
4485
4536
|
}).loose();
|
|
4486
|
-
const stepDeltaBuiltinToolResult =
|
|
4487
|
-
type:
|
|
4488
|
-
call_id:
|
|
4489
|
-
result:
|
|
4490
|
-
is_error:
|
|
4491
|
-
name:
|
|
4492
|
-
server_name:
|
|
4493
|
-
signature:
|
|
4537
|
+
const stepDeltaBuiltinToolResult = import_v412.z.object({
|
|
4538
|
+
type: import_v412.z.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
|
|
4539
|
+
call_id: import_v412.z.string().nullish(),
|
|
4540
|
+
result: import_v412.z.unknown().nullish(),
|
|
4541
|
+
is_error: import_v412.z.boolean().nullish(),
|
|
4542
|
+
name: import_v412.z.string().nullish(),
|
|
4543
|
+
server_name: import_v412.z.string().nullish(),
|
|
4544
|
+
signature: import_v412.z.string().nullish()
|
|
4494
4545
|
}).loose();
|
|
4495
|
-
const stepDeltaUnknown =
|
|
4496
|
-
const stepDeltaUnion =
|
|
4546
|
+
const stepDeltaUnknown = import_v412.z.object({ type: import_v412.z.string() }).loose();
|
|
4547
|
+
const stepDeltaUnion = import_v412.z.union([
|
|
4497
4548
|
stepDeltaText,
|
|
4498
4549
|
stepDeltaImage,
|
|
4499
4550
|
stepDeltaVideo,
|
|
@@ -4505,55 +4556,55 @@ var googleInteractionsEventSchema = (0, import_provider_utils14.lazySchema)(
|
|
|
4505
4556
|
stepDeltaBuiltinToolResult,
|
|
4506
4557
|
stepDeltaUnknown
|
|
4507
4558
|
]);
|
|
4508
|
-
const stepDeltaEvent =
|
|
4509
|
-
event_type:
|
|
4510
|
-
event_id:
|
|
4511
|
-
index:
|
|
4559
|
+
const stepDeltaEvent = import_v412.z.object({
|
|
4560
|
+
event_type: import_v412.z.literal("step.delta"),
|
|
4561
|
+
event_id: import_v412.z.string().nullish(),
|
|
4562
|
+
index: import_v412.z.number(),
|
|
4512
4563
|
delta: stepDeltaUnion
|
|
4513
4564
|
}).loose();
|
|
4514
|
-
const stepStopEvent =
|
|
4515
|
-
event_type:
|
|
4516
|
-
event_id:
|
|
4517
|
-
index:
|
|
4565
|
+
const stepStopEvent = import_v412.z.object({
|
|
4566
|
+
event_type: import_v412.z.literal("step.stop"),
|
|
4567
|
+
event_id: import_v412.z.string().nullish(),
|
|
4568
|
+
index: import_v412.z.number()
|
|
4518
4569
|
}).loose();
|
|
4519
|
-
const interactionStatusUpdateEvent =
|
|
4520
|
-
event_type:
|
|
4521
|
-
event_id:
|
|
4522
|
-
interaction_id:
|
|
4570
|
+
const interactionStatusUpdateEvent = import_v412.z.object({
|
|
4571
|
+
event_type: import_v412.z.literal("interaction.status_update"),
|
|
4572
|
+
event_id: import_v412.z.string().nullish(),
|
|
4573
|
+
interaction_id: import_v412.z.string().nullish(),
|
|
4523
4574
|
status: status.nullish()
|
|
4524
4575
|
}).loose();
|
|
4525
|
-
const interactionInProgressEvent =
|
|
4526
|
-
event_type:
|
|
4527
|
-
event_id:
|
|
4528
|
-
interaction_id:
|
|
4576
|
+
const interactionInProgressEvent = import_v412.z.object({
|
|
4577
|
+
event_type: import_v412.z.literal("interaction.in_progress"),
|
|
4578
|
+
event_id: import_v412.z.string().nullish(),
|
|
4579
|
+
interaction_id: import_v412.z.string().nullish(),
|
|
4529
4580
|
status: status.nullish()
|
|
4530
4581
|
}).loose();
|
|
4531
|
-
const interactionRequiresActionEvent =
|
|
4532
|
-
event_type:
|
|
4533
|
-
event_id:
|
|
4534
|
-
interaction_id:
|
|
4582
|
+
const interactionRequiresActionEvent = import_v412.z.object({
|
|
4583
|
+
event_type: import_v412.z.literal("interaction.requires_action"),
|
|
4584
|
+
event_id: import_v412.z.string().nullish(),
|
|
4585
|
+
interaction_id: import_v412.z.string().nullish(),
|
|
4535
4586
|
status: status.nullish()
|
|
4536
4587
|
}).loose();
|
|
4537
|
-
const interactionCompletedEvent =
|
|
4538
|
-
event_type:
|
|
4539
|
-
event_id:
|
|
4540
|
-
interaction:
|
|
4541
|
-
id:
|
|
4588
|
+
const interactionCompletedEvent = import_v412.z.object({
|
|
4589
|
+
event_type: import_v412.z.literal("interaction.completed"),
|
|
4590
|
+
event_id: import_v412.z.string().nullish(),
|
|
4591
|
+
interaction: import_v412.z.object({
|
|
4592
|
+
id: import_v412.z.string().nullish(),
|
|
4542
4593
|
status: status.nullish(),
|
|
4543
4594
|
usage: usageSchema2().nullish(),
|
|
4544
|
-
service_tier:
|
|
4595
|
+
service_tier: import_v412.z.string().nullish()
|
|
4545
4596
|
}).loose()
|
|
4546
4597
|
}).loose();
|
|
4547
|
-
const errorEvent =
|
|
4548
|
-
event_type:
|
|
4549
|
-
event_id:
|
|
4550
|
-
error:
|
|
4551
|
-
code:
|
|
4552
|
-
message:
|
|
4598
|
+
const errorEvent = import_v412.z.object({
|
|
4599
|
+
event_type: import_v412.z.literal("error"),
|
|
4600
|
+
event_id: import_v412.z.string().nullish(),
|
|
4601
|
+
error: import_v412.z.object({
|
|
4602
|
+
code: import_v412.z.string().nullish(),
|
|
4603
|
+
message: import_v412.z.string().nullish()
|
|
4553
4604
|
}).loose().nullish()
|
|
4554
4605
|
}).loose();
|
|
4555
|
-
const unknownEvent =
|
|
4556
|
-
return
|
|
4606
|
+
const unknownEvent = import_v412.z.object({ event_type: import_v412.z.string() }).loose();
|
|
4607
|
+
return import_v412.z.union([
|
|
4557
4608
|
interactionCreatedEvent,
|
|
4558
4609
|
stepStartEvent,
|
|
4559
4610
|
stepDeltaEvent,
|
|
@@ -4571,26 +4622,26 @@ var googleInteractionsEventSchema = (0, import_provider_utils14.lazySchema)(
|
|
|
4571
4622
|
|
|
4572
4623
|
// src/interactions/google-interactions-language-model-options.ts
|
|
4573
4624
|
var import_provider_utils15 = require("@ai-sdk/provider-utils");
|
|
4574
|
-
var
|
|
4625
|
+
var import_v413 = require("zod/v4");
|
|
4575
4626
|
var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySchema)(
|
|
4576
4627
|
() => (0, import_provider_utils15.zodSchema)(
|
|
4577
|
-
|
|
4578
|
-
previousInteractionId:
|
|
4579
|
-
store:
|
|
4580
|
-
agent:
|
|
4581
|
-
agentConfig:
|
|
4582
|
-
|
|
4583
|
-
type:
|
|
4628
|
+
import_v413.z.object({
|
|
4629
|
+
previousInteractionId: import_v413.z.string().nullish(),
|
|
4630
|
+
store: import_v413.z.boolean().nullish(),
|
|
4631
|
+
agent: import_v413.z.string().nullish(),
|
|
4632
|
+
agentConfig: import_v413.z.union([
|
|
4633
|
+
import_v413.z.object({
|
|
4634
|
+
type: import_v413.z.literal("dynamic")
|
|
4584
4635
|
}).loose(),
|
|
4585
|
-
|
|
4586
|
-
type:
|
|
4587
|
-
thinkingSummaries:
|
|
4588
|
-
visualization:
|
|
4589
|
-
collaborativePlanning:
|
|
4636
|
+
import_v413.z.object({
|
|
4637
|
+
type: import_v413.z.literal("deep-research"),
|
|
4638
|
+
thinkingSummaries: import_v413.z.enum(["auto", "none"]).nullish(),
|
|
4639
|
+
visualization: import_v413.z.enum(["off", "auto"]).nullish(),
|
|
4640
|
+
collaborativePlanning: import_v413.z.boolean().nullish()
|
|
4590
4641
|
})
|
|
4591
4642
|
]).nullish(),
|
|
4592
|
-
thinkingLevel:
|
|
4593
|
-
thinkingSummaries:
|
|
4643
|
+
thinkingLevel: import_v413.z.enum(["minimal", "low", "medium", "high"]).nullish(),
|
|
4644
|
+
thinkingSummaries: import_v413.z.enum(["auto", "none"]).nullish(),
|
|
4594
4645
|
/**
|
|
4595
4646
|
* Output-format entries that map directly to the API's `response_format`
|
|
4596
4647
|
* array. Use this to request image, audio, video, or non-JSON text
|
|
@@ -4600,17 +4651,17 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
|
|
|
4600
4651
|
* type: 'json', schema }` still drives JSON-mode and adds a matching
|
|
4601
4652
|
* text entry automatically; entries listed here are appended.
|
|
4602
4653
|
*/
|
|
4603
|
-
responseFormat:
|
|
4604
|
-
|
|
4605
|
-
|
|
4606
|
-
type:
|
|
4607
|
-
mimeType:
|
|
4608
|
-
schema:
|
|
4654
|
+
responseFormat: import_v413.z.array(
|
|
4655
|
+
import_v413.z.union([
|
|
4656
|
+
import_v413.z.object({
|
|
4657
|
+
type: import_v413.z.literal("text"),
|
|
4658
|
+
mimeType: import_v413.z.string().nullish(),
|
|
4659
|
+
schema: import_v413.z.unknown().nullish()
|
|
4609
4660
|
}).loose(),
|
|
4610
|
-
|
|
4611
|
-
type:
|
|
4612
|
-
mimeType:
|
|
4613
|
-
aspectRatio:
|
|
4661
|
+
import_v413.z.object({
|
|
4662
|
+
type: import_v413.z.literal("image"),
|
|
4663
|
+
mimeType: import_v413.z.string().nullish(),
|
|
4664
|
+
aspectRatio: import_v413.z.enum([
|
|
4614
4665
|
"1:1",
|
|
4615
4666
|
"2:3",
|
|
4616
4667
|
"3:2",
|
|
@@ -4626,19 +4677,19 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
|
|
|
4626
4677
|
"1:4",
|
|
4627
4678
|
"4:1"
|
|
4628
4679
|
]).nullish(),
|
|
4629
|
-
imageSize:
|
|
4680
|
+
imageSize: import_v413.z.enum(["1K", "2K", "4K", "512"]).nullish()
|
|
4630
4681
|
}).loose(),
|
|
4631
|
-
|
|
4632
|
-
type:
|
|
4633
|
-
mimeType:
|
|
4682
|
+
import_v413.z.object({
|
|
4683
|
+
type: import_v413.z.literal("audio"),
|
|
4684
|
+
mimeType: import_v413.z.string().nullish()
|
|
4634
4685
|
}).loose(),
|
|
4635
|
-
|
|
4636
|
-
type:
|
|
4637
|
-
aspectRatio:
|
|
4638
|
-
resolution:
|
|
4639
|
-
duration:
|
|
4640
|
-
delivery:
|
|
4641
|
-
gcsUri:
|
|
4686
|
+
import_v413.z.object({
|
|
4687
|
+
type: import_v413.z.literal("video"),
|
|
4688
|
+
aspectRatio: import_v413.z.enum(["16:9", "9:16"]).nullish(),
|
|
4689
|
+
resolution: import_v413.z.enum(["360p", "720p", "1080p", "4k"]).nullish(),
|
|
4690
|
+
duration: import_v413.z.string().nullish(),
|
|
4691
|
+
delivery: import_v413.z.enum(["inline", "uri"]).nullish(),
|
|
4692
|
+
gcsUri: import_v413.z.string().nullish()
|
|
4642
4693
|
}).loose()
|
|
4643
4694
|
])
|
|
4644
4695
|
).nullish(),
|
|
@@ -4648,8 +4699,8 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
|
|
|
4648
4699
|
* translates it into a matching `response_format` image entry and
|
|
4649
4700
|
* emits a warning when set.
|
|
4650
4701
|
*/
|
|
4651
|
-
imageConfig:
|
|
4652
|
-
aspectRatio:
|
|
4702
|
+
imageConfig: import_v413.z.object({
|
|
4703
|
+
aspectRatio: import_v413.z.enum([
|
|
4653
4704
|
"1:1",
|
|
4654
4705
|
"2:3",
|
|
4655
4706
|
"3:2",
|
|
@@ -4665,35 +4716,35 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
|
|
|
4665
4716
|
"1:4",
|
|
4666
4717
|
"4:1"
|
|
4667
4718
|
]).nullish(),
|
|
4668
|
-
imageSize:
|
|
4719
|
+
imageSize: import_v413.z.enum(["1K", "2K", "4K", "512"]).nullish()
|
|
4669
4720
|
}).nullish(),
|
|
4670
|
-
mediaResolution:
|
|
4671
|
-
responseModalities:
|
|
4672
|
-
serviceTier:
|
|
4721
|
+
mediaResolution: import_v413.z.enum(["low", "medium", "high", "ultra_high"]).nullish(),
|
|
4722
|
+
responseModalities: import_v413.z.array(import_v413.z.enum(["text", "image", "audio", "video", "document"])).nullish(),
|
|
4723
|
+
serviceTier: import_v413.z.enum(["flex", "standard", "priority"]).nullish(),
|
|
4673
4724
|
/**
|
|
4674
4725
|
* Alternative to AI SDK `system` message. If both are set, the AI SDK
|
|
4675
4726
|
* `system` message wins and a warning is emitted.
|
|
4676
4727
|
*/
|
|
4677
|
-
systemInstruction:
|
|
4728
|
+
systemInstruction: import_v413.z.string().nullish(),
|
|
4678
4729
|
/**
|
|
4679
4730
|
* Per-block signature for round-tripping `thought.signature` and
|
|
4680
4731
|
* `function_call.signature` blocks. Set by the SDK on output reasoning /
|
|
4681
4732
|
* tool-call parts; passed back unchanged on input parts so the API
|
|
4682
4733
|
* accepts the prior turn.
|
|
4683
4734
|
*/
|
|
4684
|
-
signature:
|
|
4735
|
+
signature: import_v413.z.string().nullish(),
|
|
4685
4736
|
/**
|
|
4686
4737
|
* Set by the SDK on output assistant messages. The converter uses it to
|
|
4687
4738
|
* decide which messages to drop when compacting under
|
|
4688
4739
|
* `previousInteractionId`.
|
|
4689
4740
|
*/
|
|
4690
|
-
interactionId:
|
|
4741
|
+
interactionId: import_v413.z.string().nullish(),
|
|
4691
4742
|
/**
|
|
4692
4743
|
* Maximum time, in milliseconds, to poll a background interaction (agent
|
|
4693
4744
|
* call) before giving up. Defaults to 30 minutes. Long-running agents
|
|
4694
4745
|
* such as deep research can take tens of minutes — increase if needed.
|
|
4695
4746
|
*/
|
|
4696
|
-
pollingTimeoutMs:
|
|
4747
|
+
pollingTimeoutMs: import_v413.z.number().int().positive().nullish(),
|
|
4697
4748
|
/**
|
|
4698
4749
|
* Run the interaction in the background. Required for agents whose
|
|
4699
4750
|
* server-side workflow cannot complete within a single request/response.
|
|
@@ -4702,7 +4753,7 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
|
|
|
4702
4753
|
* reject `true`; see the agent's documentation for which mode it
|
|
4703
4754
|
* requires.
|
|
4704
4755
|
*/
|
|
4705
|
-
background:
|
|
4756
|
+
background: import_v413.z.boolean().nullish(),
|
|
4706
4757
|
/**
|
|
4707
4758
|
* Environment configuration for the agent sandbox. Only applies to agent
|
|
4708
4759
|
* calls (`google.interactions({ agent })`); ignored on model-id calls.
|
|
@@ -4712,36 +4763,36 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
|
|
|
4712
4763
|
* - object: provision a fresh sandbox and optionally preload `sources`
|
|
4713
4764
|
* and/or constrain outbound traffic via `network`.
|
|
4714
4765
|
*/
|
|
4715
|
-
environment:
|
|
4716
|
-
|
|
4717
|
-
|
|
4718
|
-
type:
|
|
4719
|
-
sources:
|
|
4720
|
-
|
|
4721
|
-
|
|
4722
|
-
type:
|
|
4723
|
-
source:
|
|
4724
|
-
target:
|
|
4766
|
+
environment: import_v413.z.union([
|
|
4767
|
+
import_v413.z.string(),
|
|
4768
|
+
import_v413.z.object({
|
|
4769
|
+
type: import_v413.z.literal("remote"),
|
|
4770
|
+
sources: import_v413.z.array(
|
|
4771
|
+
import_v413.z.union([
|
|
4772
|
+
import_v413.z.object({
|
|
4773
|
+
type: import_v413.z.literal("gcs"),
|
|
4774
|
+
source: import_v413.z.string(),
|
|
4775
|
+
target: import_v413.z.string().nullish()
|
|
4725
4776
|
}),
|
|
4726
|
-
|
|
4727
|
-
type:
|
|
4728
|
-
source:
|
|
4729
|
-
target:
|
|
4777
|
+
import_v413.z.object({
|
|
4778
|
+
type: import_v413.z.literal("repository"),
|
|
4779
|
+
source: import_v413.z.string(),
|
|
4780
|
+
target: import_v413.z.string().nullish()
|
|
4730
4781
|
}),
|
|
4731
|
-
|
|
4732
|
-
type:
|
|
4733
|
-
content:
|
|
4734
|
-
target:
|
|
4782
|
+
import_v413.z.object({
|
|
4783
|
+
type: import_v413.z.literal("inline"),
|
|
4784
|
+
content: import_v413.z.string(),
|
|
4785
|
+
target: import_v413.z.string()
|
|
4735
4786
|
})
|
|
4736
4787
|
])
|
|
4737
4788
|
).nullish(),
|
|
4738
|
-
network:
|
|
4739
|
-
|
|
4740
|
-
|
|
4741
|
-
allowlist:
|
|
4742
|
-
|
|
4743
|
-
domain:
|
|
4744
|
-
transform:
|
|
4789
|
+
network: import_v413.z.union([
|
|
4790
|
+
import_v413.z.literal("disabled"),
|
|
4791
|
+
import_v413.z.object({
|
|
4792
|
+
allowlist: import_v413.z.array(
|
|
4793
|
+
import_v413.z.object({
|
|
4794
|
+
domain: import_v413.z.string(),
|
|
4795
|
+
transform: import_v413.z.array(import_v413.z.record(import_v413.z.string(), import_v413.z.string())).nullish()
|
|
4745
4796
|
})
|
|
4746
4797
|
)
|
|
4747
4798
|
})
|