@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.mjs
CHANGED
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
resolve,
|
|
11
11
|
zodSchema as zodSchema3
|
|
12
12
|
} from "@ai-sdk/provider-utils";
|
|
13
|
-
import { z as
|
|
13
|
+
import { z as z4 } from "zod/v4";
|
|
14
14
|
|
|
15
15
|
// src/continue-google-stream.ts
|
|
16
16
|
function continueGoogleStream({
|
|
@@ -441,6 +441,19 @@ import {
|
|
|
441
441
|
isUrlSupported,
|
|
442
442
|
secureJsonParse
|
|
443
443
|
} from "@ai-sdk/provider-utils";
|
|
444
|
+
|
|
445
|
+
// src/google-generative-ai-prompt.ts
|
|
446
|
+
import { z } from "zod/v4";
|
|
447
|
+
var googleVideoMetadataSchema = z.object({
|
|
448
|
+
/** Start offset as a duration in seconds, e.g. `'3.5s'`. */
|
|
449
|
+
startOffset: z.string().optional(),
|
|
450
|
+
/** End offset as a duration in seconds, e.g. `'10s'`. */
|
|
451
|
+
endOffset: z.string().optional(),
|
|
452
|
+
/** Frames per second in the range (0, 24]. Defaults to 1. */
|
|
453
|
+
fps: z.number().gt(0).max(24).optional()
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
// src/convert-to-google-generative-ai-messages.ts
|
|
444
457
|
var SKIP_THOUGHT_SIGNATURE_VALIDATOR = "skip_thought_signature_validator";
|
|
445
458
|
function getGoogleProviderOptions(providerOptions, providerOptionsName) {
|
|
446
459
|
const namespaces = [
|
|
@@ -579,7 +592,7 @@ function appendLegacyToolResultParts(parts, toolName, outputValue, toolCallId, i
|
|
|
579
592
|
}
|
|
580
593
|
}
|
|
581
594
|
function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
582
|
-
var _a, _b, _c, _d, _e, _f, _g;
|
|
595
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
583
596
|
const systemInstructionParts = [];
|
|
584
597
|
const contents = [];
|
|
585
598
|
let systemMessagesAllowed = true;
|
|
@@ -619,17 +632,24 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
|
619
632
|
}
|
|
620
633
|
case "file": {
|
|
621
634
|
const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType;
|
|
635
|
+
const rawVideoMetadata = (_g = getGoogleProviderOptions(
|
|
636
|
+
part.providerOptions,
|
|
637
|
+
providerOptionsName
|
|
638
|
+
)) == null ? void 0 : _g.videoMetadata;
|
|
639
|
+
const videoMetadata = rawVideoMetadata == null ? void 0 : googleVideoMetadataSchema.parse(rawVideoMetadata);
|
|
622
640
|
parts.push(
|
|
623
641
|
part.data instanceof URL ? {
|
|
624
642
|
fileData: {
|
|
625
643
|
mimeType: mediaType,
|
|
626
644
|
fileUri: part.data.protocol === "gs:" && part.originalUrl != null ? part.originalUrl : part.data.toString()
|
|
627
|
-
}
|
|
645
|
+
},
|
|
646
|
+
...videoMetadata != null ? { videoMetadata } : {}
|
|
628
647
|
} : {
|
|
629
648
|
inlineData: {
|
|
630
649
|
mimeType: mediaType,
|
|
631
650
|
data: convertToBase64(part.data)
|
|
632
|
-
}
|
|
651
|
+
},
|
|
652
|
+
...videoMetadata != null ? { videoMetadata } : {}
|
|
633
653
|
}
|
|
634
654
|
);
|
|
635
655
|
break;
|
|
@@ -790,7 +810,7 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
|
|
|
790
810
|
name: part.toolName,
|
|
791
811
|
response: {
|
|
792
812
|
name: part.toolName,
|
|
793
|
-
content: output.type === "execution-denied" ? (
|
|
813
|
+
content: output.type === "execution-denied" ? (_h = output.reason) != null ? _h : "Tool call execution denied." : output.value
|
|
794
814
|
}
|
|
795
815
|
}
|
|
796
816
|
});
|
|
@@ -902,15 +922,15 @@ import {
|
|
|
902
922
|
lazySchema,
|
|
903
923
|
zodSchema
|
|
904
924
|
} from "@ai-sdk/provider-utils";
|
|
905
|
-
import { z } from "zod/v4";
|
|
925
|
+
import { z as z2 } from "zod/v4";
|
|
906
926
|
var googleErrorDataSchema = lazySchema(
|
|
907
927
|
() => zodSchema(
|
|
908
|
-
|
|
909
|
-
error:
|
|
910
|
-
code:
|
|
911
|
-
message:
|
|
912
|
-
status:
|
|
913
|
-
details:
|
|
928
|
+
z2.object({
|
|
929
|
+
error: z2.object({
|
|
930
|
+
code: z2.number().nullable(),
|
|
931
|
+
message: z2.string(),
|
|
932
|
+
status: z2.string(),
|
|
933
|
+
details: z2.array(z2.unknown()).nullish()
|
|
914
934
|
})
|
|
915
935
|
})
|
|
916
936
|
)
|
|
@@ -925,23 +945,23 @@ import {
|
|
|
925
945
|
lazySchema as lazySchema2,
|
|
926
946
|
zodSchema as zodSchema2
|
|
927
947
|
} from "@ai-sdk/provider-utils";
|
|
928
|
-
import { z as
|
|
948
|
+
import { z as z3 } from "zod/v4";
|
|
929
949
|
var googleLanguageModelOptions = lazySchema2(
|
|
930
950
|
() => zodSchema2(
|
|
931
|
-
|
|
932
|
-
responseModalities:
|
|
933
|
-
thinkingConfig:
|
|
934
|
-
thinkingBudget:
|
|
935
|
-
includeThoughts:
|
|
951
|
+
z3.object({
|
|
952
|
+
responseModalities: z3.array(z3.enum(["TEXT", "IMAGE"])).optional(),
|
|
953
|
+
thinkingConfig: z3.object({
|
|
954
|
+
thinkingBudget: z3.number().optional(),
|
|
955
|
+
includeThoughts: z3.boolean().optional(),
|
|
936
956
|
// https://ai.google.dev/gemini-api/docs/gemini-3?thinking=high#thinking_level
|
|
937
|
-
thinkingLevel:
|
|
957
|
+
thinkingLevel: z3.enum(["minimal", "low", "medium", "high"]).optional()
|
|
938
958
|
}).optional(),
|
|
939
959
|
/**
|
|
940
960
|
* Optional.
|
|
941
961
|
* The name of the cached content used as context to serve the prediction.
|
|
942
962
|
* Format: cachedContents/{cachedContent}
|
|
943
963
|
*/
|
|
944
|
-
cachedContent:
|
|
964
|
+
cachedContent: z3.string().optional(),
|
|
945
965
|
/**
|
|
946
966
|
* Optional. Enable structured output. Default is true.
|
|
947
967
|
*
|
|
@@ -950,13 +970,13 @@ var googleLanguageModelOptions = lazySchema2(
|
|
|
950
970
|
* Google Generative AI uses. You can use this to disable
|
|
951
971
|
* structured outputs if you need to.
|
|
952
972
|
*/
|
|
953
|
-
structuredOutputs:
|
|
973
|
+
structuredOutputs: z3.boolean().optional(),
|
|
954
974
|
/**
|
|
955
975
|
* Optional. A list of unique safety settings for blocking unsafe content.
|
|
956
976
|
*/
|
|
957
|
-
safetySettings:
|
|
958
|
-
|
|
959
|
-
category:
|
|
977
|
+
safetySettings: z3.array(
|
|
978
|
+
z3.object({
|
|
979
|
+
category: z3.enum([
|
|
960
980
|
"HARM_CATEGORY_UNSPECIFIED",
|
|
961
981
|
"HARM_CATEGORY_HATE_SPEECH",
|
|
962
982
|
"HARM_CATEGORY_DANGEROUS_CONTENT",
|
|
@@ -964,7 +984,7 @@ var googleLanguageModelOptions = lazySchema2(
|
|
|
964
984
|
"HARM_CATEGORY_SEXUALLY_EXPLICIT",
|
|
965
985
|
"HARM_CATEGORY_CIVIC_INTEGRITY"
|
|
966
986
|
]),
|
|
967
|
-
threshold:
|
|
987
|
+
threshold: z3.enum([
|
|
968
988
|
"HARM_BLOCK_THRESHOLD_UNSPECIFIED",
|
|
969
989
|
"BLOCK_LOW_AND_ABOVE",
|
|
970
990
|
"BLOCK_MEDIUM_AND_ABOVE",
|
|
@@ -974,7 +994,7 @@ var googleLanguageModelOptions = lazySchema2(
|
|
|
974
994
|
])
|
|
975
995
|
})
|
|
976
996
|
).optional(),
|
|
977
|
-
threshold:
|
|
997
|
+
threshold: z3.enum([
|
|
978
998
|
"HARM_BLOCK_THRESHOLD_UNSPECIFIED",
|
|
979
999
|
"BLOCK_LOW_AND_ABOVE",
|
|
980
1000
|
"BLOCK_MEDIUM_AND_ABOVE",
|
|
@@ -987,19 +1007,19 @@ var googleLanguageModelOptions = lazySchema2(
|
|
|
987
1007
|
*
|
|
988
1008
|
* https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
|
|
989
1009
|
*/
|
|
990
|
-
audioTimestamp:
|
|
1010
|
+
audioTimestamp: z3.boolean().optional(),
|
|
991
1011
|
/**
|
|
992
1012
|
* Optional. Defines labels used in billing reports. Available on Vertex AI only.
|
|
993
1013
|
*
|
|
994
1014
|
* https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls
|
|
995
1015
|
*/
|
|
996
|
-
labels:
|
|
1016
|
+
labels: z3.record(z3.string(), z3.string()).optional(),
|
|
997
1017
|
/**
|
|
998
1018
|
* Optional. If specified, the media resolution specified will be used.
|
|
999
1019
|
*
|
|
1000
1020
|
* https://ai.google.dev/api/generate-content#MediaResolution
|
|
1001
1021
|
*/
|
|
1002
|
-
mediaResolution:
|
|
1022
|
+
mediaResolution: z3.enum([
|
|
1003
1023
|
"MEDIA_RESOLUTION_UNSPECIFIED",
|
|
1004
1024
|
"MEDIA_RESOLUTION_LOW",
|
|
1005
1025
|
"MEDIA_RESOLUTION_MEDIUM",
|
|
@@ -1010,8 +1030,8 @@ var googleLanguageModelOptions = lazySchema2(
|
|
|
1010
1030
|
*
|
|
1011
1031
|
* https://ai.google.dev/gemini-api/docs/image-generation#aspect_ratios
|
|
1012
1032
|
*/
|
|
1013
|
-
imageConfig:
|
|
1014
|
-
aspectRatio:
|
|
1033
|
+
imageConfig: z3.object({
|
|
1034
|
+
aspectRatio: z3.enum([
|
|
1015
1035
|
"1:1",
|
|
1016
1036
|
"2:3",
|
|
1017
1037
|
"3:2",
|
|
@@ -1027,12 +1047,12 @@ var googleLanguageModelOptions = lazySchema2(
|
|
|
1027
1047
|
"1:4",
|
|
1028
1048
|
"4:1"
|
|
1029
1049
|
]).optional(),
|
|
1030
|
-
imageSize:
|
|
1050
|
+
imageSize: z3.enum(["1K", "2K", "4K", "512"]).optional(),
|
|
1031
1051
|
/**
|
|
1032
1052
|
* Optional. Controls the generation of people in images.
|
|
1033
1053
|
* Vertex AI only.
|
|
1034
1054
|
*/
|
|
1035
|
-
personGeneration:
|
|
1055
|
+
personGeneration: z3.enum([
|
|
1036
1056
|
"PERSON_GENERATION_UNSPECIFIED",
|
|
1037
1057
|
"ALLOW_ALL",
|
|
1038
1058
|
"ALLOW_ADULT",
|
|
@@ -1046,7 +1066,7 @@ var googleLanguageModelOptions = lazySchema2(
|
|
|
1046
1066
|
*
|
|
1047
1067
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerationConfig
|
|
1048
1068
|
*/
|
|
1049
|
-
prominentPeople:
|
|
1069
|
+
prominentPeople: z3.enum([
|
|
1050
1070
|
"PROMINENT_PEOPLE_UNSPECIFIED",
|
|
1051
1071
|
"ALLOW_PROMINENT_PEOPLE",
|
|
1052
1072
|
"BLOCK_PROMINENT_PEOPLE"
|
|
@@ -1055,9 +1075,9 @@ var googleLanguageModelOptions = lazySchema2(
|
|
|
1055
1075
|
* Optional. The image output format for generated images.
|
|
1056
1076
|
* Vertex AI only.
|
|
1057
1077
|
*/
|
|
1058
|
-
imageOutputOptions:
|
|
1059
|
-
mimeType:
|
|
1060
|
-
compressionQuality:
|
|
1078
|
+
imageOutputOptions: z3.object({
|
|
1079
|
+
mimeType: z3.enum(["image/jpeg", "image/png"]).optional(),
|
|
1080
|
+
compressionQuality: z3.number().optional()
|
|
1061
1081
|
}).optional()
|
|
1062
1082
|
}).optional(),
|
|
1063
1083
|
/**
|
|
@@ -1066,10 +1086,10 @@ var googleLanguageModelOptions = lazySchema2(
|
|
|
1066
1086
|
*
|
|
1067
1087
|
* https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps
|
|
1068
1088
|
*/
|
|
1069
|
-
retrievalConfig:
|
|
1070
|
-
latLng:
|
|
1071
|
-
latitude:
|
|
1072
|
-
longitude:
|
|
1089
|
+
retrievalConfig: z3.object({
|
|
1090
|
+
latLng: z3.object({
|
|
1091
|
+
latitude: z3.number(),
|
|
1092
|
+
longitude: z3.number()
|
|
1073
1093
|
}).optional()
|
|
1074
1094
|
}).optional(),
|
|
1075
1095
|
/**
|
|
@@ -1082,12 +1102,12 @@ var googleLanguageModelOptions = lazySchema2(
|
|
|
1082
1102
|
*
|
|
1083
1103
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling#streaming-fc
|
|
1084
1104
|
*/
|
|
1085
|
-
streamFunctionCallArguments:
|
|
1105
|
+
streamFunctionCallArguments: z3.boolean().optional(),
|
|
1086
1106
|
/**
|
|
1087
1107
|
* Optional. The service tier to use for the request. Sent as the
|
|
1088
1108
|
* `serviceTier` body field. Gemini API only.
|
|
1089
1109
|
*/
|
|
1090
|
-
serviceTier:
|
|
1110
|
+
serviceTier: z3.enum(["standard", "flex", "priority"]).optional(),
|
|
1091
1111
|
/**
|
|
1092
1112
|
* Optional. Resumes a response that stopped with `MAX_TOKENS` because it
|
|
1093
1113
|
* used up its `maxOutputTokens` budget (Gemini 4 long decode). Pass the
|
|
@@ -1097,7 +1117,7 @@ var googleLanguageModelOptions = lazySchema2(
|
|
|
1097
1117
|
* per-request cap while budget remains (`CONTINUATION`) are continued
|
|
1098
1118
|
* automatically. Sent as the `continuationToken` body field.
|
|
1099
1119
|
*/
|
|
1100
|
-
continuationToken:
|
|
1120
|
+
continuationToken: z3.string().optional(),
|
|
1101
1121
|
/**
|
|
1102
1122
|
* Optional. Vertex AI only. Sent as the
|
|
1103
1123
|
* `X-Vertex-AI-LLM-Shared-Request-Type` request header to select a
|
|
@@ -1108,7 +1128,7 @@ var googleLanguageModelOptions = lazySchema2(
|
|
|
1108
1128
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/priority-paygo
|
|
1109
1129
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/flex-paygo
|
|
1110
1130
|
*/
|
|
1111
|
-
sharedRequestType:
|
|
1131
|
+
sharedRequestType: z3.enum(["priority", "flex", "standard"]).optional(),
|
|
1112
1132
|
/**
|
|
1113
1133
|
* Optional. Vertex AI only. Sent as the `X-Vertex-AI-LLM-Request-Type`
|
|
1114
1134
|
* request header. Set to `'shared'` together with `sharedRequestType`
|
|
@@ -1116,7 +1136,7 @@ var googleLanguageModelOptions = lazySchema2(
|
|
|
1116
1136
|
*
|
|
1117
1137
|
* https://docs.cloud.google.com/vertex-ai/generative-ai/docs/priority-paygo
|
|
1118
1138
|
*/
|
|
1119
|
-
requestType:
|
|
1139
|
+
requestType: z3.enum(["shared"]).optional()
|
|
1120
1140
|
})
|
|
1121
1141
|
)
|
|
1122
1142
|
);
|
|
@@ -2735,205 +2755,205 @@ function extractSources({
|
|
|
2735
2755
|
}
|
|
2736
2756
|
return sources.length > 0 ? sources : void 0;
|
|
2737
2757
|
}
|
|
2738
|
-
var getGroundingMetadataSchema = () =>
|
|
2739
|
-
webSearchQueries:
|
|
2740
|
-
imageSearchQueries:
|
|
2741
|
-
retrievalQueries:
|
|
2742
|
-
searchEntryPoint:
|
|
2743
|
-
groundingChunks:
|
|
2744
|
-
|
|
2745
|
-
web:
|
|
2746
|
-
image:
|
|
2747
|
-
sourceUri:
|
|
2748
|
-
imageUri:
|
|
2749
|
-
title:
|
|
2750
|
-
domain:
|
|
2758
|
+
var getGroundingMetadataSchema = () => z4.object({
|
|
2759
|
+
webSearchQueries: z4.array(z4.string()).nullish(),
|
|
2760
|
+
imageSearchQueries: z4.array(z4.string()).nullish(),
|
|
2761
|
+
retrievalQueries: z4.array(z4.string()).nullish(),
|
|
2762
|
+
searchEntryPoint: z4.object({ renderedContent: z4.string() }).nullish(),
|
|
2763
|
+
groundingChunks: z4.array(
|
|
2764
|
+
z4.object({
|
|
2765
|
+
web: z4.object({ uri: z4.string(), title: z4.string().nullish() }).nullish(),
|
|
2766
|
+
image: z4.object({
|
|
2767
|
+
sourceUri: z4.string(),
|
|
2768
|
+
imageUri: z4.string(),
|
|
2769
|
+
title: z4.string().nullish(),
|
|
2770
|
+
domain: z4.string().nullish()
|
|
2751
2771
|
}).nullish(),
|
|
2752
|
-
retrievedContext:
|
|
2753
|
-
uri:
|
|
2754
|
-
title:
|
|
2755
|
-
text:
|
|
2756
|
-
fileSearchStore:
|
|
2757
|
-
customMetadata:
|
|
2758
|
-
|
|
2759
|
-
key:
|
|
2760
|
-
stringValue:
|
|
2761
|
-
numericValue:
|
|
2762
|
-
stringListValue:
|
|
2772
|
+
retrievedContext: z4.object({
|
|
2773
|
+
uri: z4.string().nullish(),
|
|
2774
|
+
title: z4.string().nullish(),
|
|
2775
|
+
text: z4.string().nullish(),
|
|
2776
|
+
fileSearchStore: z4.string().nullish(),
|
|
2777
|
+
customMetadata: z4.array(
|
|
2778
|
+
z4.object({
|
|
2779
|
+
key: z4.string(),
|
|
2780
|
+
stringValue: z4.string().nullish(),
|
|
2781
|
+
numericValue: z4.number().nullish(),
|
|
2782
|
+
stringListValue: z4.object({ values: z4.array(z4.string()).nullish() }).nullish()
|
|
2763
2783
|
})
|
|
2764
2784
|
).nullish()
|
|
2765
2785
|
}).nullish(),
|
|
2766
|
-
maps:
|
|
2767
|
-
uri:
|
|
2768
|
-
title:
|
|
2769
|
-
text:
|
|
2770
|
-
placeId:
|
|
2786
|
+
maps: z4.object({
|
|
2787
|
+
uri: z4.string().nullish(),
|
|
2788
|
+
title: z4.string().nullish(),
|
|
2789
|
+
text: z4.string().nullish(),
|
|
2790
|
+
placeId: z4.string().nullish()
|
|
2771
2791
|
}).nullish()
|
|
2772
2792
|
})
|
|
2773
2793
|
).nullish(),
|
|
2774
|
-
groundingSupports:
|
|
2775
|
-
|
|
2776
|
-
segment:
|
|
2777
|
-
startIndex:
|
|
2778
|
-
endIndex:
|
|
2779
|
-
text:
|
|
2794
|
+
groundingSupports: z4.array(
|
|
2795
|
+
z4.object({
|
|
2796
|
+
segment: z4.object({
|
|
2797
|
+
startIndex: z4.number().nullish(),
|
|
2798
|
+
endIndex: z4.number().nullish(),
|
|
2799
|
+
text: z4.string().nullish()
|
|
2780
2800
|
}).nullish(),
|
|
2781
|
-
segment_text:
|
|
2782
|
-
groundingChunkIndices:
|
|
2783
|
-
supportChunkIndices:
|
|
2784
|
-
confidenceScores:
|
|
2785
|
-
confidenceScore:
|
|
2801
|
+
segment_text: z4.string().nullish(),
|
|
2802
|
+
groundingChunkIndices: z4.array(z4.number()).nullish(),
|
|
2803
|
+
supportChunkIndices: z4.array(z4.number()).nullish(),
|
|
2804
|
+
confidenceScores: z4.array(z4.number()).nullish(),
|
|
2805
|
+
confidenceScore: z4.array(z4.number()).nullish()
|
|
2786
2806
|
})
|
|
2787
2807
|
).nullish(),
|
|
2788
|
-
retrievalMetadata:
|
|
2789
|
-
|
|
2790
|
-
webDynamicRetrievalScore:
|
|
2808
|
+
retrievalMetadata: z4.union([
|
|
2809
|
+
z4.object({
|
|
2810
|
+
webDynamicRetrievalScore: z4.number()
|
|
2791
2811
|
}),
|
|
2792
|
-
|
|
2812
|
+
z4.object({})
|
|
2793
2813
|
]).nullish()
|
|
2794
2814
|
});
|
|
2795
|
-
var partialArgSchema = () =>
|
|
2796
|
-
jsonPath:
|
|
2797
|
-
stringValue:
|
|
2798
|
-
numberValue:
|
|
2799
|
-
boolValue:
|
|
2800
|
-
nullValue:
|
|
2801
|
-
willContinue:
|
|
2815
|
+
var partialArgSchema = () => z4.object({
|
|
2816
|
+
jsonPath: z4.string(),
|
|
2817
|
+
stringValue: z4.string().nullish(),
|
|
2818
|
+
numberValue: z4.number().nullish(),
|
|
2819
|
+
boolValue: z4.boolean().nullish(),
|
|
2820
|
+
nullValue: z4.unknown().nullish(),
|
|
2821
|
+
willContinue: z4.boolean().nullish()
|
|
2802
2822
|
});
|
|
2803
|
-
var getContentSchema = () =>
|
|
2804
|
-
parts:
|
|
2805
|
-
|
|
2823
|
+
var getContentSchema = () => z4.object({
|
|
2824
|
+
parts: z4.array(
|
|
2825
|
+
z4.union([
|
|
2806
2826
|
// note: order matters since text can be fully empty
|
|
2807
|
-
|
|
2808
|
-
functionCall:
|
|
2809
|
-
id:
|
|
2810
|
-
name:
|
|
2811
|
-
args:
|
|
2812
|
-
partialArgs:
|
|
2813
|
-
willContinue:
|
|
2827
|
+
z4.object({
|
|
2828
|
+
functionCall: z4.object({
|
|
2829
|
+
id: z4.string().nullish(),
|
|
2830
|
+
name: z4.string().nullish(),
|
|
2831
|
+
args: z4.unknown().nullish(),
|
|
2832
|
+
partialArgs: z4.array(partialArgSchema()).nullish(),
|
|
2833
|
+
willContinue: z4.boolean().nullish()
|
|
2814
2834
|
}),
|
|
2815
|
-
thoughtSignature:
|
|
2835
|
+
thoughtSignature: z4.string().nullish()
|
|
2816
2836
|
}),
|
|
2817
|
-
|
|
2818
|
-
inlineData:
|
|
2819
|
-
mimeType:
|
|
2820
|
-
data:
|
|
2837
|
+
z4.object({
|
|
2838
|
+
inlineData: z4.object({
|
|
2839
|
+
mimeType: z4.string(),
|
|
2840
|
+
data: z4.string()
|
|
2821
2841
|
}),
|
|
2822
|
-
thought:
|
|
2823
|
-
thoughtSignature:
|
|
2842
|
+
thought: z4.boolean().nullish(),
|
|
2843
|
+
thoughtSignature: z4.string().nullish()
|
|
2824
2844
|
}),
|
|
2825
|
-
|
|
2826
|
-
toolCall:
|
|
2827
|
-
toolType:
|
|
2828
|
-
args:
|
|
2829
|
-
id:
|
|
2845
|
+
z4.object({
|
|
2846
|
+
toolCall: z4.object({
|
|
2847
|
+
toolType: z4.string(),
|
|
2848
|
+
args: z4.unknown().nullish(),
|
|
2849
|
+
id: z4.string()
|
|
2830
2850
|
}),
|
|
2831
|
-
thoughtSignature:
|
|
2851
|
+
thoughtSignature: z4.string().nullish()
|
|
2832
2852
|
}),
|
|
2833
|
-
|
|
2834
|
-
toolResponse:
|
|
2835
|
-
toolType:
|
|
2836
|
-
response:
|
|
2837
|
-
id:
|
|
2853
|
+
z4.object({
|
|
2854
|
+
toolResponse: z4.object({
|
|
2855
|
+
toolType: z4.string(),
|
|
2856
|
+
response: z4.unknown().nullish(),
|
|
2857
|
+
id: z4.string()
|
|
2838
2858
|
}),
|
|
2839
|
-
thoughtSignature:
|
|
2859
|
+
thoughtSignature: z4.string().nullish()
|
|
2840
2860
|
}),
|
|
2841
|
-
|
|
2842
|
-
executableCode:
|
|
2843
|
-
language:
|
|
2844
|
-
code:
|
|
2861
|
+
z4.object({
|
|
2862
|
+
executableCode: z4.object({
|
|
2863
|
+
language: z4.string(),
|
|
2864
|
+
code: z4.string()
|
|
2845
2865
|
}).nullish(),
|
|
2846
|
-
codeExecutionResult:
|
|
2847
|
-
outcome:
|
|
2848
|
-
output:
|
|
2866
|
+
codeExecutionResult: z4.object({
|
|
2867
|
+
outcome: z4.string(),
|
|
2868
|
+
output: z4.string().nullish()
|
|
2849
2869
|
}).nullish(),
|
|
2850
|
-
text:
|
|
2851
|
-
thought:
|
|
2852
|
-
thoughtSignature:
|
|
2870
|
+
text: z4.string().nullish(),
|
|
2871
|
+
thought: z4.boolean().nullish(),
|
|
2872
|
+
thoughtSignature: z4.string().nullish()
|
|
2853
2873
|
})
|
|
2854
2874
|
])
|
|
2855
2875
|
).nullish()
|
|
2856
2876
|
});
|
|
2857
|
-
var getSafetyRatingSchema = () =>
|
|
2858
|
-
category:
|
|
2859
|
-
probability:
|
|
2860
|
-
probabilityScore:
|
|
2861
|
-
severity:
|
|
2862
|
-
severityScore:
|
|
2863
|
-
blocked:
|
|
2877
|
+
var getSafetyRatingSchema = () => z4.object({
|
|
2878
|
+
category: z4.string().nullish(),
|
|
2879
|
+
probability: z4.string().nullish(),
|
|
2880
|
+
probabilityScore: z4.number().nullish(),
|
|
2881
|
+
severity: z4.string().nullish(),
|
|
2882
|
+
severityScore: z4.number().nullish(),
|
|
2883
|
+
blocked: z4.boolean().nullish()
|
|
2864
2884
|
});
|
|
2865
|
-
var tokenDetailsSchema = () =>
|
|
2866
|
-
|
|
2867
|
-
modality:
|
|
2868
|
-
tokenCount:
|
|
2869
|
-
}).catchall(
|
|
2885
|
+
var tokenDetailsSchema = () => z4.array(
|
|
2886
|
+
z4.object({
|
|
2887
|
+
modality: z4.string(),
|
|
2888
|
+
tokenCount: z4.number()
|
|
2889
|
+
}).catchall(z4.json())
|
|
2870
2890
|
).nullish();
|
|
2871
|
-
var usageSchema = () =>
|
|
2872
|
-
cachedContentTokenCount:
|
|
2873
|
-
thoughtsTokenCount:
|
|
2874
|
-
promptTokenCount:
|
|
2875
|
-
candidatesTokenCount:
|
|
2876
|
-
toolUsePromptTokenCount:
|
|
2877
|
-
totalTokenCount:
|
|
2891
|
+
var usageSchema = () => z4.object({
|
|
2892
|
+
cachedContentTokenCount: z4.number().nullish(),
|
|
2893
|
+
thoughtsTokenCount: z4.number().nullish(),
|
|
2894
|
+
promptTokenCount: z4.number().nullish(),
|
|
2895
|
+
candidatesTokenCount: z4.number().nullish(),
|
|
2896
|
+
toolUsePromptTokenCount: z4.number().nullish(),
|
|
2897
|
+
totalTokenCount: z4.number().nullish(),
|
|
2878
2898
|
// https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerateContentResponse#TrafficType
|
|
2879
|
-
trafficType:
|
|
2880
|
-
serviceTier:
|
|
2899
|
+
trafficType: z4.string().nullish(),
|
|
2900
|
+
serviceTier: z4.string().nullish(),
|
|
2881
2901
|
// https://ai.google.dev/api/generate-content#Modality
|
|
2882
2902
|
promptTokensDetails: tokenDetailsSchema(),
|
|
2883
2903
|
cacheTokensDetails: tokenDetailsSchema(),
|
|
2884
2904
|
candidatesTokensDetails: tokenDetailsSchema(),
|
|
2885
2905
|
toolUsePromptTokensDetails: tokenDetailsSchema()
|
|
2886
|
-
}).catchall(
|
|
2887
|
-
var getUrlContextMetadataSchema = () =>
|
|
2888
|
-
urlMetadata:
|
|
2889
|
-
|
|
2890
|
-
retrievedUrl:
|
|
2891
|
-
urlRetrievalStatus:
|
|
2906
|
+
}).catchall(z4.json());
|
|
2907
|
+
var getUrlContextMetadataSchema = () => z4.object({
|
|
2908
|
+
urlMetadata: z4.array(
|
|
2909
|
+
z4.object({
|
|
2910
|
+
retrievedUrl: z4.string(),
|
|
2911
|
+
urlRetrievalStatus: z4.string()
|
|
2892
2912
|
})
|
|
2893
2913
|
).nullish()
|
|
2894
2914
|
});
|
|
2895
2915
|
var responseSchema = lazySchema3(
|
|
2896
2916
|
() => zodSchema3(
|
|
2897
|
-
|
|
2898
|
-
responseId:
|
|
2899
|
-
candidates:
|
|
2900
|
-
|
|
2901
|
-
content: getContentSchema().nullish().or(
|
|
2902
|
-
finishReason:
|
|
2903
|
-
finishMessage:
|
|
2904
|
-
continuationToken:
|
|
2905
|
-
safetyRatings:
|
|
2917
|
+
z4.object({
|
|
2918
|
+
responseId: z4.string().nullish(),
|
|
2919
|
+
candidates: z4.array(
|
|
2920
|
+
z4.object({
|
|
2921
|
+
content: getContentSchema().nullish().or(z4.object({}).strict()),
|
|
2922
|
+
finishReason: z4.string().nullish(),
|
|
2923
|
+
finishMessage: z4.string().nullish(),
|
|
2924
|
+
continuationToken: z4.string().nullish(),
|
|
2925
|
+
safetyRatings: z4.array(getSafetyRatingSchema()).nullish(),
|
|
2906
2926
|
groundingMetadata: getGroundingMetadataSchema().nullish(),
|
|
2907
2927
|
urlContextMetadata: getUrlContextMetadataSchema().nullish()
|
|
2908
2928
|
})
|
|
2909
2929
|
).nullish(),
|
|
2910
2930
|
usageMetadata: usageSchema().nullish(),
|
|
2911
|
-
promptFeedback:
|
|
2912
|
-
blockReason:
|
|
2913
|
-
safetyRatings:
|
|
2931
|
+
promptFeedback: z4.object({
|
|
2932
|
+
blockReason: z4.string().nullish(),
|
|
2933
|
+
safetyRatings: z4.array(getSafetyRatingSchema()).nullish()
|
|
2914
2934
|
}).nullish()
|
|
2915
2935
|
})
|
|
2916
2936
|
)
|
|
2917
2937
|
);
|
|
2918
2938
|
var chunkSchema = lazySchema3(
|
|
2919
2939
|
() => zodSchema3(
|
|
2920
|
-
|
|
2921
|
-
responseId:
|
|
2922
|
-
candidates:
|
|
2923
|
-
|
|
2940
|
+
z4.object({
|
|
2941
|
+
responseId: z4.string().nullish(),
|
|
2942
|
+
candidates: z4.array(
|
|
2943
|
+
z4.object({
|
|
2924
2944
|
content: getContentSchema().nullish(),
|
|
2925
|
-
finishReason:
|
|
2926
|
-
finishMessage:
|
|
2927
|
-
continuationToken:
|
|
2928
|
-
safetyRatings:
|
|
2945
|
+
finishReason: z4.string().nullish(),
|
|
2946
|
+
finishMessage: z4.string().nullish(),
|
|
2947
|
+
continuationToken: z4.string().nullish(),
|
|
2948
|
+
safetyRatings: z4.array(getSafetyRatingSchema()).nullish(),
|
|
2929
2949
|
groundingMetadata: getGroundingMetadataSchema().nullish(),
|
|
2930
2950
|
urlContextMetadata: getUrlContextMetadataSchema().nullish()
|
|
2931
2951
|
})
|
|
2932
2952
|
).nullish(),
|
|
2933
2953
|
usageMetadata: usageSchema().nullish(),
|
|
2934
|
-
promptFeedback:
|
|
2935
|
-
blockReason:
|
|
2936
|
-
safetyRatings:
|
|
2954
|
+
promptFeedback: z4.object({
|
|
2955
|
+
blockReason: z4.string().nullish(),
|
|
2956
|
+
safetyRatings: z4.array(getSafetyRatingSchema()).nullish()
|
|
2937
2957
|
}).nullish()
|
|
2938
2958
|
})
|
|
2939
2959
|
)
|
|
@@ -2944,16 +2964,16 @@ function isConfirmedPromptBlockReason(blockReason) {
|
|
|
2944
2964
|
|
|
2945
2965
|
// src/tool/code-execution.ts
|
|
2946
2966
|
import { createProviderToolFactoryWithOutputSchema } from "@ai-sdk/provider-utils";
|
|
2947
|
-
import { z as
|
|
2967
|
+
import { z as z5 } from "zod/v4";
|
|
2948
2968
|
var codeExecution = createProviderToolFactoryWithOutputSchema({
|
|
2949
2969
|
id: "google.code_execution",
|
|
2950
|
-
inputSchema:
|
|
2951
|
-
language:
|
|
2952
|
-
code:
|
|
2970
|
+
inputSchema: z5.object({
|
|
2971
|
+
language: z5.string().describe("The programming language of the code."),
|
|
2972
|
+
code: z5.string().describe("The code to be executed.")
|
|
2953
2973
|
}),
|
|
2954
|
-
outputSchema:
|
|
2955
|
-
outcome:
|
|
2956
|
-
output:
|
|
2974
|
+
outputSchema: z5.object({
|
|
2975
|
+
outcome: z5.string().describe('The outcome of the execution (e.g., "OUTCOME_OK").'),
|
|
2976
|
+
output: z5.string().describe("The output from the code execution.")
|
|
2957
2977
|
})
|
|
2958
2978
|
});
|
|
2959
2979
|
|
|
@@ -2963,10 +2983,10 @@ import {
|
|
|
2963
2983
|
lazySchema as lazySchema4,
|
|
2964
2984
|
zodSchema as zodSchema4
|
|
2965
2985
|
} from "@ai-sdk/provider-utils";
|
|
2966
|
-
import { z as
|
|
2986
|
+
import { z as z6 } from "zod/v4";
|
|
2967
2987
|
var enterpriseWebSearch = createProviderToolFactory({
|
|
2968
2988
|
id: "google.enterprise_web_search",
|
|
2969
|
-
inputSchema: lazySchema4(() => zodSchema4(
|
|
2989
|
+
inputSchema: lazySchema4(() => zodSchema4(z6.object({})))
|
|
2970
2990
|
});
|
|
2971
2991
|
|
|
2972
2992
|
// src/tool/file-search.ts
|
|
@@ -2975,20 +2995,20 @@ import {
|
|
|
2975
2995
|
lazySchema as lazySchema5,
|
|
2976
2996
|
zodSchema as zodSchema5
|
|
2977
2997
|
} from "@ai-sdk/provider-utils";
|
|
2978
|
-
import { z as
|
|
2979
|
-
var fileSearchArgsBaseSchema = () =>
|
|
2998
|
+
import { z as z7 } from "zod/v4";
|
|
2999
|
+
var fileSearchArgsBaseSchema = () => z7.object({
|
|
2980
3000
|
/** The names of the file_search_stores to retrieve from.
|
|
2981
3001
|
* Example: `fileSearchStores/my-file-search-store-123`
|
|
2982
3002
|
*/
|
|
2983
|
-
fileSearchStoreNames:
|
|
3003
|
+
fileSearchStoreNames: z7.array(z7.string()).describe(
|
|
2984
3004
|
"The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`"
|
|
2985
3005
|
),
|
|
2986
3006
|
/** The number of file search retrieval chunks to retrieve. */
|
|
2987
|
-
topK:
|
|
3007
|
+
topK: z7.number().int().positive().describe("The number of file search retrieval chunks to retrieve.").optional(),
|
|
2988
3008
|
/** Metadata filter to apply to the file search retrieval documents.
|
|
2989
3009
|
* See https://google.aip.dev/160 for the syntax of the filter expression.
|
|
2990
3010
|
*/
|
|
2991
|
-
metadataFilter:
|
|
3011
|
+
metadataFilter: z7.string().describe(
|
|
2992
3012
|
"Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression."
|
|
2993
3013
|
).optional()
|
|
2994
3014
|
}).passthrough();
|
|
@@ -3006,10 +3026,10 @@ import {
|
|
|
3006
3026
|
lazySchema as lazySchema6,
|
|
3007
3027
|
zodSchema as zodSchema6
|
|
3008
3028
|
} from "@ai-sdk/provider-utils";
|
|
3009
|
-
import { z as
|
|
3029
|
+
import { z as z8 } from "zod/v4";
|
|
3010
3030
|
var googleMaps = createProviderToolFactory3({
|
|
3011
3031
|
id: "google.google_maps",
|
|
3012
|
-
inputSchema: lazySchema6(() => zodSchema6(
|
|
3032
|
+
inputSchema: lazySchema6(() => zodSchema6(z8.object({})))
|
|
3013
3033
|
});
|
|
3014
3034
|
|
|
3015
3035
|
// src/tool/google-search.ts
|
|
@@ -3018,15 +3038,15 @@ import {
|
|
|
3018
3038
|
lazySchema as lazySchema7,
|
|
3019
3039
|
zodSchema as zodSchema7
|
|
3020
3040
|
} from "@ai-sdk/provider-utils";
|
|
3021
|
-
import { z as
|
|
3022
|
-
var googleSearchToolArgsBaseSchema = () =>
|
|
3023
|
-
searchTypes:
|
|
3024
|
-
webSearch:
|
|
3025
|
-
imageSearch:
|
|
3041
|
+
import { z as z9 } from "zod/v4";
|
|
3042
|
+
var googleSearchToolArgsBaseSchema = () => z9.object({
|
|
3043
|
+
searchTypes: z9.object({
|
|
3044
|
+
webSearch: z9.object({}).optional(),
|
|
3045
|
+
imageSearch: z9.object({}).optional()
|
|
3026
3046
|
}).optional(),
|
|
3027
|
-
timeRangeFilter:
|
|
3028
|
-
startTime:
|
|
3029
|
-
endTime:
|
|
3047
|
+
timeRangeFilter: z9.object({
|
|
3048
|
+
startTime: z9.string(),
|
|
3049
|
+
endTime: z9.string()
|
|
3030
3050
|
}).optional()
|
|
3031
3051
|
}).passthrough();
|
|
3032
3052
|
var googleSearchToolArgsSchema = lazySchema7(
|
|
@@ -3045,20 +3065,20 @@ import {
|
|
|
3045
3065
|
lazySchema as lazySchema8,
|
|
3046
3066
|
zodSchema as zodSchema8
|
|
3047
3067
|
} from "@ai-sdk/provider-utils";
|
|
3048
|
-
import { z as
|
|
3068
|
+
import { z as z10 } from "zod/v4";
|
|
3049
3069
|
var urlContext = createProviderToolFactory5({
|
|
3050
3070
|
id: "google.url_context",
|
|
3051
|
-
inputSchema: lazySchema8(() => zodSchema8(
|
|
3071
|
+
inputSchema: lazySchema8(() => zodSchema8(z10.object({})))
|
|
3052
3072
|
});
|
|
3053
3073
|
|
|
3054
3074
|
// src/tool/vertex-rag-store.ts
|
|
3055
3075
|
import { createProviderToolFactory as createProviderToolFactory6 } from "@ai-sdk/provider-utils";
|
|
3056
|
-
import { z as
|
|
3076
|
+
import { z as z11 } from "zod/v4";
|
|
3057
3077
|
var vertexRagStore = createProviderToolFactory6({
|
|
3058
3078
|
id: "google.vertex_rag_store",
|
|
3059
|
-
inputSchema:
|
|
3060
|
-
ragCorpus:
|
|
3061
|
-
topK:
|
|
3079
|
+
inputSchema: z11.object({
|
|
3080
|
+
ragCorpus: z11.string(),
|
|
3081
|
+
topK: z11.number().optional()
|
|
3062
3082
|
})
|
|
3063
3083
|
});
|
|
3064
3084
|
|
|
@@ -4291,30 +4311,30 @@ import {
|
|
|
4291
4311
|
lazySchema as lazySchema9,
|
|
4292
4312
|
zodSchema as zodSchema9
|
|
4293
4313
|
} from "@ai-sdk/provider-utils";
|
|
4294
|
-
import { z as
|
|
4295
|
-
var tokenByModalitySchema = () =>
|
|
4296
|
-
modality:
|
|
4297
|
-
tokens:
|
|
4314
|
+
import { z as z12 } from "zod/v4";
|
|
4315
|
+
var tokenByModalitySchema = () => z12.object({
|
|
4316
|
+
modality: z12.string().nullish(),
|
|
4317
|
+
tokens: z12.number().nullish()
|
|
4298
4318
|
}).loose();
|
|
4299
|
-
var usageSchema2 = () =>
|
|
4300
|
-
total_input_tokens:
|
|
4301
|
-
total_output_tokens:
|
|
4302
|
-
total_thought_tokens:
|
|
4303
|
-
total_cached_tokens:
|
|
4304
|
-
total_tool_use_tokens:
|
|
4305
|
-
total_tokens:
|
|
4306
|
-
input_tokens_by_modality:
|
|
4307
|
-
output_tokens_by_modality:
|
|
4308
|
-
cached_tokens_by_modality:
|
|
4309
|
-
tool_use_tokens_by_modality:
|
|
4310
|
-
grounding_tool_count:
|
|
4311
|
-
|
|
4312
|
-
type:
|
|
4313
|
-
count:
|
|
4319
|
+
var usageSchema2 = () => z12.object({
|
|
4320
|
+
total_input_tokens: z12.number().nullish(),
|
|
4321
|
+
total_output_tokens: z12.number().nullish(),
|
|
4322
|
+
total_thought_tokens: z12.number().nullish(),
|
|
4323
|
+
total_cached_tokens: z12.number().nullish(),
|
|
4324
|
+
total_tool_use_tokens: z12.number().nullish(),
|
|
4325
|
+
total_tokens: z12.number().nullish(),
|
|
4326
|
+
input_tokens_by_modality: z12.array(tokenByModalitySchema()).nullish(),
|
|
4327
|
+
output_tokens_by_modality: z12.array(tokenByModalitySchema()).nullish(),
|
|
4328
|
+
cached_tokens_by_modality: z12.array(tokenByModalitySchema()).nullish(),
|
|
4329
|
+
tool_use_tokens_by_modality: z12.array(tokenByModalitySchema()).nullish(),
|
|
4330
|
+
grounding_tool_count: z12.array(
|
|
4331
|
+
z12.object({
|
|
4332
|
+
type: z12.string().nullish(),
|
|
4333
|
+
count: z12.number().nullish()
|
|
4314
4334
|
}).loose()
|
|
4315
4335
|
).nullish()
|
|
4316
4336
|
}).loose();
|
|
4317
|
-
var interactionStatusSchema = () =>
|
|
4337
|
+
var interactionStatusSchema = () => z12.enum([
|
|
4318
4338
|
"in_progress",
|
|
4319
4339
|
"requires_action",
|
|
4320
4340
|
"completed",
|
|
@@ -4323,69 +4343,69 @@ var interactionStatusSchema = () => z11.enum([
|
|
|
4323
4343
|
"incomplete"
|
|
4324
4344
|
]);
|
|
4325
4345
|
var annotationSchema = () => {
|
|
4326
|
-
const urlCitation =
|
|
4327
|
-
type:
|
|
4328
|
-
url:
|
|
4329
|
-
title:
|
|
4330
|
-
start_index:
|
|
4331
|
-
end_index:
|
|
4346
|
+
const urlCitation = z12.object({
|
|
4347
|
+
type: z12.literal("url_citation"),
|
|
4348
|
+
url: z12.string().nullish(),
|
|
4349
|
+
title: z12.string().nullish(),
|
|
4350
|
+
start_index: z12.number().nullish(),
|
|
4351
|
+
end_index: z12.number().nullish()
|
|
4332
4352
|
}).loose();
|
|
4333
|
-
const fileCitation =
|
|
4334
|
-
type:
|
|
4335
|
-
file_name:
|
|
4336
|
-
document_uri:
|
|
4337
|
-
url:
|
|
4338
|
-
page_number:
|
|
4339
|
-
media_id:
|
|
4340
|
-
start_index:
|
|
4341
|
-
end_index:
|
|
4342
|
-
custom_metadata:
|
|
4353
|
+
const fileCitation = z12.object({
|
|
4354
|
+
type: z12.literal("file_citation"),
|
|
4355
|
+
file_name: z12.string().nullish(),
|
|
4356
|
+
document_uri: z12.string().nullish(),
|
|
4357
|
+
url: z12.string().nullish(),
|
|
4358
|
+
page_number: z12.number().nullish(),
|
|
4359
|
+
media_id: z12.string().nullish(),
|
|
4360
|
+
start_index: z12.number().nullish(),
|
|
4361
|
+
end_index: z12.number().nullish(),
|
|
4362
|
+
custom_metadata: z12.record(z12.string(), z12.unknown()).nullish()
|
|
4343
4363
|
}).loose();
|
|
4344
|
-
const placeCitation =
|
|
4345
|
-
type:
|
|
4346
|
-
name:
|
|
4347
|
-
url:
|
|
4348
|
-
place_id:
|
|
4349
|
-
start_index:
|
|
4350
|
-
end_index:
|
|
4364
|
+
const placeCitation = z12.object({
|
|
4365
|
+
type: z12.literal("place_citation"),
|
|
4366
|
+
name: z12.string().nullish(),
|
|
4367
|
+
url: z12.string().nullish(),
|
|
4368
|
+
place_id: z12.string().nullish(),
|
|
4369
|
+
start_index: z12.number().nullish(),
|
|
4370
|
+
end_index: z12.number().nullish()
|
|
4351
4371
|
}).loose();
|
|
4352
|
-
return
|
|
4372
|
+
return z12.union([
|
|
4353
4373
|
urlCitation,
|
|
4354
4374
|
fileCitation,
|
|
4355
4375
|
placeCitation,
|
|
4356
|
-
|
|
4376
|
+
z12.object({ type: z12.string() }).loose()
|
|
4357
4377
|
]);
|
|
4358
4378
|
};
|
|
4359
|
-
var thoughtSummaryItemSchema = () =>
|
|
4360
|
-
type:
|
|
4361
|
-
text:
|
|
4362
|
-
data:
|
|
4363
|
-
mime_type:
|
|
4379
|
+
var thoughtSummaryItemSchema = () => z12.object({
|
|
4380
|
+
type: z12.string(),
|
|
4381
|
+
text: z12.string().nullish(),
|
|
4382
|
+
data: z12.string().nullish(),
|
|
4383
|
+
mime_type: z12.string().nullish()
|
|
4364
4384
|
}).loose();
|
|
4365
4385
|
var contentBlockSchema = () => {
|
|
4366
|
-
const textContent =
|
|
4367
|
-
type:
|
|
4368
|
-
text:
|
|
4369
|
-
annotations:
|
|
4386
|
+
const textContent = z12.object({
|
|
4387
|
+
type: z12.literal("text"),
|
|
4388
|
+
text: z12.string(),
|
|
4389
|
+
annotations: z12.array(annotationSchema()).nullish()
|
|
4370
4390
|
}).loose();
|
|
4371
|
-
const imageContent =
|
|
4372
|
-
type:
|
|
4373
|
-
data:
|
|
4374
|
-
mime_type:
|
|
4375
|
-
resolution:
|
|
4376
|
-
uri:
|
|
4391
|
+
const imageContent = z12.object({
|
|
4392
|
+
type: z12.literal("image"),
|
|
4393
|
+
data: z12.string().nullish(),
|
|
4394
|
+
mime_type: z12.string().nullish(),
|
|
4395
|
+
resolution: z12.enum(["low", "medium", "high", "ultra_high"]).nullish(),
|
|
4396
|
+
uri: z12.string().nullish()
|
|
4377
4397
|
}).loose();
|
|
4378
|
-
const videoContent =
|
|
4379
|
-
type:
|
|
4380
|
-
data:
|
|
4381
|
-
mime_type:
|
|
4382
|
-
uri:
|
|
4398
|
+
const videoContent = z12.object({
|
|
4399
|
+
type: z12.literal("video"),
|
|
4400
|
+
data: z12.string().nullish(),
|
|
4401
|
+
mime_type: z12.string().nullish(),
|
|
4402
|
+
uri: z12.string().nullish()
|
|
4383
4403
|
}).loose();
|
|
4384
|
-
return
|
|
4404
|
+
return z12.union([
|
|
4385
4405
|
textContent,
|
|
4386
4406
|
imageContent,
|
|
4387
4407
|
videoContent,
|
|
4388
|
-
|
|
4408
|
+
z12.object({ type: z12.string() }).loose()
|
|
4389
4409
|
]);
|
|
4390
4410
|
};
|
|
4391
4411
|
var BUILTIN_TOOL_CALL_STEP_TYPES = [
|
|
@@ -4405,73 +4425,73 @@ var BUILTIN_TOOL_RESULT_STEP_TYPES = [
|
|
|
4405
4425
|
"mcp_server_tool_result"
|
|
4406
4426
|
];
|
|
4407
4427
|
var stepSchema = () => {
|
|
4408
|
-
const userInputStep =
|
|
4409
|
-
type:
|
|
4410
|
-
content:
|
|
4428
|
+
const userInputStep = z12.object({
|
|
4429
|
+
type: z12.literal("user_input"),
|
|
4430
|
+
content: z12.array(contentBlockSchema()).nullish()
|
|
4411
4431
|
}).loose();
|
|
4412
|
-
const modelOutputStep =
|
|
4413
|
-
type:
|
|
4414
|
-
content:
|
|
4432
|
+
const modelOutputStep = z12.object({
|
|
4433
|
+
type: z12.literal("model_output"),
|
|
4434
|
+
content: z12.array(contentBlockSchema()).nullish()
|
|
4415
4435
|
}).loose();
|
|
4416
|
-
const functionCallStep =
|
|
4417
|
-
type:
|
|
4418
|
-
id:
|
|
4419
|
-
name:
|
|
4420
|
-
arguments:
|
|
4421
|
-
signature:
|
|
4436
|
+
const functionCallStep = z12.object({
|
|
4437
|
+
type: z12.literal("function_call"),
|
|
4438
|
+
id: z12.string(),
|
|
4439
|
+
name: z12.string(),
|
|
4440
|
+
arguments: z12.record(z12.string(), z12.unknown()).nullish(),
|
|
4441
|
+
signature: z12.string().nullish()
|
|
4422
4442
|
}).loose();
|
|
4423
|
-
const thoughtStep =
|
|
4424
|
-
type:
|
|
4425
|
-
signature:
|
|
4426
|
-
summary:
|
|
4443
|
+
const thoughtStep = z12.object({
|
|
4444
|
+
type: z12.literal("thought"),
|
|
4445
|
+
signature: z12.string().nullish(),
|
|
4446
|
+
summary: z12.array(thoughtSummaryItemSchema()).nullish()
|
|
4427
4447
|
}).loose();
|
|
4428
|
-
const builtinToolCallStep =
|
|
4429
|
-
type:
|
|
4430
|
-
id:
|
|
4431
|
-
arguments:
|
|
4432
|
-
name:
|
|
4433
|
-
server_name:
|
|
4434
|
-
search_type:
|
|
4435
|
-
signature:
|
|
4448
|
+
const builtinToolCallStep = z12.object({
|
|
4449
|
+
type: z12.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
|
|
4450
|
+
id: z12.string(),
|
|
4451
|
+
arguments: z12.record(z12.string(), z12.unknown()).nullish(),
|
|
4452
|
+
name: z12.string().nullish(),
|
|
4453
|
+
server_name: z12.string().nullish(),
|
|
4454
|
+
search_type: z12.string().nullish(),
|
|
4455
|
+
signature: z12.string().nullish()
|
|
4436
4456
|
}).loose();
|
|
4437
|
-
const builtinToolResultStep =
|
|
4438
|
-
type:
|
|
4439
|
-
call_id:
|
|
4440
|
-
result:
|
|
4441
|
-
is_error:
|
|
4442
|
-
name:
|
|
4443
|
-
server_name:
|
|
4444
|
-
signature:
|
|
4457
|
+
const builtinToolResultStep = z12.object({
|
|
4458
|
+
type: z12.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
|
|
4459
|
+
call_id: z12.string(),
|
|
4460
|
+
result: z12.unknown().nullish(),
|
|
4461
|
+
is_error: z12.boolean().nullish(),
|
|
4462
|
+
name: z12.string().nullish(),
|
|
4463
|
+
server_name: z12.string().nullish(),
|
|
4464
|
+
signature: z12.string().nullish()
|
|
4445
4465
|
}).loose();
|
|
4446
|
-
return
|
|
4466
|
+
return z12.union([
|
|
4447
4467
|
userInputStep,
|
|
4448
4468
|
modelOutputStep,
|
|
4449
4469
|
functionCallStep,
|
|
4450
4470
|
thoughtStep,
|
|
4451
4471
|
builtinToolCallStep,
|
|
4452
4472
|
builtinToolResultStep,
|
|
4453
|
-
|
|
4473
|
+
z12.object({ type: z12.string() }).loose()
|
|
4454
4474
|
]);
|
|
4455
4475
|
};
|
|
4456
4476
|
var googleInteractionsResponseSchema = lazySchema9(
|
|
4457
4477
|
() => zodSchema9(
|
|
4458
|
-
|
|
4478
|
+
z12.object({
|
|
4459
4479
|
/*
|
|
4460
4480
|
* `id` is omitted from the response body when `store: false` (fully
|
|
4461
4481
|
* stateless mode) — there is no server-side interaction record for the
|
|
4462
4482
|
* client to reference. `nullish` lets the schema accept that shape.
|
|
4463
4483
|
*/
|
|
4464
|
-
id:
|
|
4465
|
-
created:
|
|
4466
|
-
updated:
|
|
4484
|
+
id: z12.string().nullish(),
|
|
4485
|
+
created: z12.string().nullish(),
|
|
4486
|
+
updated: z12.string().nullish(),
|
|
4467
4487
|
status: interactionStatusSchema(),
|
|
4468
|
-
model:
|
|
4469
|
-
agent:
|
|
4470
|
-
steps:
|
|
4488
|
+
model: z12.string().nullish(),
|
|
4489
|
+
agent: z12.string().nullish(),
|
|
4490
|
+
steps: z12.array(stepSchema()).nullish(),
|
|
4471
4491
|
usage: usageSchema2().nullish(),
|
|
4472
|
-
service_tier:
|
|
4473
|
-
previous_interaction_id:
|
|
4474
|
-
response_modalities:
|
|
4492
|
+
service_tier: z12.string().nullish(),
|
|
4493
|
+
previous_interaction_id: z12.string().nullish(),
|
|
4494
|
+
response_modalities: z12.array(z12.string()).nullish()
|
|
4475
4495
|
}).loose()
|
|
4476
4496
|
)
|
|
4477
4497
|
);
|
|
@@ -4481,82 +4501,82 @@ var googleInteractionsEventSchema = lazySchema9(
|
|
|
4481
4501
|
const status = interactionStatusSchema();
|
|
4482
4502
|
const annotation = annotationSchema();
|
|
4483
4503
|
const thoughtSummaryItem = thoughtSummaryItemSchema();
|
|
4484
|
-
const interactionCreatedEvent =
|
|
4485
|
-
event_type:
|
|
4486
|
-
event_id:
|
|
4487
|
-
interaction:
|
|
4504
|
+
const interactionCreatedEvent = z12.object({
|
|
4505
|
+
event_type: z12.literal("interaction.created"),
|
|
4506
|
+
event_id: z12.string().nullish(),
|
|
4507
|
+
interaction: z12.object({
|
|
4488
4508
|
/*
|
|
4489
4509
|
* `id` is omitted when `store: false` (fully stateless mode);
|
|
4490
4510
|
* see the matching note on `googleInteractionsResponseSchema.id`.
|
|
4491
4511
|
*/
|
|
4492
|
-
id:
|
|
4493
|
-
created:
|
|
4494
|
-
model:
|
|
4495
|
-
agent:
|
|
4512
|
+
id: z12.string().nullish(),
|
|
4513
|
+
created: z12.string().nullish(),
|
|
4514
|
+
model: z12.string().nullish(),
|
|
4515
|
+
agent: z12.string().nullish(),
|
|
4496
4516
|
status: status.nullish()
|
|
4497
4517
|
}).loose()
|
|
4498
4518
|
}).loose();
|
|
4499
|
-
const stepStartEvent =
|
|
4500
|
-
event_type:
|
|
4501
|
-
event_id:
|
|
4502
|
-
index:
|
|
4519
|
+
const stepStartEvent = z12.object({
|
|
4520
|
+
event_type: z12.literal("step.start"),
|
|
4521
|
+
event_id: z12.string().nullish(),
|
|
4522
|
+
index: z12.number(),
|
|
4503
4523
|
step: stepSchema()
|
|
4504
4524
|
}).loose();
|
|
4505
|
-
const stepDeltaText =
|
|
4506
|
-
type:
|
|
4507
|
-
text:
|
|
4525
|
+
const stepDeltaText = z12.object({
|
|
4526
|
+
type: z12.literal("text"),
|
|
4527
|
+
text: z12.string()
|
|
4508
4528
|
}).loose();
|
|
4509
|
-
const stepDeltaThoughtSummary =
|
|
4510
|
-
type:
|
|
4529
|
+
const stepDeltaThoughtSummary = z12.object({
|
|
4530
|
+
type: z12.literal("thought_summary"),
|
|
4511
4531
|
content: thoughtSummaryItem.nullish()
|
|
4512
4532
|
}).loose();
|
|
4513
|
-
const stepDeltaThoughtSignature =
|
|
4514
|
-
type:
|
|
4515
|
-
signature:
|
|
4533
|
+
const stepDeltaThoughtSignature = z12.object({
|
|
4534
|
+
type: z12.literal("thought_signature"),
|
|
4535
|
+
signature: z12.string().nullish()
|
|
4516
4536
|
}).loose();
|
|
4517
|
-
const stepDeltaArgumentsDelta =
|
|
4518
|
-
type:
|
|
4519
|
-
arguments:
|
|
4520
|
-
id:
|
|
4521
|
-
signature:
|
|
4537
|
+
const stepDeltaArgumentsDelta = z12.object({
|
|
4538
|
+
type: z12.literal("arguments_delta"),
|
|
4539
|
+
arguments: z12.string().nullish(),
|
|
4540
|
+
id: z12.string().nullish(),
|
|
4541
|
+
signature: z12.string().nullish()
|
|
4522
4542
|
}).loose();
|
|
4523
|
-
const stepDeltaTextAnnotation =
|
|
4524
|
-
type:
|
|
4525
|
-
annotations:
|
|
4543
|
+
const stepDeltaTextAnnotation = z12.object({
|
|
4544
|
+
type: z12.enum(["text_annotation_delta", "text_annotation"]),
|
|
4545
|
+
annotations: z12.array(annotation).nullish()
|
|
4526
4546
|
}).loose();
|
|
4527
|
-
const stepDeltaImage =
|
|
4528
|
-
type:
|
|
4529
|
-
data:
|
|
4530
|
-
mime_type:
|
|
4531
|
-
resolution:
|
|
4532
|
-
uri:
|
|
4547
|
+
const stepDeltaImage = z12.object({
|
|
4548
|
+
type: z12.literal("image"),
|
|
4549
|
+
data: z12.string().nullish(),
|
|
4550
|
+
mime_type: z12.string().nullish(),
|
|
4551
|
+
resolution: z12.enum(["low", "medium", "high", "ultra_high"]).nullish(),
|
|
4552
|
+
uri: z12.string().nullish()
|
|
4533
4553
|
}).loose();
|
|
4534
|
-
const stepDeltaVideo =
|
|
4535
|
-
type:
|
|
4536
|
-
data:
|
|
4537
|
-
mime_type:
|
|
4538
|
-
uri:
|
|
4554
|
+
const stepDeltaVideo = z12.object({
|
|
4555
|
+
type: z12.literal("video"),
|
|
4556
|
+
data: z12.string().nullish(),
|
|
4557
|
+
mime_type: z12.string().nullish(),
|
|
4558
|
+
uri: z12.string().nullish()
|
|
4539
4559
|
}).loose();
|
|
4540
|
-
const stepDeltaBuiltinToolCall =
|
|
4541
|
-
type:
|
|
4542
|
-
id:
|
|
4543
|
-
arguments:
|
|
4544
|
-
name:
|
|
4545
|
-
server_name:
|
|
4546
|
-
search_type:
|
|
4547
|
-
signature:
|
|
4560
|
+
const stepDeltaBuiltinToolCall = z12.object({
|
|
4561
|
+
type: z12.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
|
|
4562
|
+
id: z12.string().nullish(),
|
|
4563
|
+
arguments: z12.record(z12.string(), z12.unknown()).nullish(),
|
|
4564
|
+
name: z12.string().nullish(),
|
|
4565
|
+
server_name: z12.string().nullish(),
|
|
4566
|
+
search_type: z12.string().nullish(),
|
|
4567
|
+
signature: z12.string().nullish()
|
|
4548
4568
|
}).loose();
|
|
4549
|
-
const stepDeltaBuiltinToolResult =
|
|
4550
|
-
type:
|
|
4551
|
-
call_id:
|
|
4552
|
-
result:
|
|
4553
|
-
is_error:
|
|
4554
|
-
name:
|
|
4555
|
-
server_name:
|
|
4556
|
-
signature:
|
|
4569
|
+
const stepDeltaBuiltinToolResult = z12.object({
|
|
4570
|
+
type: z12.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
|
|
4571
|
+
call_id: z12.string().nullish(),
|
|
4572
|
+
result: z12.unknown().nullish(),
|
|
4573
|
+
is_error: z12.boolean().nullish(),
|
|
4574
|
+
name: z12.string().nullish(),
|
|
4575
|
+
server_name: z12.string().nullish(),
|
|
4576
|
+
signature: z12.string().nullish()
|
|
4557
4577
|
}).loose();
|
|
4558
|
-
const stepDeltaUnknown =
|
|
4559
|
-
const stepDeltaUnion =
|
|
4578
|
+
const stepDeltaUnknown = z12.object({ type: z12.string() }).loose();
|
|
4579
|
+
const stepDeltaUnion = z12.union([
|
|
4560
4580
|
stepDeltaText,
|
|
4561
4581
|
stepDeltaImage,
|
|
4562
4582
|
stepDeltaVideo,
|
|
@@ -4568,55 +4588,55 @@ var googleInteractionsEventSchema = lazySchema9(
|
|
|
4568
4588
|
stepDeltaBuiltinToolResult,
|
|
4569
4589
|
stepDeltaUnknown
|
|
4570
4590
|
]);
|
|
4571
|
-
const stepDeltaEvent =
|
|
4572
|
-
event_type:
|
|
4573
|
-
event_id:
|
|
4574
|
-
index:
|
|
4591
|
+
const stepDeltaEvent = z12.object({
|
|
4592
|
+
event_type: z12.literal("step.delta"),
|
|
4593
|
+
event_id: z12.string().nullish(),
|
|
4594
|
+
index: z12.number(),
|
|
4575
4595
|
delta: stepDeltaUnion
|
|
4576
4596
|
}).loose();
|
|
4577
|
-
const stepStopEvent =
|
|
4578
|
-
event_type:
|
|
4579
|
-
event_id:
|
|
4580
|
-
index:
|
|
4597
|
+
const stepStopEvent = z12.object({
|
|
4598
|
+
event_type: z12.literal("step.stop"),
|
|
4599
|
+
event_id: z12.string().nullish(),
|
|
4600
|
+
index: z12.number()
|
|
4581
4601
|
}).loose();
|
|
4582
|
-
const interactionStatusUpdateEvent =
|
|
4583
|
-
event_type:
|
|
4584
|
-
event_id:
|
|
4585
|
-
interaction_id:
|
|
4602
|
+
const interactionStatusUpdateEvent = z12.object({
|
|
4603
|
+
event_type: z12.literal("interaction.status_update"),
|
|
4604
|
+
event_id: z12.string().nullish(),
|
|
4605
|
+
interaction_id: z12.string().nullish(),
|
|
4586
4606
|
status: status.nullish()
|
|
4587
4607
|
}).loose();
|
|
4588
|
-
const interactionInProgressEvent =
|
|
4589
|
-
event_type:
|
|
4590
|
-
event_id:
|
|
4591
|
-
interaction_id:
|
|
4608
|
+
const interactionInProgressEvent = z12.object({
|
|
4609
|
+
event_type: z12.literal("interaction.in_progress"),
|
|
4610
|
+
event_id: z12.string().nullish(),
|
|
4611
|
+
interaction_id: z12.string().nullish(),
|
|
4592
4612
|
status: status.nullish()
|
|
4593
4613
|
}).loose();
|
|
4594
|
-
const interactionRequiresActionEvent =
|
|
4595
|
-
event_type:
|
|
4596
|
-
event_id:
|
|
4597
|
-
interaction_id:
|
|
4614
|
+
const interactionRequiresActionEvent = z12.object({
|
|
4615
|
+
event_type: z12.literal("interaction.requires_action"),
|
|
4616
|
+
event_id: z12.string().nullish(),
|
|
4617
|
+
interaction_id: z12.string().nullish(),
|
|
4598
4618
|
status: status.nullish()
|
|
4599
4619
|
}).loose();
|
|
4600
|
-
const interactionCompletedEvent =
|
|
4601
|
-
event_type:
|
|
4602
|
-
event_id:
|
|
4603
|
-
interaction:
|
|
4604
|
-
id:
|
|
4620
|
+
const interactionCompletedEvent = z12.object({
|
|
4621
|
+
event_type: z12.literal("interaction.completed"),
|
|
4622
|
+
event_id: z12.string().nullish(),
|
|
4623
|
+
interaction: z12.object({
|
|
4624
|
+
id: z12.string().nullish(),
|
|
4605
4625
|
status: status.nullish(),
|
|
4606
4626
|
usage: usageSchema2().nullish(),
|
|
4607
|
-
service_tier:
|
|
4627
|
+
service_tier: z12.string().nullish()
|
|
4608
4628
|
}).loose()
|
|
4609
4629
|
}).loose();
|
|
4610
|
-
const errorEvent =
|
|
4611
|
-
event_type:
|
|
4612
|
-
event_id:
|
|
4613
|
-
error:
|
|
4614
|
-
code:
|
|
4615
|
-
message:
|
|
4630
|
+
const errorEvent = z12.object({
|
|
4631
|
+
event_type: z12.literal("error"),
|
|
4632
|
+
event_id: z12.string().nullish(),
|
|
4633
|
+
error: z12.object({
|
|
4634
|
+
code: z12.string().nullish(),
|
|
4635
|
+
message: z12.string().nullish()
|
|
4616
4636
|
}).loose().nullish()
|
|
4617
4637
|
}).loose();
|
|
4618
|
-
const unknownEvent =
|
|
4619
|
-
return
|
|
4638
|
+
const unknownEvent = z12.object({ event_type: z12.string() }).loose();
|
|
4639
|
+
return z12.union([
|
|
4620
4640
|
interactionCreatedEvent,
|
|
4621
4641
|
stepStartEvent,
|
|
4622
4642
|
stepDeltaEvent,
|
|
@@ -4637,26 +4657,26 @@ import {
|
|
|
4637
4657
|
lazySchema as lazySchema10,
|
|
4638
4658
|
zodSchema as zodSchema10
|
|
4639
4659
|
} from "@ai-sdk/provider-utils";
|
|
4640
|
-
import { z as
|
|
4660
|
+
import { z as z13 } from "zod/v4";
|
|
4641
4661
|
var googleInteractionsLanguageModelOptions = lazySchema10(
|
|
4642
4662
|
() => zodSchema10(
|
|
4643
|
-
|
|
4644
|
-
previousInteractionId:
|
|
4645
|
-
store:
|
|
4646
|
-
agent:
|
|
4647
|
-
agentConfig:
|
|
4648
|
-
|
|
4649
|
-
type:
|
|
4663
|
+
z13.object({
|
|
4664
|
+
previousInteractionId: z13.string().nullish(),
|
|
4665
|
+
store: z13.boolean().nullish(),
|
|
4666
|
+
agent: z13.string().nullish(),
|
|
4667
|
+
agentConfig: z13.union([
|
|
4668
|
+
z13.object({
|
|
4669
|
+
type: z13.literal("dynamic")
|
|
4650
4670
|
}).loose(),
|
|
4651
|
-
|
|
4652
|
-
type:
|
|
4653
|
-
thinkingSummaries:
|
|
4654
|
-
visualization:
|
|
4655
|
-
collaborativePlanning:
|
|
4671
|
+
z13.object({
|
|
4672
|
+
type: z13.literal("deep-research"),
|
|
4673
|
+
thinkingSummaries: z13.enum(["auto", "none"]).nullish(),
|
|
4674
|
+
visualization: z13.enum(["off", "auto"]).nullish(),
|
|
4675
|
+
collaborativePlanning: z13.boolean().nullish()
|
|
4656
4676
|
})
|
|
4657
4677
|
]).nullish(),
|
|
4658
|
-
thinkingLevel:
|
|
4659
|
-
thinkingSummaries:
|
|
4678
|
+
thinkingLevel: z13.enum(["minimal", "low", "medium", "high"]).nullish(),
|
|
4679
|
+
thinkingSummaries: z13.enum(["auto", "none"]).nullish(),
|
|
4660
4680
|
/**
|
|
4661
4681
|
* Output-format entries that map directly to the API's `response_format`
|
|
4662
4682
|
* array. Use this to request image, audio, video, or non-JSON text
|
|
@@ -4666,17 +4686,17 @@ var googleInteractionsLanguageModelOptions = lazySchema10(
|
|
|
4666
4686
|
* type: 'json', schema }` still drives JSON-mode and adds a matching
|
|
4667
4687
|
* text entry automatically; entries listed here are appended.
|
|
4668
4688
|
*/
|
|
4669
|
-
responseFormat:
|
|
4670
|
-
|
|
4671
|
-
|
|
4672
|
-
type:
|
|
4673
|
-
mimeType:
|
|
4674
|
-
schema:
|
|
4689
|
+
responseFormat: z13.array(
|
|
4690
|
+
z13.union([
|
|
4691
|
+
z13.object({
|
|
4692
|
+
type: z13.literal("text"),
|
|
4693
|
+
mimeType: z13.string().nullish(),
|
|
4694
|
+
schema: z13.unknown().nullish()
|
|
4675
4695
|
}).loose(),
|
|
4676
|
-
|
|
4677
|
-
type:
|
|
4678
|
-
mimeType:
|
|
4679
|
-
aspectRatio:
|
|
4696
|
+
z13.object({
|
|
4697
|
+
type: z13.literal("image"),
|
|
4698
|
+
mimeType: z13.string().nullish(),
|
|
4699
|
+
aspectRatio: z13.enum([
|
|
4680
4700
|
"1:1",
|
|
4681
4701
|
"2:3",
|
|
4682
4702
|
"3:2",
|
|
@@ -4692,19 +4712,19 @@ var googleInteractionsLanguageModelOptions = lazySchema10(
|
|
|
4692
4712
|
"1:4",
|
|
4693
4713
|
"4:1"
|
|
4694
4714
|
]).nullish(),
|
|
4695
|
-
imageSize:
|
|
4715
|
+
imageSize: z13.enum(["1K", "2K", "4K", "512"]).nullish()
|
|
4696
4716
|
}).loose(),
|
|
4697
|
-
|
|
4698
|
-
type:
|
|
4699
|
-
mimeType:
|
|
4717
|
+
z13.object({
|
|
4718
|
+
type: z13.literal("audio"),
|
|
4719
|
+
mimeType: z13.string().nullish()
|
|
4700
4720
|
}).loose(),
|
|
4701
|
-
|
|
4702
|
-
type:
|
|
4703
|
-
aspectRatio:
|
|
4704
|
-
resolution:
|
|
4705
|
-
duration:
|
|
4706
|
-
delivery:
|
|
4707
|
-
gcsUri:
|
|
4721
|
+
z13.object({
|
|
4722
|
+
type: z13.literal("video"),
|
|
4723
|
+
aspectRatio: z13.enum(["16:9", "9:16"]).nullish(),
|
|
4724
|
+
resolution: z13.enum(["360p", "720p", "1080p", "4k"]).nullish(),
|
|
4725
|
+
duration: z13.string().nullish(),
|
|
4726
|
+
delivery: z13.enum(["inline", "uri"]).nullish(),
|
|
4727
|
+
gcsUri: z13.string().nullish()
|
|
4708
4728
|
}).loose()
|
|
4709
4729
|
])
|
|
4710
4730
|
).nullish(),
|
|
@@ -4714,8 +4734,8 @@ var googleInteractionsLanguageModelOptions = lazySchema10(
|
|
|
4714
4734
|
* translates it into a matching `response_format` image entry and
|
|
4715
4735
|
* emits a warning when set.
|
|
4716
4736
|
*/
|
|
4717
|
-
imageConfig:
|
|
4718
|
-
aspectRatio:
|
|
4737
|
+
imageConfig: z13.object({
|
|
4738
|
+
aspectRatio: z13.enum([
|
|
4719
4739
|
"1:1",
|
|
4720
4740
|
"2:3",
|
|
4721
4741
|
"3:2",
|
|
@@ -4731,35 +4751,35 @@ var googleInteractionsLanguageModelOptions = lazySchema10(
|
|
|
4731
4751
|
"1:4",
|
|
4732
4752
|
"4:1"
|
|
4733
4753
|
]).nullish(),
|
|
4734
|
-
imageSize:
|
|
4754
|
+
imageSize: z13.enum(["1K", "2K", "4K", "512"]).nullish()
|
|
4735
4755
|
}).nullish(),
|
|
4736
|
-
mediaResolution:
|
|
4737
|
-
responseModalities:
|
|
4738
|
-
serviceTier:
|
|
4756
|
+
mediaResolution: z13.enum(["low", "medium", "high", "ultra_high"]).nullish(),
|
|
4757
|
+
responseModalities: z13.array(z13.enum(["text", "image", "audio", "video", "document"])).nullish(),
|
|
4758
|
+
serviceTier: z13.enum(["flex", "standard", "priority"]).nullish(),
|
|
4739
4759
|
/**
|
|
4740
4760
|
* Alternative to AI SDK `system` message. If both are set, the AI SDK
|
|
4741
4761
|
* `system` message wins and a warning is emitted.
|
|
4742
4762
|
*/
|
|
4743
|
-
systemInstruction:
|
|
4763
|
+
systemInstruction: z13.string().nullish(),
|
|
4744
4764
|
/**
|
|
4745
4765
|
* Per-block signature for round-tripping `thought.signature` and
|
|
4746
4766
|
* `function_call.signature` blocks. Set by the SDK on output reasoning /
|
|
4747
4767
|
* tool-call parts; passed back unchanged on input parts so the API
|
|
4748
4768
|
* accepts the prior turn.
|
|
4749
4769
|
*/
|
|
4750
|
-
signature:
|
|
4770
|
+
signature: z13.string().nullish(),
|
|
4751
4771
|
/**
|
|
4752
4772
|
* Set by the SDK on output assistant messages. The converter uses it to
|
|
4753
4773
|
* decide which messages to drop when compacting under
|
|
4754
4774
|
* `previousInteractionId`.
|
|
4755
4775
|
*/
|
|
4756
|
-
interactionId:
|
|
4776
|
+
interactionId: z13.string().nullish(),
|
|
4757
4777
|
/**
|
|
4758
4778
|
* Maximum time, in milliseconds, to poll a background interaction (agent
|
|
4759
4779
|
* call) before giving up. Defaults to 30 minutes. Long-running agents
|
|
4760
4780
|
* such as deep research can take tens of minutes — increase if needed.
|
|
4761
4781
|
*/
|
|
4762
|
-
pollingTimeoutMs:
|
|
4782
|
+
pollingTimeoutMs: z13.number().int().positive().nullish(),
|
|
4763
4783
|
/**
|
|
4764
4784
|
* Run the interaction in the background. Required for agents whose
|
|
4765
4785
|
* server-side workflow cannot complete within a single request/response.
|
|
@@ -4768,7 +4788,7 @@ var googleInteractionsLanguageModelOptions = lazySchema10(
|
|
|
4768
4788
|
* reject `true`; see the agent's documentation for which mode it
|
|
4769
4789
|
* requires.
|
|
4770
4790
|
*/
|
|
4771
|
-
background:
|
|
4791
|
+
background: z13.boolean().nullish(),
|
|
4772
4792
|
/**
|
|
4773
4793
|
* Environment configuration for the agent sandbox. Only applies to agent
|
|
4774
4794
|
* calls (`google.interactions({ agent })`); ignored on model-id calls.
|
|
@@ -4778,36 +4798,36 @@ var googleInteractionsLanguageModelOptions = lazySchema10(
|
|
|
4778
4798
|
* - object: provision a fresh sandbox and optionally preload `sources`
|
|
4779
4799
|
* and/or constrain outbound traffic via `network`.
|
|
4780
4800
|
*/
|
|
4781
|
-
environment:
|
|
4782
|
-
|
|
4783
|
-
|
|
4784
|
-
type:
|
|
4785
|
-
sources:
|
|
4786
|
-
|
|
4787
|
-
|
|
4788
|
-
type:
|
|
4789
|
-
source:
|
|
4790
|
-
target:
|
|
4801
|
+
environment: z13.union([
|
|
4802
|
+
z13.string(),
|
|
4803
|
+
z13.object({
|
|
4804
|
+
type: z13.literal("remote"),
|
|
4805
|
+
sources: z13.array(
|
|
4806
|
+
z13.union([
|
|
4807
|
+
z13.object({
|
|
4808
|
+
type: z13.literal("gcs"),
|
|
4809
|
+
source: z13.string(),
|
|
4810
|
+
target: z13.string().nullish()
|
|
4791
4811
|
}),
|
|
4792
|
-
|
|
4793
|
-
type:
|
|
4794
|
-
source:
|
|
4795
|
-
target:
|
|
4812
|
+
z13.object({
|
|
4813
|
+
type: z13.literal("repository"),
|
|
4814
|
+
source: z13.string(),
|
|
4815
|
+
target: z13.string().nullish()
|
|
4796
4816
|
}),
|
|
4797
|
-
|
|
4798
|
-
type:
|
|
4799
|
-
content:
|
|
4800
|
-
target:
|
|
4817
|
+
z13.object({
|
|
4818
|
+
type: z13.literal("inline"),
|
|
4819
|
+
content: z13.string(),
|
|
4820
|
+
target: z13.string()
|
|
4801
4821
|
})
|
|
4802
4822
|
])
|
|
4803
4823
|
).nullish(),
|
|
4804
|
-
network:
|
|
4805
|
-
|
|
4806
|
-
|
|
4807
|
-
allowlist:
|
|
4808
|
-
|
|
4809
|
-
domain:
|
|
4810
|
-
transform:
|
|
4824
|
+
network: z13.union([
|
|
4825
|
+
z13.literal("disabled"),
|
|
4826
|
+
z13.object({
|
|
4827
|
+
allowlist: z13.array(
|
|
4828
|
+
z13.object({
|
|
4829
|
+
domain: z13.string(),
|
|
4830
|
+
transform: z13.array(z13.record(z13.string(), z13.string())).nullish()
|
|
4811
4831
|
})
|
|
4812
4832
|
)
|
|
4813
4833
|
})
|