@ai-sdk/google 3.0.139 → 3.0.140
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +536 -516
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +536 -516
- package/dist/index.mjs.map +1 -1
- package/dist/internal/index.js +510 -490
- package/dist/internal/index.js.map +1 -1
- package/dist/internal/index.mjs +510 -490
- package/dist/internal/index.mjs.map +1 -1
- package/docs/15-google-generative-ai.mdx +18 -2
- package/package.json +2 -2
- package/src/convert-to-google-generative-ai-messages.ts +17 -5
- package/src/google-generative-ai-prompt.ts +21 -2
- package/src/index.ts +4 -1
package/dist/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
|
);
|
|
@@ -2734,205 +2754,205 @@ function extractSources({
|
|
|
2734
2754
|
}
|
|
2735
2755
|
return sources.length > 0 ? sources : void 0;
|
|
2736
2756
|
}
|
|
2737
|
-
var getGroundingMetadataSchema = () =>
|
|
2738
|
-
webSearchQueries:
|
|
2739
|
-
imageSearchQueries:
|
|
2740
|
-
retrievalQueries:
|
|
2741
|
-
searchEntryPoint:
|
|
2742
|
-
groundingChunks:
|
|
2743
|
-
|
|
2744
|
-
web:
|
|
2745
|
-
image:
|
|
2746
|
-
sourceUri:
|
|
2747
|
-
imageUri:
|
|
2748
|
-
title:
|
|
2749
|
-
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()
|
|
2750
2770
|
}).nullish(),
|
|
2751
|
-
retrievedContext:
|
|
2752
|
-
uri:
|
|
2753
|
-
title:
|
|
2754
|
-
text:
|
|
2755
|
-
fileSearchStore:
|
|
2756
|
-
customMetadata:
|
|
2757
|
-
|
|
2758
|
-
key:
|
|
2759
|
-
stringValue:
|
|
2760
|
-
numericValue:
|
|
2761
|
-
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()
|
|
2762
2782
|
})
|
|
2763
2783
|
).nullish()
|
|
2764
2784
|
}).nullish(),
|
|
2765
|
-
maps:
|
|
2766
|
-
uri:
|
|
2767
|
-
title:
|
|
2768
|
-
text:
|
|
2769
|
-
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()
|
|
2770
2790
|
}).nullish()
|
|
2771
2791
|
})
|
|
2772
2792
|
).nullish(),
|
|
2773
|
-
groundingSupports:
|
|
2774
|
-
|
|
2775
|
-
segment:
|
|
2776
|
-
startIndex:
|
|
2777
|
-
endIndex:
|
|
2778
|
-
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()
|
|
2779
2799
|
}).nullish(),
|
|
2780
|
-
segment_text:
|
|
2781
|
-
groundingChunkIndices:
|
|
2782
|
-
supportChunkIndices:
|
|
2783
|
-
confidenceScores:
|
|
2784
|
-
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()
|
|
2785
2805
|
})
|
|
2786
2806
|
).nullish(),
|
|
2787
|
-
retrievalMetadata:
|
|
2788
|
-
|
|
2789
|
-
webDynamicRetrievalScore:
|
|
2807
|
+
retrievalMetadata: import_v44.z.union([
|
|
2808
|
+
import_v44.z.object({
|
|
2809
|
+
webDynamicRetrievalScore: import_v44.z.number()
|
|
2790
2810
|
}),
|
|
2791
|
-
|
|
2811
|
+
import_v44.z.object({})
|
|
2792
2812
|
]).nullish()
|
|
2793
2813
|
});
|
|
2794
|
-
var partialArgSchema = () =>
|
|
2795
|
-
jsonPath:
|
|
2796
|
-
stringValue:
|
|
2797
|
-
numberValue:
|
|
2798
|
-
boolValue:
|
|
2799
|
-
nullValue:
|
|
2800
|
-
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()
|
|
2801
2821
|
});
|
|
2802
|
-
var getContentSchema = () =>
|
|
2803
|
-
parts:
|
|
2804
|
-
|
|
2822
|
+
var getContentSchema = () => import_v44.z.object({
|
|
2823
|
+
parts: import_v44.z.array(
|
|
2824
|
+
import_v44.z.union([
|
|
2805
2825
|
// note: order matters since text can be fully empty
|
|
2806
|
-
|
|
2807
|
-
functionCall:
|
|
2808
|
-
id:
|
|
2809
|
-
name:
|
|
2810
|
-
args:
|
|
2811
|
-
partialArgs:
|
|
2812
|
-
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()
|
|
2813
2833
|
}),
|
|
2814
|
-
thoughtSignature:
|
|
2834
|
+
thoughtSignature: import_v44.z.string().nullish()
|
|
2815
2835
|
}),
|
|
2816
|
-
|
|
2817
|
-
inlineData:
|
|
2818
|
-
mimeType:
|
|
2819
|
-
data:
|
|
2836
|
+
import_v44.z.object({
|
|
2837
|
+
inlineData: import_v44.z.object({
|
|
2838
|
+
mimeType: import_v44.z.string(),
|
|
2839
|
+
data: import_v44.z.string()
|
|
2820
2840
|
}),
|
|
2821
|
-
thought:
|
|
2822
|
-
thoughtSignature:
|
|
2841
|
+
thought: import_v44.z.boolean().nullish(),
|
|
2842
|
+
thoughtSignature: import_v44.z.string().nullish()
|
|
2823
2843
|
}),
|
|
2824
|
-
|
|
2825
|
-
toolCall:
|
|
2826
|
-
toolType:
|
|
2827
|
-
args:
|
|
2828
|
-
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()
|
|
2829
2849
|
}),
|
|
2830
|
-
thoughtSignature:
|
|
2850
|
+
thoughtSignature: import_v44.z.string().nullish()
|
|
2831
2851
|
}),
|
|
2832
|
-
|
|
2833
|
-
toolResponse:
|
|
2834
|
-
toolType:
|
|
2835
|
-
response:
|
|
2836
|
-
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()
|
|
2837
2857
|
}),
|
|
2838
|
-
thoughtSignature:
|
|
2858
|
+
thoughtSignature: import_v44.z.string().nullish()
|
|
2839
2859
|
}),
|
|
2840
|
-
|
|
2841
|
-
executableCode:
|
|
2842
|
-
language:
|
|
2843
|
-
code:
|
|
2860
|
+
import_v44.z.object({
|
|
2861
|
+
executableCode: import_v44.z.object({
|
|
2862
|
+
language: import_v44.z.string(),
|
|
2863
|
+
code: import_v44.z.string()
|
|
2844
2864
|
}).nullish(),
|
|
2845
|
-
codeExecutionResult:
|
|
2846
|
-
outcome:
|
|
2847
|
-
output:
|
|
2865
|
+
codeExecutionResult: import_v44.z.object({
|
|
2866
|
+
outcome: import_v44.z.string(),
|
|
2867
|
+
output: import_v44.z.string().nullish()
|
|
2848
2868
|
}).nullish(),
|
|
2849
|
-
text:
|
|
2850
|
-
thought:
|
|
2851
|
-
thoughtSignature:
|
|
2869
|
+
text: import_v44.z.string().nullish(),
|
|
2870
|
+
thought: import_v44.z.boolean().nullish(),
|
|
2871
|
+
thoughtSignature: import_v44.z.string().nullish()
|
|
2852
2872
|
})
|
|
2853
2873
|
])
|
|
2854
2874
|
).nullish()
|
|
2855
2875
|
});
|
|
2856
|
-
var getSafetyRatingSchema = () =>
|
|
2857
|
-
category:
|
|
2858
|
-
probability:
|
|
2859
|
-
probabilityScore:
|
|
2860
|
-
severity:
|
|
2861
|
-
severityScore:
|
|
2862
|
-
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()
|
|
2863
2883
|
});
|
|
2864
|
-
var tokenDetailsSchema = () =>
|
|
2865
|
-
|
|
2866
|
-
modality:
|
|
2867
|
-
tokenCount:
|
|
2868
|
-
}).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())
|
|
2869
2889
|
).nullish();
|
|
2870
|
-
var usageSchema = () =>
|
|
2871
|
-
cachedContentTokenCount:
|
|
2872
|
-
thoughtsTokenCount:
|
|
2873
|
-
promptTokenCount:
|
|
2874
|
-
candidatesTokenCount:
|
|
2875
|
-
toolUsePromptTokenCount:
|
|
2876
|
-
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(),
|
|
2877
2897
|
// https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerateContentResponse#TrafficType
|
|
2878
|
-
trafficType:
|
|
2879
|
-
serviceTier:
|
|
2898
|
+
trafficType: import_v44.z.string().nullish(),
|
|
2899
|
+
serviceTier: import_v44.z.string().nullish(),
|
|
2880
2900
|
// https://ai.google.dev/api/generate-content#Modality
|
|
2881
2901
|
promptTokensDetails: tokenDetailsSchema(),
|
|
2882
2902
|
cacheTokensDetails: tokenDetailsSchema(),
|
|
2883
2903
|
candidatesTokensDetails: tokenDetailsSchema(),
|
|
2884
2904
|
toolUsePromptTokensDetails: tokenDetailsSchema()
|
|
2885
|
-
}).catchall(
|
|
2886
|
-
var getUrlContextMetadataSchema = () =>
|
|
2887
|
-
urlMetadata:
|
|
2888
|
-
|
|
2889
|
-
retrievedUrl:
|
|
2890
|
-
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()
|
|
2891
2911
|
})
|
|
2892
2912
|
).nullish()
|
|
2893
2913
|
});
|
|
2894
2914
|
var responseSchema = (0, import_provider_utils5.lazySchema)(
|
|
2895
2915
|
() => (0, import_provider_utils5.zodSchema)(
|
|
2896
|
-
|
|
2897
|
-
responseId:
|
|
2898
|
-
candidates:
|
|
2899
|
-
|
|
2900
|
-
content: getContentSchema().nullish().or(
|
|
2901
|
-
finishReason:
|
|
2902
|
-
finishMessage:
|
|
2903
|
-
continuationToken:
|
|
2904
|
-
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(),
|
|
2905
2925
|
groundingMetadata: getGroundingMetadataSchema().nullish(),
|
|
2906
2926
|
urlContextMetadata: getUrlContextMetadataSchema().nullish()
|
|
2907
2927
|
})
|
|
2908
2928
|
).nullish(),
|
|
2909
2929
|
usageMetadata: usageSchema().nullish(),
|
|
2910
|
-
promptFeedback:
|
|
2911
|
-
blockReason:
|
|
2912
|
-
safetyRatings:
|
|
2930
|
+
promptFeedback: import_v44.z.object({
|
|
2931
|
+
blockReason: import_v44.z.string().nullish(),
|
|
2932
|
+
safetyRatings: import_v44.z.array(getSafetyRatingSchema()).nullish()
|
|
2913
2933
|
}).nullish()
|
|
2914
2934
|
})
|
|
2915
2935
|
)
|
|
2916
2936
|
);
|
|
2917
2937
|
var chunkSchema = (0, import_provider_utils5.lazySchema)(
|
|
2918
2938
|
() => (0, import_provider_utils5.zodSchema)(
|
|
2919
|
-
|
|
2920
|
-
responseId:
|
|
2921
|
-
candidates:
|
|
2922
|
-
|
|
2939
|
+
import_v44.z.object({
|
|
2940
|
+
responseId: import_v44.z.string().nullish(),
|
|
2941
|
+
candidates: import_v44.z.array(
|
|
2942
|
+
import_v44.z.object({
|
|
2923
2943
|
content: getContentSchema().nullish(),
|
|
2924
|
-
finishReason:
|
|
2925
|
-
finishMessage:
|
|
2926
|
-
continuationToken:
|
|
2927
|
-
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(),
|
|
2928
2948
|
groundingMetadata: getGroundingMetadataSchema().nullish(),
|
|
2929
2949
|
urlContextMetadata: getUrlContextMetadataSchema().nullish()
|
|
2930
2950
|
})
|
|
2931
2951
|
).nullish(),
|
|
2932
2952
|
usageMetadata: usageSchema().nullish(),
|
|
2933
|
-
promptFeedback:
|
|
2934
|
-
blockReason:
|
|
2935
|
-
safetyRatings:
|
|
2953
|
+
promptFeedback: import_v44.z.object({
|
|
2954
|
+
blockReason: import_v44.z.string().nullish(),
|
|
2955
|
+
safetyRatings: import_v44.z.array(getSafetyRatingSchema()).nullish()
|
|
2936
2956
|
}).nullish()
|
|
2937
2957
|
})
|
|
2938
2958
|
)
|
|
@@ -2943,43 +2963,43 @@ function isConfirmedPromptBlockReason(blockReason) {
|
|
|
2943
2963
|
|
|
2944
2964
|
// src/tool/code-execution.ts
|
|
2945
2965
|
var import_provider_utils6 = require("@ai-sdk/provider-utils");
|
|
2946
|
-
var
|
|
2966
|
+
var import_v45 = require("zod/v4");
|
|
2947
2967
|
var codeExecution = (0, import_provider_utils6.createProviderToolFactoryWithOutputSchema)({
|
|
2948
2968
|
id: "google.code_execution",
|
|
2949
|
-
inputSchema:
|
|
2950
|
-
language:
|
|
2951
|
-
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.")
|
|
2952
2972
|
}),
|
|
2953
|
-
outputSchema:
|
|
2954
|
-
outcome:
|
|
2955
|
-
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.")
|
|
2956
2976
|
})
|
|
2957
2977
|
});
|
|
2958
2978
|
|
|
2959
2979
|
// src/tool/enterprise-web-search.ts
|
|
2960
2980
|
var import_provider_utils7 = require("@ai-sdk/provider-utils");
|
|
2961
|
-
var
|
|
2981
|
+
var import_v46 = require("zod/v4");
|
|
2962
2982
|
var enterpriseWebSearch = (0, import_provider_utils7.createProviderToolFactory)({
|
|
2963
2983
|
id: "google.enterprise_web_search",
|
|
2964
|
-
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({})))
|
|
2965
2985
|
});
|
|
2966
2986
|
|
|
2967
2987
|
// src/tool/file-search.ts
|
|
2968
2988
|
var import_provider_utils8 = require("@ai-sdk/provider-utils");
|
|
2969
|
-
var
|
|
2970
|
-
var fileSearchArgsBaseSchema = () =>
|
|
2989
|
+
var import_v47 = require("zod/v4");
|
|
2990
|
+
var fileSearchArgsBaseSchema = () => import_v47.z.object({
|
|
2971
2991
|
/** The names of the file_search_stores to retrieve from.
|
|
2972
2992
|
* Example: `fileSearchStores/my-file-search-store-123`
|
|
2973
2993
|
*/
|
|
2974
|
-
fileSearchStoreNames:
|
|
2994
|
+
fileSearchStoreNames: import_v47.z.array(import_v47.z.string()).describe(
|
|
2975
2995
|
"The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`"
|
|
2976
2996
|
),
|
|
2977
2997
|
/** The number of file search retrieval chunks to retrieve. */
|
|
2978
|
-
topK:
|
|
2998
|
+
topK: import_v47.z.number().int().positive().describe("The number of file search retrieval chunks to retrieve.").optional(),
|
|
2979
2999
|
/** Metadata filter to apply to the file search retrieval documents.
|
|
2980
3000
|
* See https://google.aip.dev/160 for the syntax of the filter expression.
|
|
2981
3001
|
*/
|
|
2982
|
-
metadataFilter:
|
|
3002
|
+
metadataFilter: import_v47.z.string().describe(
|
|
2983
3003
|
"Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression."
|
|
2984
3004
|
).optional()
|
|
2985
3005
|
}).passthrough();
|
|
@@ -2993,23 +3013,23 @@ var fileSearch = (0, import_provider_utils8.createProviderToolFactory)({
|
|
|
2993
3013
|
|
|
2994
3014
|
// src/tool/google-maps.ts
|
|
2995
3015
|
var import_provider_utils9 = require("@ai-sdk/provider-utils");
|
|
2996
|
-
var
|
|
3016
|
+
var import_v48 = require("zod/v4");
|
|
2997
3017
|
var googleMaps = (0, import_provider_utils9.createProviderToolFactory)({
|
|
2998
3018
|
id: "google.google_maps",
|
|
2999
|
-
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({})))
|
|
3000
3020
|
});
|
|
3001
3021
|
|
|
3002
3022
|
// src/tool/google-search.ts
|
|
3003
3023
|
var import_provider_utils10 = require("@ai-sdk/provider-utils");
|
|
3004
|
-
var
|
|
3005
|
-
var googleSearchToolArgsBaseSchema = () =>
|
|
3006
|
-
searchTypes:
|
|
3007
|
-
webSearch:
|
|
3008
|
-
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()
|
|
3009
3029
|
}).optional(),
|
|
3010
|
-
timeRangeFilter:
|
|
3011
|
-
startTime:
|
|
3012
|
-
endTime:
|
|
3030
|
+
timeRangeFilter: import_v49.z.object({
|
|
3031
|
+
startTime: import_v49.z.string(),
|
|
3032
|
+
endTime: import_v49.z.string()
|
|
3013
3033
|
}).optional()
|
|
3014
3034
|
}).passthrough();
|
|
3015
3035
|
var googleSearchToolArgsSchema = (0, import_provider_utils10.lazySchema)(
|
|
@@ -3024,20 +3044,20 @@ var googleSearch = (0, import_provider_utils10.createProviderToolFactory)(
|
|
|
3024
3044
|
|
|
3025
3045
|
// src/tool/url-context.ts
|
|
3026
3046
|
var import_provider_utils11 = require("@ai-sdk/provider-utils");
|
|
3027
|
-
var
|
|
3047
|
+
var import_v410 = require("zod/v4");
|
|
3028
3048
|
var urlContext = (0, import_provider_utils11.createProviderToolFactory)({
|
|
3029
3049
|
id: "google.url_context",
|
|
3030
|
-
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({})))
|
|
3031
3051
|
});
|
|
3032
3052
|
|
|
3033
3053
|
// src/tool/vertex-rag-store.ts
|
|
3034
3054
|
var import_provider_utils12 = require("@ai-sdk/provider-utils");
|
|
3035
|
-
var
|
|
3055
|
+
var import_v411 = require("zod/v4");
|
|
3036
3056
|
var vertexRagStore = (0, import_provider_utils12.createProviderToolFactory)({
|
|
3037
3057
|
id: "google.vertex_rag_store",
|
|
3038
|
-
inputSchema:
|
|
3039
|
-
ragCorpus:
|
|
3040
|
-
topK:
|
|
3058
|
+
inputSchema: import_v411.z.object({
|
|
3059
|
+
ragCorpus: import_v411.z.string(),
|
|
3060
|
+
topK: import_v411.z.number().optional()
|
|
3041
3061
|
})
|
|
3042
3062
|
});
|
|
3043
3063
|
|
|
@@ -4259,30 +4279,30 @@ ${block.text}`
|
|
|
4259
4279
|
|
|
4260
4280
|
// src/interactions/google-interactions-api.ts
|
|
4261
4281
|
var import_provider_utils14 = require("@ai-sdk/provider-utils");
|
|
4262
|
-
var
|
|
4263
|
-
var tokenByModalitySchema = () =>
|
|
4264
|
-
modality:
|
|
4265
|
-
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()
|
|
4266
4286
|
}).loose();
|
|
4267
|
-
var usageSchema2 = () =>
|
|
4268
|
-
total_input_tokens:
|
|
4269
|
-
total_output_tokens:
|
|
4270
|
-
total_thought_tokens:
|
|
4271
|
-
total_cached_tokens:
|
|
4272
|
-
total_tool_use_tokens:
|
|
4273
|
-
total_tokens:
|
|
4274
|
-
input_tokens_by_modality:
|
|
4275
|
-
output_tokens_by_modality:
|
|
4276
|
-
cached_tokens_by_modality:
|
|
4277
|
-
tool_use_tokens_by_modality:
|
|
4278
|
-
grounding_tool_count:
|
|
4279
|
-
|
|
4280
|
-
type:
|
|
4281
|
-
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()
|
|
4282
4302
|
}).loose()
|
|
4283
4303
|
).nullish()
|
|
4284
4304
|
}).loose();
|
|
4285
|
-
var interactionStatusSchema = () =>
|
|
4305
|
+
var interactionStatusSchema = () => import_v412.z.enum([
|
|
4286
4306
|
"in_progress",
|
|
4287
4307
|
"requires_action",
|
|
4288
4308
|
"completed",
|
|
@@ -4291,69 +4311,69 @@ var interactionStatusSchema = () => import_v411.z.enum([
|
|
|
4291
4311
|
"incomplete"
|
|
4292
4312
|
]);
|
|
4293
4313
|
var annotationSchema = () => {
|
|
4294
|
-
const urlCitation =
|
|
4295
|
-
type:
|
|
4296
|
-
url:
|
|
4297
|
-
title:
|
|
4298
|
-
start_index:
|
|
4299
|
-
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()
|
|
4300
4320
|
}).loose();
|
|
4301
|
-
const fileCitation =
|
|
4302
|
-
type:
|
|
4303
|
-
file_name:
|
|
4304
|
-
document_uri:
|
|
4305
|
-
url:
|
|
4306
|
-
page_number:
|
|
4307
|
-
media_id:
|
|
4308
|
-
start_index:
|
|
4309
|
-
end_index:
|
|
4310
|
-
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()
|
|
4311
4331
|
}).loose();
|
|
4312
|
-
const placeCitation =
|
|
4313
|
-
type:
|
|
4314
|
-
name:
|
|
4315
|
-
url:
|
|
4316
|
-
place_id:
|
|
4317
|
-
start_index:
|
|
4318
|
-
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()
|
|
4319
4339
|
}).loose();
|
|
4320
|
-
return
|
|
4340
|
+
return import_v412.z.union([
|
|
4321
4341
|
urlCitation,
|
|
4322
4342
|
fileCitation,
|
|
4323
4343
|
placeCitation,
|
|
4324
|
-
|
|
4344
|
+
import_v412.z.object({ type: import_v412.z.string() }).loose()
|
|
4325
4345
|
]);
|
|
4326
4346
|
};
|
|
4327
|
-
var thoughtSummaryItemSchema = () =>
|
|
4328
|
-
type:
|
|
4329
|
-
text:
|
|
4330
|
-
data:
|
|
4331
|
-
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()
|
|
4332
4352
|
}).loose();
|
|
4333
4353
|
var contentBlockSchema = () => {
|
|
4334
|
-
const textContent =
|
|
4335
|
-
type:
|
|
4336
|
-
text:
|
|
4337
|
-
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()
|
|
4338
4358
|
}).loose();
|
|
4339
|
-
const imageContent =
|
|
4340
|
-
type:
|
|
4341
|
-
data:
|
|
4342
|
-
mime_type:
|
|
4343
|
-
resolution:
|
|
4344
|
-
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()
|
|
4345
4365
|
}).loose();
|
|
4346
|
-
const videoContent =
|
|
4347
|
-
type:
|
|
4348
|
-
data:
|
|
4349
|
-
mime_type:
|
|
4350
|
-
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()
|
|
4351
4371
|
}).loose();
|
|
4352
|
-
return
|
|
4372
|
+
return import_v412.z.union([
|
|
4353
4373
|
textContent,
|
|
4354
4374
|
imageContent,
|
|
4355
4375
|
videoContent,
|
|
4356
|
-
|
|
4376
|
+
import_v412.z.object({ type: import_v412.z.string() }).loose()
|
|
4357
4377
|
]);
|
|
4358
4378
|
};
|
|
4359
4379
|
var BUILTIN_TOOL_CALL_STEP_TYPES = [
|
|
@@ -4373,73 +4393,73 @@ var BUILTIN_TOOL_RESULT_STEP_TYPES = [
|
|
|
4373
4393
|
"mcp_server_tool_result"
|
|
4374
4394
|
];
|
|
4375
4395
|
var stepSchema = () => {
|
|
4376
|
-
const userInputStep =
|
|
4377
|
-
type:
|
|
4378
|
-
content:
|
|
4396
|
+
const userInputStep = import_v412.z.object({
|
|
4397
|
+
type: import_v412.z.literal("user_input"),
|
|
4398
|
+
content: import_v412.z.array(contentBlockSchema()).nullish()
|
|
4379
4399
|
}).loose();
|
|
4380
|
-
const modelOutputStep =
|
|
4381
|
-
type:
|
|
4382
|
-
content:
|
|
4400
|
+
const modelOutputStep = import_v412.z.object({
|
|
4401
|
+
type: import_v412.z.literal("model_output"),
|
|
4402
|
+
content: import_v412.z.array(contentBlockSchema()).nullish()
|
|
4383
4403
|
}).loose();
|
|
4384
|
-
const functionCallStep =
|
|
4385
|
-
type:
|
|
4386
|
-
id:
|
|
4387
|
-
name:
|
|
4388
|
-
arguments:
|
|
4389
|
-
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()
|
|
4390
4410
|
}).loose();
|
|
4391
|
-
const thoughtStep =
|
|
4392
|
-
type:
|
|
4393
|
-
signature:
|
|
4394
|
-
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()
|
|
4395
4415
|
}).loose();
|
|
4396
|
-
const builtinToolCallStep =
|
|
4397
|
-
type:
|
|
4398
|
-
id:
|
|
4399
|
-
arguments:
|
|
4400
|
-
name:
|
|
4401
|
-
server_name:
|
|
4402
|
-
search_type:
|
|
4403
|
-
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()
|
|
4404
4424
|
}).loose();
|
|
4405
|
-
const builtinToolResultStep =
|
|
4406
|
-
type:
|
|
4407
|
-
call_id:
|
|
4408
|
-
result:
|
|
4409
|
-
is_error:
|
|
4410
|
-
name:
|
|
4411
|
-
server_name:
|
|
4412
|
-
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()
|
|
4413
4433
|
}).loose();
|
|
4414
|
-
return
|
|
4434
|
+
return import_v412.z.union([
|
|
4415
4435
|
userInputStep,
|
|
4416
4436
|
modelOutputStep,
|
|
4417
4437
|
functionCallStep,
|
|
4418
4438
|
thoughtStep,
|
|
4419
4439
|
builtinToolCallStep,
|
|
4420
4440
|
builtinToolResultStep,
|
|
4421
|
-
|
|
4441
|
+
import_v412.z.object({ type: import_v412.z.string() }).loose()
|
|
4422
4442
|
]);
|
|
4423
4443
|
};
|
|
4424
4444
|
var googleInteractionsResponseSchema = (0, import_provider_utils14.lazySchema)(
|
|
4425
4445
|
() => (0, import_provider_utils14.zodSchema)(
|
|
4426
|
-
|
|
4446
|
+
import_v412.z.object({
|
|
4427
4447
|
/*
|
|
4428
4448
|
* `id` is omitted from the response body when `store: false` (fully
|
|
4429
4449
|
* stateless mode) — there is no server-side interaction record for the
|
|
4430
4450
|
* client to reference. `nullish` lets the schema accept that shape.
|
|
4431
4451
|
*/
|
|
4432
|
-
id:
|
|
4433
|
-
created:
|
|
4434
|
-
updated:
|
|
4452
|
+
id: import_v412.z.string().nullish(),
|
|
4453
|
+
created: import_v412.z.string().nullish(),
|
|
4454
|
+
updated: import_v412.z.string().nullish(),
|
|
4435
4455
|
status: interactionStatusSchema(),
|
|
4436
|
-
model:
|
|
4437
|
-
agent:
|
|
4438
|
-
steps:
|
|
4456
|
+
model: import_v412.z.string().nullish(),
|
|
4457
|
+
agent: import_v412.z.string().nullish(),
|
|
4458
|
+
steps: import_v412.z.array(stepSchema()).nullish(),
|
|
4439
4459
|
usage: usageSchema2().nullish(),
|
|
4440
|
-
service_tier:
|
|
4441
|
-
previous_interaction_id:
|
|
4442
|
-
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()
|
|
4443
4463
|
}).loose()
|
|
4444
4464
|
)
|
|
4445
4465
|
);
|
|
@@ -4449,82 +4469,82 @@ var googleInteractionsEventSchema = (0, import_provider_utils14.lazySchema)(
|
|
|
4449
4469
|
const status = interactionStatusSchema();
|
|
4450
4470
|
const annotation = annotationSchema();
|
|
4451
4471
|
const thoughtSummaryItem = thoughtSummaryItemSchema();
|
|
4452
|
-
const interactionCreatedEvent =
|
|
4453
|
-
event_type:
|
|
4454
|
-
event_id:
|
|
4455
|
-
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({
|
|
4456
4476
|
/*
|
|
4457
4477
|
* `id` is omitted when `store: false` (fully stateless mode);
|
|
4458
4478
|
* see the matching note on `googleInteractionsResponseSchema.id`.
|
|
4459
4479
|
*/
|
|
4460
|
-
id:
|
|
4461
|
-
created:
|
|
4462
|
-
model:
|
|
4463
|
-
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(),
|
|
4464
4484
|
status: status.nullish()
|
|
4465
4485
|
}).loose()
|
|
4466
4486
|
}).loose();
|
|
4467
|
-
const stepStartEvent =
|
|
4468
|
-
event_type:
|
|
4469
|
-
event_id:
|
|
4470
|
-
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(),
|
|
4471
4491
|
step: stepSchema()
|
|
4472
4492
|
}).loose();
|
|
4473
|
-
const stepDeltaText =
|
|
4474
|
-
type:
|
|
4475
|
-
text:
|
|
4493
|
+
const stepDeltaText = import_v412.z.object({
|
|
4494
|
+
type: import_v412.z.literal("text"),
|
|
4495
|
+
text: import_v412.z.string()
|
|
4476
4496
|
}).loose();
|
|
4477
|
-
const stepDeltaThoughtSummary =
|
|
4478
|
-
type:
|
|
4497
|
+
const stepDeltaThoughtSummary = import_v412.z.object({
|
|
4498
|
+
type: import_v412.z.literal("thought_summary"),
|
|
4479
4499
|
content: thoughtSummaryItem.nullish()
|
|
4480
4500
|
}).loose();
|
|
4481
|
-
const stepDeltaThoughtSignature =
|
|
4482
|
-
type:
|
|
4483
|
-
signature:
|
|
4501
|
+
const stepDeltaThoughtSignature = import_v412.z.object({
|
|
4502
|
+
type: import_v412.z.literal("thought_signature"),
|
|
4503
|
+
signature: import_v412.z.string().nullish()
|
|
4484
4504
|
}).loose();
|
|
4485
|
-
const stepDeltaArgumentsDelta =
|
|
4486
|
-
type:
|
|
4487
|
-
arguments:
|
|
4488
|
-
id:
|
|
4489
|
-
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()
|
|
4490
4510
|
}).loose();
|
|
4491
|
-
const stepDeltaTextAnnotation =
|
|
4492
|
-
type:
|
|
4493
|
-
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()
|
|
4494
4514
|
}).loose();
|
|
4495
|
-
const stepDeltaImage =
|
|
4496
|
-
type:
|
|
4497
|
-
data:
|
|
4498
|
-
mime_type:
|
|
4499
|
-
resolution:
|
|
4500
|
-
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()
|
|
4501
4521
|
}).loose();
|
|
4502
|
-
const stepDeltaVideo =
|
|
4503
|
-
type:
|
|
4504
|
-
data:
|
|
4505
|
-
mime_type:
|
|
4506
|
-
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()
|
|
4507
4527
|
}).loose();
|
|
4508
|
-
const stepDeltaBuiltinToolCall =
|
|
4509
|
-
type:
|
|
4510
|
-
id:
|
|
4511
|
-
arguments:
|
|
4512
|
-
name:
|
|
4513
|
-
server_name:
|
|
4514
|
-
search_type:
|
|
4515
|
-
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()
|
|
4516
4536
|
}).loose();
|
|
4517
|
-
const stepDeltaBuiltinToolResult =
|
|
4518
|
-
type:
|
|
4519
|
-
call_id:
|
|
4520
|
-
result:
|
|
4521
|
-
is_error:
|
|
4522
|
-
name:
|
|
4523
|
-
server_name:
|
|
4524
|
-
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()
|
|
4525
4545
|
}).loose();
|
|
4526
|
-
const stepDeltaUnknown =
|
|
4527
|
-
const stepDeltaUnion =
|
|
4546
|
+
const stepDeltaUnknown = import_v412.z.object({ type: import_v412.z.string() }).loose();
|
|
4547
|
+
const stepDeltaUnion = import_v412.z.union([
|
|
4528
4548
|
stepDeltaText,
|
|
4529
4549
|
stepDeltaImage,
|
|
4530
4550
|
stepDeltaVideo,
|
|
@@ -4536,55 +4556,55 @@ var googleInteractionsEventSchema = (0, import_provider_utils14.lazySchema)(
|
|
|
4536
4556
|
stepDeltaBuiltinToolResult,
|
|
4537
4557
|
stepDeltaUnknown
|
|
4538
4558
|
]);
|
|
4539
|
-
const stepDeltaEvent =
|
|
4540
|
-
event_type:
|
|
4541
|
-
event_id:
|
|
4542
|
-
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(),
|
|
4543
4563
|
delta: stepDeltaUnion
|
|
4544
4564
|
}).loose();
|
|
4545
|
-
const stepStopEvent =
|
|
4546
|
-
event_type:
|
|
4547
|
-
event_id:
|
|
4548
|
-
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()
|
|
4549
4569
|
}).loose();
|
|
4550
|
-
const interactionStatusUpdateEvent =
|
|
4551
|
-
event_type:
|
|
4552
|
-
event_id:
|
|
4553
|
-
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(),
|
|
4554
4574
|
status: status.nullish()
|
|
4555
4575
|
}).loose();
|
|
4556
|
-
const interactionInProgressEvent =
|
|
4557
|
-
event_type:
|
|
4558
|
-
event_id:
|
|
4559
|
-
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(),
|
|
4560
4580
|
status: status.nullish()
|
|
4561
4581
|
}).loose();
|
|
4562
|
-
const interactionRequiresActionEvent =
|
|
4563
|
-
event_type:
|
|
4564
|
-
event_id:
|
|
4565
|
-
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(),
|
|
4566
4586
|
status: status.nullish()
|
|
4567
4587
|
}).loose();
|
|
4568
|
-
const interactionCompletedEvent =
|
|
4569
|
-
event_type:
|
|
4570
|
-
event_id:
|
|
4571
|
-
interaction:
|
|
4572
|
-
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(),
|
|
4573
4593
|
status: status.nullish(),
|
|
4574
4594
|
usage: usageSchema2().nullish(),
|
|
4575
|
-
service_tier:
|
|
4595
|
+
service_tier: import_v412.z.string().nullish()
|
|
4576
4596
|
}).loose()
|
|
4577
4597
|
}).loose();
|
|
4578
|
-
const errorEvent =
|
|
4579
|
-
event_type:
|
|
4580
|
-
event_id:
|
|
4581
|
-
error:
|
|
4582
|
-
code:
|
|
4583
|
-
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()
|
|
4584
4604
|
}).loose().nullish()
|
|
4585
4605
|
}).loose();
|
|
4586
|
-
const unknownEvent =
|
|
4587
|
-
return
|
|
4606
|
+
const unknownEvent = import_v412.z.object({ event_type: import_v412.z.string() }).loose();
|
|
4607
|
+
return import_v412.z.union([
|
|
4588
4608
|
interactionCreatedEvent,
|
|
4589
4609
|
stepStartEvent,
|
|
4590
4610
|
stepDeltaEvent,
|
|
@@ -4602,26 +4622,26 @@ var googleInteractionsEventSchema = (0, import_provider_utils14.lazySchema)(
|
|
|
4602
4622
|
|
|
4603
4623
|
// src/interactions/google-interactions-language-model-options.ts
|
|
4604
4624
|
var import_provider_utils15 = require("@ai-sdk/provider-utils");
|
|
4605
|
-
var
|
|
4625
|
+
var import_v413 = require("zod/v4");
|
|
4606
4626
|
var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySchema)(
|
|
4607
4627
|
() => (0, import_provider_utils15.zodSchema)(
|
|
4608
|
-
|
|
4609
|
-
previousInteractionId:
|
|
4610
|
-
store:
|
|
4611
|
-
agent:
|
|
4612
|
-
agentConfig:
|
|
4613
|
-
|
|
4614
|
-
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")
|
|
4615
4635
|
}).loose(),
|
|
4616
|
-
|
|
4617
|
-
type:
|
|
4618
|
-
thinkingSummaries:
|
|
4619
|
-
visualization:
|
|
4620
|
-
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()
|
|
4621
4641
|
})
|
|
4622
4642
|
]).nullish(),
|
|
4623
|
-
thinkingLevel:
|
|
4624
|
-
thinkingSummaries:
|
|
4643
|
+
thinkingLevel: import_v413.z.enum(["minimal", "low", "medium", "high"]).nullish(),
|
|
4644
|
+
thinkingSummaries: import_v413.z.enum(["auto", "none"]).nullish(),
|
|
4625
4645
|
/**
|
|
4626
4646
|
* Output-format entries that map directly to the API's `response_format`
|
|
4627
4647
|
* array. Use this to request image, audio, video, or non-JSON text
|
|
@@ -4631,17 +4651,17 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
|
|
|
4631
4651
|
* type: 'json', schema }` still drives JSON-mode and adds a matching
|
|
4632
4652
|
* text entry automatically; entries listed here are appended.
|
|
4633
4653
|
*/
|
|
4634
|
-
responseFormat:
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
type:
|
|
4638
|
-
mimeType:
|
|
4639
|
-
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()
|
|
4640
4660
|
}).loose(),
|
|
4641
|
-
|
|
4642
|
-
type:
|
|
4643
|
-
mimeType:
|
|
4644
|
-
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([
|
|
4645
4665
|
"1:1",
|
|
4646
4666
|
"2:3",
|
|
4647
4667
|
"3:2",
|
|
@@ -4657,19 +4677,19 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
|
|
|
4657
4677
|
"1:4",
|
|
4658
4678
|
"4:1"
|
|
4659
4679
|
]).nullish(),
|
|
4660
|
-
imageSize:
|
|
4680
|
+
imageSize: import_v413.z.enum(["1K", "2K", "4K", "512"]).nullish()
|
|
4661
4681
|
}).loose(),
|
|
4662
|
-
|
|
4663
|
-
type:
|
|
4664
|
-
mimeType:
|
|
4682
|
+
import_v413.z.object({
|
|
4683
|
+
type: import_v413.z.literal("audio"),
|
|
4684
|
+
mimeType: import_v413.z.string().nullish()
|
|
4665
4685
|
}).loose(),
|
|
4666
|
-
|
|
4667
|
-
type:
|
|
4668
|
-
aspectRatio:
|
|
4669
|
-
resolution:
|
|
4670
|
-
duration:
|
|
4671
|
-
delivery:
|
|
4672
|
-
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()
|
|
4673
4693
|
}).loose()
|
|
4674
4694
|
])
|
|
4675
4695
|
).nullish(),
|
|
@@ -4679,8 +4699,8 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
|
|
|
4679
4699
|
* translates it into a matching `response_format` image entry and
|
|
4680
4700
|
* emits a warning when set.
|
|
4681
4701
|
*/
|
|
4682
|
-
imageConfig:
|
|
4683
|
-
aspectRatio:
|
|
4702
|
+
imageConfig: import_v413.z.object({
|
|
4703
|
+
aspectRatio: import_v413.z.enum([
|
|
4684
4704
|
"1:1",
|
|
4685
4705
|
"2:3",
|
|
4686
4706
|
"3:2",
|
|
@@ -4696,35 +4716,35 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
|
|
|
4696
4716
|
"1:4",
|
|
4697
4717
|
"4:1"
|
|
4698
4718
|
]).nullish(),
|
|
4699
|
-
imageSize:
|
|
4719
|
+
imageSize: import_v413.z.enum(["1K", "2K", "4K", "512"]).nullish()
|
|
4700
4720
|
}).nullish(),
|
|
4701
|
-
mediaResolution:
|
|
4702
|
-
responseModalities:
|
|
4703
|
-
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(),
|
|
4704
4724
|
/**
|
|
4705
4725
|
* Alternative to AI SDK `system` message. If both are set, the AI SDK
|
|
4706
4726
|
* `system` message wins and a warning is emitted.
|
|
4707
4727
|
*/
|
|
4708
|
-
systemInstruction:
|
|
4728
|
+
systemInstruction: import_v413.z.string().nullish(),
|
|
4709
4729
|
/**
|
|
4710
4730
|
* Per-block signature for round-tripping `thought.signature` and
|
|
4711
4731
|
* `function_call.signature` blocks. Set by the SDK on output reasoning /
|
|
4712
4732
|
* tool-call parts; passed back unchanged on input parts so the API
|
|
4713
4733
|
* accepts the prior turn.
|
|
4714
4734
|
*/
|
|
4715
|
-
signature:
|
|
4735
|
+
signature: import_v413.z.string().nullish(),
|
|
4716
4736
|
/**
|
|
4717
4737
|
* Set by the SDK on output assistant messages. The converter uses it to
|
|
4718
4738
|
* decide which messages to drop when compacting under
|
|
4719
4739
|
* `previousInteractionId`.
|
|
4720
4740
|
*/
|
|
4721
|
-
interactionId:
|
|
4741
|
+
interactionId: import_v413.z.string().nullish(),
|
|
4722
4742
|
/**
|
|
4723
4743
|
* Maximum time, in milliseconds, to poll a background interaction (agent
|
|
4724
4744
|
* call) before giving up. Defaults to 30 minutes. Long-running agents
|
|
4725
4745
|
* such as deep research can take tens of minutes — increase if needed.
|
|
4726
4746
|
*/
|
|
4727
|
-
pollingTimeoutMs:
|
|
4747
|
+
pollingTimeoutMs: import_v413.z.number().int().positive().nullish(),
|
|
4728
4748
|
/**
|
|
4729
4749
|
* Run the interaction in the background. Required for agents whose
|
|
4730
4750
|
* server-side workflow cannot complete within a single request/response.
|
|
@@ -4733,7 +4753,7 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
|
|
|
4733
4753
|
* reject `true`; see the agent's documentation for which mode it
|
|
4734
4754
|
* requires.
|
|
4735
4755
|
*/
|
|
4736
|
-
background:
|
|
4756
|
+
background: import_v413.z.boolean().nullish(),
|
|
4737
4757
|
/**
|
|
4738
4758
|
* Environment configuration for the agent sandbox. Only applies to agent
|
|
4739
4759
|
* calls (`google.interactions({ agent })`); ignored on model-id calls.
|
|
@@ -4743,36 +4763,36 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
|
|
|
4743
4763
|
* - object: provision a fresh sandbox and optionally preload `sources`
|
|
4744
4764
|
* and/or constrain outbound traffic via `network`.
|
|
4745
4765
|
*/
|
|
4746
|
-
environment:
|
|
4747
|
-
|
|
4748
|
-
|
|
4749
|
-
type:
|
|
4750
|
-
sources:
|
|
4751
|
-
|
|
4752
|
-
|
|
4753
|
-
type:
|
|
4754
|
-
source:
|
|
4755
|
-
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()
|
|
4756
4776
|
}),
|
|
4757
|
-
|
|
4758
|
-
type:
|
|
4759
|
-
source:
|
|
4760
|
-
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()
|
|
4761
4781
|
}),
|
|
4762
|
-
|
|
4763
|
-
type:
|
|
4764
|
-
content:
|
|
4765
|
-
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()
|
|
4766
4786
|
})
|
|
4767
4787
|
])
|
|
4768
4788
|
).nullish(),
|
|
4769
|
-
network:
|
|
4770
|
-
|
|
4771
|
-
|
|
4772
|
-
allowlist:
|
|
4773
|
-
|
|
4774
|
-
domain:
|
|
4775
|
-
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()
|
|
4776
4796
|
})
|
|
4777
4797
|
)
|
|
4778
4798
|
})
|