@ai-sdk/google 3.0.139 → 3.0.141

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.
@@ -29,8 +29,9 @@ __export(index_exports, {
29
29
  module.exports = __toCommonJS(index_exports);
30
30
 
31
31
  // src/google-generative-ai-language-model.ts
32
+ var import_provider4 = require("@ai-sdk/provider");
32
33
  var import_provider_utils5 = require("@ai-sdk/provider-utils");
33
- var import_v43 = require("zod/v4");
34
+ var import_v44 = require("zod/v4");
34
35
 
35
36
  // src/continue-google-stream.ts
36
37
  function continueGoogleStream({
@@ -453,6 +454,19 @@ function isEmptyObjectSchema(jsonSchema) {
453
454
  // src/convert-to-google-generative-ai-messages.ts
454
455
  var import_provider2 = require("@ai-sdk/provider");
455
456
  var import_provider_utils = require("@ai-sdk/provider-utils");
457
+
458
+ // src/google-generative-ai-prompt.ts
459
+ var import_v4 = require("zod/v4");
460
+ var googleVideoMetadataSchema = import_v4.z.object({
461
+ /** Start offset as a duration in seconds, e.g. `'3.5s'`. */
462
+ startOffset: import_v4.z.string().optional(),
463
+ /** End offset as a duration in seconds, e.g. `'10s'`. */
464
+ endOffset: import_v4.z.string().optional(),
465
+ /** Frames per second in the range (0, 24]. Defaults to 1. */
466
+ fps: import_v4.z.number().gt(0).max(24).optional()
467
+ });
468
+
469
+ // src/convert-to-google-generative-ai-messages.ts
456
470
  var SKIP_THOUGHT_SIGNATURE_VALIDATOR = "skip_thought_signature_validator";
457
471
  function getGoogleProviderOptions(providerOptions, providerOptionsName) {
458
472
  const namespaces = [
@@ -502,6 +516,31 @@ function convertUrlToolResultPart(url, mediaType, supportedFunctionResponseUrls)
502
516
  }
503
517
  } : void 0;
504
518
  }
519
+ function serializeFunctionResponseContent(value) {
520
+ return containsNonJsonValue(value) ? (0, import_provider_utils.secureJsonParse)((0, import_provider_utils.stringifyWithBigIntAndCycles)(value)) : value;
521
+ }
522
+ function containsNonJsonValue(value, ancestors = /* @__PURE__ */ new Set()) {
523
+ if (typeof value === "bigint") {
524
+ return true;
525
+ }
526
+ if (typeof value !== "object" || value === null) {
527
+ return false;
528
+ }
529
+ if (typeof value.toJSON === "function") {
530
+ return true;
531
+ }
532
+ if (ancestors.has(value)) {
533
+ return true;
534
+ }
535
+ ancestors.add(value);
536
+ try {
537
+ return Object.values(value).some(
538
+ (item) => containsNonJsonValue(item, ancestors)
539
+ );
540
+ } finally {
541
+ ancestors.delete(value);
542
+ }
543
+ }
505
544
  function appendToolResultParts(parts, toolName, outputValue, toolCallId, includeFunctionCallIds = true, supportedFunctionResponseUrls = {}) {
506
545
  const functionResponseParts = [];
507
546
  const responseTextParts = [];
@@ -531,12 +570,12 @@ function appendToolResultParts(parts, toolName, outputValue, toolCallId, include
531
570
  if (functionResponsePart != null) {
532
571
  functionResponseParts.push(functionResponsePart);
533
572
  } else {
534
- responseTextParts.push(JSON.stringify(contentPart));
573
+ responseTextParts.push((0, import_provider_utils.stringifyWithBigIntAndCycles)(contentPart));
535
574
  }
536
575
  break;
537
576
  }
538
577
  default: {
539
- responseTextParts.push(JSON.stringify(contentPart));
578
+ responseTextParts.push((0, import_provider_utils.stringifyWithBigIntAndCycles)(contentPart));
540
579
  break;
541
580
  }
542
581
  }
@@ -585,13 +624,13 @@ function appendLegacyToolResultParts(parts, toolName, outputValue, toolCallId, i
585
624
  break;
586
625
  }
587
626
  default:
588
- parts.push({ text: JSON.stringify(contentPart) });
627
+ parts.push({ text: (0, import_provider_utils.stringifyWithBigIntAndCycles)(contentPart) });
589
628
  break;
590
629
  }
591
630
  }
592
631
  }
593
632
  function convertToGoogleGenerativeAIMessages(prompt, options) {
594
- var _a, _b, _c, _d, _e, _f, _g;
633
+ var _a, _b, _c, _d, _e, _f, _g, _h;
595
634
  const systemInstructionParts = [];
596
635
  const contents = [];
597
636
  let systemMessagesAllowed = true;
@@ -631,17 +670,24 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
631
670
  }
632
671
  case "file": {
633
672
  const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType;
673
+ const rawVideoMetadata = (_g = getGoogleProviderOptions(
674
+ part.providerOptions,
675
+ providerOptionsName
676
+ )) == null ? void 0 : _g.videoMetadata;
677
+ const videoMetadata = rawVideoMetadata == null ? void 0 : googleVideoMetadataSchema.parse(rawVideoMetadata);
634
678
  parts.push(
635
679
  part.data instanceof URL ? {
636
680
  fileData: {
637
681
  mimeType: mediaType,
638
682
  fileUri: part.data.protocol === "gs:" && part.originalUrl != null ? part.originalUrl : part.data.toString()
639
- }
683
+ },
684
+ ...videoMetadata != null ? { videoMetadata } : {}
640
685
  } : {
641
686
  inlineData: {
642
687
  mimeType: mediaType,
643
688
  data: (0, import_provider_utils.convertToBase64)(part.data)
644
- }
689
+ },
690
+ ...videoMetadata != null ? { videoMetadata } : {}
645
691
  }
646
692
  );
647
693
  break;
@@ -720,7 +766,7 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
720
766
  functionCall: {
721
767
  ...includeFunctionCallIds && part.toolCallId != null ? { id: part.toolCallId } : {},
722
768
  name: part.toolName,
723
- args: part.input
769
+ args: parseToolCallInput(part.input)
724
770
  },
725
771
  thoughtSignature: effectiveThoughtSignature
726
772
  };
@@ -802,7 +848,7 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
802
848
  name: part.toolName,
803
849
  response: {
804
850
  name: part.toolName,
805
- content: output.type === "execution-denied" ? (_g = output.reason) != null ? _g : "Tool call execution denied." : output.value
851
+ content: output.type === "execution-denied" ? (_h = output.reason) != null ? _h : "Tool call execution denied." : serializeFunctionResponseContent(output.value)
806
852
  }
807
853
  }
808
854
  });
@@ -832,6 +878,16 @@ function convertToGoogleGenerativeAIMessages(prompt, options) {
832
878
  contents
833
879
  };
834
880
  }
881
+ function parseToolCallInput(input) {
882
+ if (typeof input !== "string") {
883
+ return input;
884
+ }
885
+ try {
886
+ return (0, import_provider_utils.secureJsonParse)(input);
887
+ } catch (e) {
888
+ return input;
889
+ }
890
+ }
835
891
 
836
892
  // src/download-tool-result-files.ts
837
893
  var import_provider_utils2 = require("@ai-sdk/provider-utils");
@@ -906,16 +962,17 @@ function getModelPath(modelId) {
906
962
 
907
963
  // src/google-error.ts
908
964
  var import_provider_utils3 = require("@ai-sdk/provider-utils");
909
- var import_v4 = require("zod/v4");
965
+ var import_v42 = require("zod/v4");
966
+ var getGoogleErrorSchema = () => import_v42.z.object({
967
+ code: import_v42.z.number().nullable(),
968
+ message: import_v42.z.string(),
969
+ status: import_v42.z.string(),
970
+ details: import_v42.z.array(import_v42.z.unknown()).nullish()
971
+ });
910
972
  var googleErrorDataSchema = (0, import_provider_utils3.lazySchema)(
911
973
  () => (0, import_provider_utils3.zodSchema)(
912
- import_v4.z.object({
913
- error: import_v4.z.object({
914
- code: import_v4.z.number().nullable(),
915
- message: import_v4.z.string(),
916
- status: import_v4.z.string(),
917
- details: import_v4.z.array(import_v4.z.unknown()).nullish()
918
- })
974
+ import_v42.z.object({
975
+ error: getGoogleErrorSchema()
919
976
  })
920
977
  )
921
978
  );
@@ -923,26 +980,59 @@ var googleFailedResponseHandler = (0, import_provider_utils3.createJsonErrorResp
923
980
  errorSchema: googleErrorDataSchema,
924
981
  errorToMessage: (data) => data.error.message
925
982
  });
983
+ function mapGoogleErrorStatusToHttpStatusCode(status) {
984
+ switch (status) {
985
+ case "CANCELLED":
986
+ return 499;
987
+ case "INVALID_ARGUMENT":
988
+ case "FAILED_PRECONDITION":
989
+ case "OUT_OF_RANGE":
990
+ return 400;
991
+ case "DEADLINE_EXCEEDED":
992
+ return 504;
993
+ case "NOT_FOUND":
994
+ return 404;
995
+ case "ALREADY_EXISTS":
996
+ case "ABORTED":
997
+ return 409;
998
+ case "PERMISSION_DENIED":
999
+ return 403;
1000
+ case "UNAUTHENTICATED":
1001
+ return 401;
1002
+ case "RESOURCE_EXHAUSTED":
1003
+ return 429;
1004
+ case "UNIMPLEMENTED":
1005
+ return 501;
1006
+ case "UNKNOWN":
1007
+ case "INTERNAL":
1008
+ case "DATA_LOSS":
1009
+ return 500;
1010
+ case "UNAVAILABLE":
1011
+ return 503;
1012
+ default:
1013
+ return void 0;
1014
+ }
1015
+ }
926
1016
 
927
1017
  // src/google-generative-ai-options.ts
928
1018
  var import_provider_utils4 = require("@ai-sdk/provider-utils");
929
- var import_v42 = require("zod/v4");
1019
+ var import_v43 = require("zod/v4");
930
1020
  var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
931
1021
  () => (0, import_provider_utils4.zodSchema)(
932
- import_v42.z.object({
933
- responseModalities: import_v42.z.array(import_v42.z.enum(["TEXT", "IMAGE"])).optional(),
934
- thinkingConfig: import_v42.z.object({
935
- thinkingBudget: import_v42.z.number().optional(),
936
- includeThoughts: import_v42.z.boolean().optional(),
1022
+ import_v43.z.object({
1023
+ responseModalities: import_v43.z.array(import_v43.z.enum(["TEXT", "IMAGE"])).optional(),
1024
+ thinkingConfig: import_v43.z.object({
1025
+ thinkingBudget: import_v43.z.number().optional(),
1026
+ includeThoughts: import_v43.z.boolean().optional(),
937
1027
  // https://ai.google.dev/gemini-api/docs/gemini-3?thinking=high#thinking_level
938
- thinkingLevel: import_v42.z.enum(["minimal", "low", "medium", "high"]).optional()
1028
+ thinkingLevel: import_v43.z.enum(["minimal", "low", "medium", "high"]).optional()
939
1029
  }).optional(),
940
1030
  /**
941
1031
  * Optional.
942
1032
  * The name of the cached content used as context to serve the prediction.
943
1033
  * Format: cachedContents/{cachedContent}
944
1034
  */
945
- cachedContent: import_v42.z.string().optional(),
1035
+ cachedContent: import_v43.z.string().optional(),
946
1036
  /**
947
1037
  * Optional. Enable structured output. Default is true.
948
1038
  *
@@ -951,13 +1041,13 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
951
1041
  * Google Generative AI uses. You can use this to disable
952
1042
  * structured outputs if you need to.
953
1043
  */
954
- structuredOutputs: import_v42.z.boolean().optional(),
1044
+ structuredOutputs: import_v43.z.boolean().optional(),
955
1045
  /**
956
1046
  * Optional. A list of unique safety settings for blocking unsafe content.
957
1047
  */
958
- safetySettings: import_v42.z.array(
959
- import_v42.z.object({
960
- category: import_v42.z.enum([
1048
+ safetySettings: import_v43.z.array(
1049
+ import_v43.z.object({
1050
+ category: import_v43.z.enum([
961
1051
  "HARM_CATEGORY_UNSPECIFIED",
962
1052
  "HARM_CATEGORY_HATE_SPEECH",
963
1053
  "HARM_CATEGORY_DANGEROUS_CONTENT",
@@ -965,7 +1055,7 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
965
1055
  "HARM_CATEGORY_SEXUALLY_EXPLICIT",
966
1056
  "HARM_CATEGORY_CIVIC_INTEGRITY"
967
1057
  ]),
968
- threshold: import_v42.z.enum([
1058
+ threshold: import_v43.z.enum([
969
1059
  "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
970
1060
  "BLOCK_LOW_AND_ABOVE",
971
1061
  "BLOCK_MEDIUM_AND_ABOVE",
@@ -975,7 +1065,7 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
975
1065
  ])
976
1066
  })
977
1067
  ).optional(),
978
- threshold: import_v42.z.enum([
1068
+ threshold: import_v43.z.enum([
979
1069
  "HARM_BLOCK_THRESHOLD_UNSPECIFIED",
980
1070
  "BLOCK_LOW_AND_ABOVE",
981
1071
  "BLOCK_MEDIUM_AND_ABOVE",
@@ -988,19 +1078,19 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
988
1078
  *
989
1079
  * https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/audio-understanding
990
1080
  */
991
- audioTimestamp: import_v42.z.boolean().optional(),
1081
+ audioTimestamp: import_v43.z.boolean().optional(),
992
1082
  /**
993
1083
  * Optional. Defines labels used in billing reports. Available on Vertex AI only.
994
1084
  *
995
1085
  * https://cloud.google.com/vertex-ai/generative-ai/docs/multimodal/add-labels-to-api-calls
996
1086
  */
997
- labels: import_v42.z.record(import_v42.z.string(), import_v42.z.string()).optional(),
1087
+ labels: import_v43.z.record(import_v43.z.string(), import_v43.z.string()).optional(),
998
1088
  /**
999
1089
  * Optional. If specified, the media resolution specified will be used.
1000
1090
  *
1001
1091
  * https://ai.google.dev/api/generate-content#MediaResolution
1002
1092
  */
1003
- mediaResolution: import_v42.z.enum([
1093
+ mediaResolution: import_v43.z.enum([
1004
1094
  "MEDIA_RESOLUTION_UNSPECIFIED",
1005
1095
  "MEDIA_RESOLUTION_LOW",
1006
1096
  "MEDIA_RESOLUTION_MEDIUM",
@@ -1011,8 +1101,8 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
1011
1101
  *
1012
1102
  * https://ai.google.dev/gemini-api/docs/image-generation#aspect_ratios
1013
1103
  */
1014
- imageConfig: import_v42.z.object({
1015
- aspectRatio: import_v42.z.enum([
1104
+ imageConfig: import_v43.z.object({
1105
+ aspectRatio: import_v43.z.enum([
1016
1106
  "1:1",
1017
1107
  "2:3",
1018
1108
  "3:2",
@@ -1028,12 +1118,12 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
1028
1118
  "1:4",
1029
1119
  "4:1"
1030
1120
  ]).optional(),
1031
- imageSize: import_v42.z.enum(["1K", "2K", "4K", "512"]).optional(),
1121
+ imageSize: import_v43.z.enum(["1K", "2K", "4K", "512"]).optional(),
1032
1122
  /**
1033
1123
  * Optional. Controls the generation of people in images.
1034
1124
  * Vertex AI only.
1035
1125
  */
1036
- personGeneration: import_v42.z.enum([
1126
+ personGeneration: import_v43.z.enum([
1037
1127
  "PERSON_GENERATION_UNSPECIFIED",
1038
1128
  "ALLOW_ALL",
1039
1129
  "ALLOW_ADULT",
@@ -1047,7 +1137,7 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
1047
1137
  *
1048
1138
  * https://docs.cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerationConfig
1049
1139
  */
1050
- prominentPeople: import_v42.z.enum([
1140
+ prominentPeople: import_v43.z.enum([
1051
1141
  "PROMINENT_PEOPLE_UNSPECIFIED",
1052
1142
  "ALLOW_PROMINENT_PEOPLE",
1053
1143
  "BLOCK_PROMINENT_PEOPLE"
@@ -1056,9 +1146,9 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
1056
1146
  * Optional. The image output format for generated images.
1057
1147
  * Vertex AI only.
1058
1148
  */
1059
- imageOutputOptions: import_v42.z.object({
1060
- mimeType: import_v42.z.enum(["image/jpeg", "image/png"]).optional(),
1061
- compressionQuality: import_v42.z.number().optional()
1149
+ imageOutputOptions: import_v43.z.object({
1150
+ mimeType: import_v43.z.enum(["image/jpeg", "image/png"]).optional(),
1151
+ compressionQuality: import_v43.z.number().optional()
1062
1152
  }).optional()
1063
1153
  }).optional(),
1064
1154
  /**
@@ -1067,10 +1157,10 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
1067
1157
  *
1068
1158
  * https://cloud.google.com/vertex-ai/generative-ai/docs/grounding/grounding-with-google-maps
1069
1159
  */
1070
- retrievalConfig: import_v42.z.object({
1071
- latLng: import_v42.z.object({
1072
- latitude: import_v42.z.number(),
1073
- longitude: import_v42.z.number()
1160
+ retrievalConfig: import_v43.z.object({
1161
+ latLng: import_v43.z.object({
1162
+ latitude: import_v43.z.number(),
1163
+ longitude: import_v43.z.number()
1074
1164
  }).optional()
1075
1165
  }).optional(),
1076
1166
  /**
@@ -1083,12 +1173,12 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
1083
1173
  *
1084
1174
  * https://docs.cloud.google.com/vertex-ai/generative-ai/docs/multimodal/function-calling#streaming-fc
1085
1175
  */
1086
- streamFunctionCallArguments: import_v42.z.boolean().optional(),
1176
+ streamFunctionCallArguments: import_v43.z.boolean().optional(),
1087
1177
  /**
1088
1178
  * Optional. The service tier to use for the request. Sent as the
1089
1179
  * `serviceTier` body field. Gemini API only.
1090
1180
  */
1091
- serviceTier: import_v42.z.enum(["standard", "flex", "priority"]).optional(),
1181
+ serviceTier: import_v43.z.enum(["standard", "flex", "priority"]).optional(),
1092
1182
  /**
1093
1183
  * Optional. Resumes a response that stopped with `MAX_TOKENS` because it
1094
1184
  * used up its `maxOutputTokens` budget (Gemini 4 long decode). Pass the
@@ -1098,7 +1188,7 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
1098
1188
  * per-request cap while budget remains (`CONTINUATION`) are continued
1099
1189
  * automatically. Sent as the `continuationToken` body field.
1100
1190
  */
1101
- continuationToken: import_v42.z.string().optional(),
1191
+ continuationToken: import_v43.z.string().optional(),
1102
1192
  /**
1103
1193
  * Optional. Vertex AI only. Sent as the
1104
1194
  * `X-Vertex-AI-LLM-Shared-Request-Type` request header to select a
@@ -1109,7 +1199,7 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
1109
1199
  * https://docs.cloud.google.com/vertex-ai/generative-ai/docs/priority-paygo
1110
1200
  * https://docs.cloud.google.com/vertex-ai/generative-ai/docs/flex-paygo
1111
1201
  */
1112
- sharedRequestType: import_v42.z.enum(["priority", "flex", "standard"]).optional(),
1202
+ sharedRequestType: import_v43.z.enum(["priority", "flex", "standard"]).optional(),
1113
1203
  /**
1114
1204
  * Optional. Vertex AI only. Sent as the `X-Vertex-AI-LLM-Request-Type`
1115
1205
  * request header. Set to `'shared'` together with `sharedRequestType`
@@ -1117,7 +1207,7 @@ var googleLanguageModelOptions = (0, import_provider_utils4.lazySchema)(
1117
1207
  *
1118
1208
  * https://docs.cloud.google.com/vertex-ai/generative-ai/docs/priority-paygo
1119
1209
  */
1120
- requestType: import_v42.z.enum(["shared"]).optional()
1210
+ requestType: import_v43.z.enum(["shared"]).optional()
1121
1211
  })
1122
1212
  )
1123
1213
  );
@@ -2146,10 +2236,11 @@ var GoogleGenerativeAILanguageModel = class {
2146
2236
  options.headers,
2147
2237
  extraHeaders
2148
2238
  );
2239
+ const url = `${this.config.baseURL}/${getModelPath(
2240
+ this.modelId
2241
+ )}:streamGenerateContent?alt=sse`;
2149
2242
  const streamGenerateContent = (body) => (0, import_provider_utils5.postJsonToApi)({
2150
- url: `${this.config.baseURL}/${getModelPath(
2151
- this.modelId
2152
- )}:streamGenerateContent?alt=sse`,
2243
+ url,
2153
2244
  headers,
2154
2245
  body,
2155
2246
  failedResponseHandler: googleFailedResponseHandler,
@@ -2239,7 +2330,7 @@ var GoogleGenerativeAILanguageModel = class {
2239
2330
  controller.enqueue({ type: "stream-start", warnings });
2240
2331
  },
2241
2332
  transform(chunk, controller) {
2242
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
2333
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
2243
2334
  if (options.includeRawChunks) {
2244
2335
  controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
2245
2336
  }
@@ -2248,6 +2339,23 @@ var GoogleGenerativeAILanguageModel = class {
2248
2339
  return;
2249
2340
  }
2250
2341
  const value = chunk.value;
2342
+ if (value.error != null) {
2343
+ finishReason = { unified: "error", raw: void 0 };
2344
+ const error = value.error;
2345
+ controller.enqueue({
2346
+ type: "error",
2347
+ error: new import_provider4.APICallError({
2348
+ message: error.message,
2349
+ url,
2350
+ requestBodyValues: args,
2351
+ statusCode: (_a = error.code) != null ? _a : mapGoogleErrorStatusToHttpStatusCode(error.status),
2352
+ responseHeaders,
2353
+ responseBody: JSON.stringify({ error }),
2354
+ data: error
2355
+ })
2356
+ });
2357
+ return;
2358
+ }
2251
2359
  if (!hasEmittedResponseMetadata && value.responseId != null) {
2252
2360
  hasEmittedResponseMetadata = true;
2253
2361
  controller.enqueue({
@@ -2269,7 +2377,7 @@ var GoogleGenerativeAILanguageModel = class {
2269
2377
  };
2270
2378
  }
2271
2379
  }
2272
- const candidate = (_a = value.candidates) == null ? void 0 : _a[0];
2380
+ const candidate = (_b = value.candidates) == null ? void 0 : _b[0];
2273
2381
  if (candidate != null) {
2274
2382
  if (candidate.groundingMetadata != null) {
2275
2383
  lastGroundingMetadata = candidate.groundingMetadata;
@@ -2304,9 +2412,9 @@ var GoogleGenerativeAILanguageModel = class {
2304
2412
  }
2305
2413
  }
2306
2414
  if (content != null) {
2307
- const parts = (_b = content.parts) != null ? _b : [];
2415
+ const parts = (_c = content.parts) != null ? _c : [];
2308
2416
  for (const part of parts) {
2309
- if ("executableCode" in part && ((_c = part.executableCode) == null ? void 0 : _c.code)) {
2417
+ if ("executableCode" in part && ((_d = part.executableCode) == null ? void 0 : _d.code)) {
2310
2418
  const toolCallId = generateId2();
2311
2419
  lastCodeExecutionToolCallId = toolCallId;
2312
2420
  controller.enqueue({
@@ -2325,7 +2433,7 @@ var GoogleGenerativeAILanguageModel = class {
2325
2433
  toolName: "code_execution",
2326
2434
  result: {
2327
2435
  outcome: part.codeExecutionResult.outcome,
2328
- output: (_d = part.codeExecutionResult.output) != null ? _d : ""
2436
+ output: (_e = part.codeExecutionResult.output) != null ? _e : ""
2329
2437
  }
2330
2438
  });
2331
2439
  }
@@ -2419,7 +2527,7 @@ var GoogleGenerativeAILanguageModel = class {
2419
2527
  providerMetadata: fileMeta
2420
2528
  });
2421
2529
  } else if ("toolCall" in part && part.toolCall) {
2422
- const toolCallId = (_e = part.toolCall.id) != null ? _e : generateId2();
2530
+ const toolCallId = (_f = part.toolCall.id) != null ? _f : generateId2();
2423
2531
  lastServerToolCallId = toolCallId;
2424
2532
  const serverMeta = {
2425
2533
  [providerOptionsName]: {
@@ -2432,13 +2540,13 @@ var GoogleGenerativeAILanguageModel = class {
2432
2540
  type: "tool-call",
2433
2541
  toolCallId,
2434
2542
  toolName: `server:${part.toolCall.toolType}`,
2435
- input: JSON.stringify((_f = part.toolCall.args) != null ? _f : {}),
2543
+ input: JSON.stringify((_g = part.toolCall.args) != null ? _g : {}),
2436
2544
  providerExecuted: true,
2437
2545
  dynamic: true,
2438
2546
  providerMetadata: serverMeta
2439
2547
  });
2440
2548
  } else if ("toolResponse" in part && part.toolResponse) {
2441
- const responseToolCallId = (_g = lastServerToolCallId != null ? lastServerToolCallId : part.toolResponse.id) != null ? _g : generateId2();
2549
+ const responseToolCallId = (_h = lastServerToolCallId != null ? lastServerToolCallId : part.toolResponse.id) != null ? _h : generateId2();
2442
2550
  const serverMeta = {
2443
2551
  [providerOptionsName]: {
2444
2552
  ...part.thoughtSignature ? { thoughtSignature: part.thoughtSignature } : {},
@@ -2450,7 +2558,7 @@ var GoogleGenerativeAILanguageModel = class {
2450
2558
  type: "tool-result",
2451
2559
  toolCallId: responseToolCallId,
2452
2560
  toolName: `server:${part.toolResponse.toolType}`,
2453
- result: (_h = part.toolResponse.response) != null ? _h : {},
2561
+ result: (_i = part.toolResponse.response) != null ? _i : {},
2454
2562
  providerMetadata: serverMeta
2455
2563
  });
2456
2564
  lastServerToolCallId = void 0;
@@ -2469,7 +2577,7 @@ var GoogleGenerativeAILanguageModel = class {
2469
2577
  const isNoArgsCompleteCall = part.functionCall.name != null && part.functionCall.args == null && part.functionCall.partialArgs == null && part.functionCall.willContinue !== true;
2470
2578
  if (isStreamingChunk) {
2471
2579
  if (part.functionCall.name != null) {
2472
- const toolCallId = (_i = part.functionCall.id) != null ? _i : generateId2();
2580
+ const toolCallId = (_j = part.functionCall.id) != null ? _j : generateId2();
2473
2581
  const accumulator = new GoogleJSONAccumulator();
2474
2582
  activeStreamingToolCalls.push({
2475
2583
  toolCallId,
@@ -2517,9 +2625,9 @@ var GoogleGenerativeAILanguageModel = class {
2517
2625
  } else if (isTerminalChunk && activeStreamingToolCalls.length > 0) {
2518
2626
  finishActiveStreamingToolCall(controller);
2519
2627
  } else if (isCompleteCall) {
2520
- const toolCallId = (_j = part.functionCall.id) != null ? _j : generateId2();
2628
+ const toolCallId = (_k = part.functionCall.id) != null ? _k : generateId2();
2521
2629
  const toolName = part.functionCall.name;
2522
- const args2 = typeof part.functionCall.args === "string" ? part.functionCall.args : JSON.stringify((_k = part.functionCall.args) != null ? _k : {});
2630
+ const args2 = typeof part.functionCall.args === "string" ? part.functionCall.args : JSON.stringify((_l = part.functionCall.args) != null ? _l : {});
2523
2631
  controller.enqueue({
2524
2632
  type: "tool-input-start",
2525
2633
  id: toolCallId,
@@ -2546,7 +2654,7 @@ var GoogleGenerativeAILanguageModel = class {
2546
2654
  });
2547
2655
  hasToolCalls = true;
2548
2656
  } else if (isNoArgsCompleteCall) {
2549
- const toolCallId = (_l = part.functionCall.id) != null ? _l : generateId2();
2657
+ const toolCallId = (_m = part.functionCall.id) != null ? _m : generateId2();
2550
2658
  const toolName = part.functionCall.name;
2551
2659
  controller.enqueue({
2552
2660
  type: "tool-input-start",
@@ -2734,205 +2842,206 @@ function extractSources({
2734
2842
  }
2735
2843
  return sources.length > 0 ? sources : void 0;
2736
2844
  }
2737
- var getGroundingMetadataSchema = () => import_v43.z.object({
2738
- webSearchQueries: import_v43.z.array(import_v43.z.string()).nullish(),
2739
- imageSearchQueries: import_v43.z.array(import_v43.z.string()).nullish(),
2740
- retrievalQueries: import_v43.z.array(import_v43.z.string()).nullish(),
2741
- searchEntryPoint: import_v43.z.object({ renderedContent: import_v43.z.string() }).nullish(),
2742
- groundingChunks: import_v43.z.array(
2743
- import_v43.z.object({
2744
- web: import_v43.z.object({ uri: import_v43.z.string(), title: import_v43.z.string().nullish() }).nullish(),
2745
- image: import_v43.z.object({
2746
- sourceUri: import_v43.z.string(),
2747
- imageUri: import_v43.z.string(),
2748
- title: import_v43.z.string().nullish(),
2749
- domain: import_v43.z.string().nullish()
2845
+ var getGroundingMetadataSchema = () => import_v44.z.object({
2846
+ webSearchQueries: import_v44.z.array(import_v44.z.string()).nullish(),
2847
+ imageSearchQueries: import_v44.z.array(import_v44.z.string()).nullish(),
2848
+ retrievalQueries: import_v44.z.array(import_v44.z.string()).nullish(),
2849
+ searchEntryPoint: import_v44.z.object({ renderedContent: import_v44.z.string() }).nullish(),
2850
+ groundingChunks: import_v44.z.array(
2851
+ import_v44.z.object({
2852
+ web: import_v44.z.object({ uri: import_v44.z.string(), title: import_v44.z.string().nullish() }).nullish(),
2853
+ image: import_v44.z.object({
2854
+ sourceUri: import_v44.z.string(),
2855
+ imageUri: import_v44.z.string(),
2856
+ title: import_v44.z.string().nullish(),
2857
+ domain: import_v44.z.string().nullish()
2750
2858
  }).nullish(),
2751
- retrievedContext: import_v43.z.object({
2752
- uri: import_v43.z.string().nullish(),
2753
- title: import_v43.z.string().nullish(),
2754
- text: import_v43.z.string().nullish(),
2755
- fileSearchStore: import_v43.z.string().nullish(),
2756
- customMetadata: import_v43.z.array(
2757
- import_v43.z.object({
2758
- key: import_v43.z.string(),
2759
- stringValue: import_v43.z.string().nullish(),
2760
- numericValue: import_v43.z.number().nullish(),
2761
- stringListValue: import_v43.z.object({ values: import_v43.z.array(import_v43.z.string()).nullish() }).nullish()
2859
+ retrievedContext: import_v44.z.object({
2860
+ uri: import_v44.z.string().nullish(),
2861
+ title: import_v44.z.string().nullish(),
2862
+ text: import_v44.z.string().nullish(),
2863
+ fileSearchStore: import_v44.z.string().nullish(),
2864
+ customMetadata: import_v44.z.array(
2865
+ import_v44.z.object({
2866
+ key: import_v44.z.string(),
2867
+ stringValue: import_v44.z.string().nullish(),
2868
+ numericValue: import_v44.z.number().nullish(),
2869
+ stringListValue: import_v44.z.object({ values: import_v44.z.array(import_v44.z.string()).nullish() }).nullish()
2762
2870
  })
2763
2871
  ).nullish()
2764
2872
  }).nullish(),
2765
- maps: import_v43.z.object({
2766
- uri: import_v43.z.string().nullish(),
2767
- title: import_v43.z.string().nullish(),
2768
- text: import_v43.z.string().nullish(),
2769
- placeId: import_v43.z.string().nullish()
2873
+ maps: import_v44.z.object({
2874
+ uri: import_v44.z.string().nullish(),
2875
+ title: import_v44.z.string().nullish(),
2876
+ text: import_v44.z.string().nullish(),
2877
+ placeId: import_v44.z.string().nullish()
2770
2878
  }).nullish()
2771
2879
  })
2772
2880
  ).nullish(),
2773
- groundingSupports: import_v43.z.array(
2774
- import_v43.z.object({
2775
- segment: import_v43.z.object({
2776
- startIndex: import_v43.z.number().nullish(),
2777
- endIndex: import_v43.z.number().nullish(),
2778
- text: import_v43.z.string().nullish()
2881
+ groundingSupports: import_v44.z.array(
2882
+ import_v44.z.object({
2883
+ segment: import_v44.z.object({
2884
+ startIndex: import_v44.z.number().nullish(),
2885
+ endIndex: import_v44.z.number().nullish(),
2886
+ text: import_v44.z.string().nullish()
2779
2887
  }).nullish(),
2780
- segment_text: import_v43.z.string().nullish(),
2781
- groundingChunkIndices: import_v43.z.array(import_v43.z.number()).nullish(),
2782
- supportChunkIndices: import_v43.z.array(import_v43.z.number()).nullish(),
2783
- confidenceScores: import_v43.z.array(import_v43.z.number()).nullish(),
2784
- confidenceScore: import_v43.z.array(import_v43.z.number()).nullish()
2888
+ segment_text: import_v44.z.string().nullish(),
2889
+ groundingChunkIndices: import_v44.z.array(import_v44.z.number()).nullish(),
2890
+ supportChunkIndices: import_v44.z.array(import_v44.z.number()).nullish(),
2891
+ confidenceScores: import_v44.z.array(import_v44.z.number()).nullish(),
2892
+ confidenceScore: import_v44.z.array(import_v44.z.number()).nullish()
2785
2893
  })
2786
2894
  ).nullish(),
2787
- retrievalMetadata: import_v43.z.union([
2788
- import_v43.z.object({
2789
- webDynamicRetrievalScore: import_v43.z.number()
2895
+ retrievalMetadata: import_v44.z.union([
2896
+ import_v44.z.object({
2897
+ webDynamicRetrievalScore: import_v44.z.number()
2790
2898
  }),
2791
- import_v43.z.object({})
2899
+ import_v44.z.object({})
2792
2900
  ]).nullish()
2793
2901
  });
2794
- var partialArgSchema = () => import_v43.z.object({
2795
- jsonPath: import_v43.z.string(),
2796
- stringValue: import_v43.z.string().nullish(),
2797
- numberValue: import_v43.z.number().nullish(),
2798
- boolValue: import_v43.z.boolean().nullish(),
2799
- nullValue: import_v43.z.unknown().nullish(),
2800
- willContinue: import_v43.z.boolean().nullish()
2902
+ var partialArgSchema = () => import_v44.z.object({
2903
+ jsonPath: import_v44.z.string(),
2904
+ stringValue: import_v44.z.string().nullish(),
2905
+ numberValue: import_v44.z.number().nullish(),
2906
+ boolValue: import_v44.z.boolean().nullish(),
2907
+ nullValue: import_v44.z.unknown().nullish(),
2908
+ willContinue: import_v44.z.boolean().nullish()
2801
2909
  });
2802
- var getContentSchema = () => import_v43.z.object({
2803
- parts: import_v43.z.array(
2804
- import_v43.z.union([
2910
+ var getContentSchema = () => import_v44.z.object({
2911
+ parts: import_v44.z.array(
2912
+ import_v44.z.union([
2805
2913
  // note: order matters since text can be fully empty
2806
- import_v43.z.object({
2807
- functionCall: import_v43.z.object({
2808
- id: import_v43.z.string().nullish(),
2809
- name: import_v43.z.string().nullish(),
2810
- args: import_v43.z.unknown().nullish(),
2811
- partialArgs: import_v43.z.array(partialArgSchema()).nullish(),
2812
- willContinue: import_v43.z.boolean().nullish()
2914
+ import_v44.z.object({
2915
+ functionCall: import_v44.z.object({
2916
+ id: import_v44.z.string().nullish(),
2917
+ name: import_v44.z.string().nullish(),
2918
+ args: import_v44.z.unknown().nullish(),
2919
+ partialArgs: import_v44.z.array(partialArgSchema()).nullish(),
2920
+ willContinue: import_v44.z.boolean().nullish()
2813
2921
  }),
2814
- thoughtSignature: import_v43.z.string().nullish()
2922
+ thoughtSignature: import_v44.z.string().nullish()
2815
2923
  }),
2816
- import_v43.z.object({
2817
- inlineData: import_v43.z.object({
2818
- mimeType: import_v43.z.string(),
2819
- data: import_v43.z.string()
2924
+ import_v44.z.object({
2925
+ inlineData: import_v44.z.object({
2926
+ mimeType: import_v44.z.string(),
2927
+ data: import_v44.z.string()
2820
2928
  }),
2821
- thought: import_v43.z.boolean().nullish(),
2822
- thoughtSignature: import_v43.z.string().nullish()
2929
+ thought: import_v44.z.boolean().nullish(),
2930
+ thoughtSignature: import_v44.z.string().nullish()
2823
2931
  }),
2824
- import_v43.z.object({
2825
- toolCall: import_v43.z.object({
2826
- toolType: import_v43.z.string(),
2827
- args: import_v43.z.unknown().nullish(),
2828
- id: import_v43.z.string()
2932
+ import_v44.z.object({
2933
+ toolCall: import_v44.z.object({
2934
+ toolType: import_v44.z.string(),
2935
+ args: import_v44.z.unknown().nullish(),
2936
+ id: import_v44.z.string()
2829
2937
  }),
2830
- thoughtSignature: import_v43.z.string().nullish()
2938
+ thoughtSignature: import_v44.z.string().nullish()
2831
2939
  }),
2832
- import_v43.z.object({
2833
- toolResponse: import_v43.z.object({
2834
- toolType: import_v43.z.string(),
2835
- response: import_v43.z.unknown().nullish(),
2836
- id: import_v43.z.string()
2940
+ import_v44.z.object({
2941
+ toolResponse: import_v44.z.object({
2942
+ toolType: import_v44.z.string(),
2943
+ response: import_v44.z.unknown().nullish(),
2944
+ id: import_v44.z.string()
2837
2945
  }),
2838
- thoughtSignature: import_v43.z.string().nullish()
2946
+ thoughtSignature: import_v44.z.string().nullish()
2839
2947
  }),
2840
- import_v43.z.object({
2841
- executableCode: import_v43.z.object({
2842
- language: import_v43.z.string(),
2843
- code: import_v43.z.string()
2948
+ import_v44.z.object({
2949
+ executableCode: import_v44.z.object({
2950
+ language: import_v44.z.string(),
2951
+ code: import_v44.z.string()
2844
2952
  }).nullish(),
2845
- codeExecutionResult: import_v43.z.object({
2846
- outcome: import_v43.z.string(),
2847
- output: import_v43.z.string().nullish()
2953
+ codeExecutionResult: import_v44.z.object({
2954
+ outcome: import_v44.z.string(),
2955
+ output: import_v44.z.string().nullish()
2848
2956
  }).nullish(),
2849
- text: import_v43.z.string().nullish(),
2850
- thought: import_v43.z.boolean().nullish(),
2851
- thoughtSignature: import_v43.z.string().nullish()
2957
+ text: import_v44.z.string().nullish(),
2958
+ thought: import_v44.z.boolean().nullish(),
2959
+ thoughtSignature: import_v44.z.string().nullish()
2852
2960
  })
2853
2961
  ])
2854
2962
  ).nullish()
2855
2963
  });
2856
- var getSafetyRatingSchema = () => import_v43.z.object({
2857
- category: import_v43.z.string().nullish(),
2858
- probability: import_v43.z.string().nullish(),
2859
- probabilityScore: import_v43.z.number().nullish(),
2860
- severity: import_v43.z.string().nullish(),
2861
- severityScore: import_v43.z.number().nullish(),
2862
- blocked: import_v43.z.boolean().nullish()
2964
+ var getSafetyRatingSchema = () => import_v44.z.object({
2965
+ category: import_v44.z.string().nullish(),
2966
+ probability: import_v44.z.string().nullish(),
2967
+ probabilityScore: import_v44.z.number().nullish(),
2968
+ severity: import_v44.z.string().nullish(),
2969
+ severityScore: import_v44.z.number().nullish(),
2970
+ blocked: import_v44.z.boolean().nullish()
2863
2971
  });
2864
- var tokenDetailsSchema = () => import_v43.z.array(
2865
- import_v43.z.object({
2866
- modality: import_v43.z.string(),
2867
- tokenCount: import_v43.z.number()
2868
- }).catchall(import_v43.z.json())
2972
+ var tokenDetailsSchema = () => import_v44.z.array(
2973
+ import_v44.z.object({
2974
+ modality: import_v44.z.string(),
2975
+ tokenCount: import_v44.z.number()
2976
+ }).catchall(import_v44.z.json())
2869
2977
  ).nullish();
2870
- var usageSchema = () => import_v43.z.object({
2871
- cachedContentTokenCount: import_v43.z.number().nullish(),
2872
- thoughtsTokenCount: import_v43.z.number().nullish(),
2873
- promptTokenCount: import_v43.z.number().nullish(),
2874
- candidatesTokenCount: import_v43.z.number().nullish(),
2875
- toolUsePromptTokenCount: import_v43.z.number().nullish(),
2876
- totalTokenCount: import_v43.z.number().nullish(),
2978
+ var usageSchema = () => import_v44.z.object({
2979
+ cachedContentTokenCount: import_v44.z.number().nullish(),
2980
+ thoughtsTokenCount: import_v44.z.number().nullish(),
2981
+ promptTokenCount: import_v44.z.number().nullish(),
2982
+ candidatesTokenCount: import_v44.z.number().nullish(),
2983
+ toolUsePromptTokenCount: import_v44.z.number().nullish(),
2984
+ totalTokenCount: import_v44.z.number().nullish(),
2877
2985
  // https://cloud.google.com/vertex-ai/generative-ai/docs/reference/rest/v1/GenerateContentResponse#TrafficType
2878
- trafficType: import_v43.z.string().nullish(),
2879
- serviceTier: import_v43.z.string().nullish(),
2986
+ trafficType: import_v44.z.string().nullish(),
2987
+ serviceTier: import_v44.z.string().nullish(),
2880
2988
  // https://ai.google.dev/api/generate-content#Modality
2881
2989
  promptTokensDetails: tokenDetailsSchema(),
2882
2990
  cacheTokensDetails: tokenDetailsSchema(),
2883
2991
  candidatesTokensDetails: tokenDetailsSchema(),
2884
2992
  toolUsePromptTokensDetails: tokenDetailsSchema()
2885
- }).catchall(import_v43.z.json());
2886
- var getUrlContextMetadataSchema = () => import_v43.z.object({
2887
- urlMetadata: import_v43.z.array(
2888
- import_v43.z.object({
2889
- retrievedUrl: import_v43.z.string(),
2890
- urlRetrievalStatus: import_v43.z.string()
2993
+ }).catchall(import_v44.z.json());
2994
+ var getUrlContextMetadataSchema = () => import_v44.z.object({
2995
+ urlMetadata: import_v44.z.array(
2996
+ import_v44.z.object({
2997
+ retrievedUrl: import_v44.z.string(),
2998
+ urlRetrievalStatus: import_v44.z.string()
2891
2999
  })
2892
3000
  ).nullish()
2893
3001
  });
2894
3002
  var responseSchema = (0, import_provider_utils5.lazySchema)(
2895
3003
  () => (0, import_provider_utils5.zodSchema)(
2896
- import_v43.z.object({
2897
- responseId: import_v43.z.string().nullish(),
2898
- candidates: import_v43.z.array(
2899
- import_v43.z.object({
2900
- content: getContentSchema().nullish().or(import_v43.z.object({}).strict()),
2901
- finishReason: import_v43.z.string().nullish(),
2902
- finishMessage: import_v43.z.string().nullish(),
2903
- continuationToken: import_v43.z.string().nullish(),
2904
- safetyRatings: import_v43.z.array(getSafetyRatingSchema()).nullish(),
3004
+ import_v44.z.object({
3005
+ responseId: import_v44.z.string().nullish(),
3006
+ candidates: import_v44.z.array(
3007
+ import_v44.z.object({
3008
+ content: getContentSchema().nullish().or(import_v44.z.object({}).strict()),
3009
+ finishReason: import_v44.z.string().nullish(),
3010
+ finishMessage: import_v44.z.string().nullish(),
3011
+ continuationToken: import_v44.z.string().nullish(),
3012
+ safetyRatings: import_v44.z.array(getSafetyRatingSchema()).nullish(),
2905
3013
  groundingMetadata: getGroundingMetadataSchema().nullish(),
2906
3014
  urlContextMetadata: getUrlContextMetadataSchema().nullish()
2907
3015
  })
2908
3016
  ).nullish(),
2909
3017
  usageMetadata: usageSchema().nullish(),
2910
- promptFeedback: import_v43.z.object({
2911
- blockReason: import_v43.z.string().nullish(),
2912
- safetyRatings: import_v43.z.array(getSafetyRatingSchema()).nullish()
3018
+ promptFeedback: import_v44.z.object({
3019
+ blockReason: import_v44.z.string().nullish(),
3020
+ safetyRatings: import_v44.z.array(getSafetyRatingSchema()).nullish()
2913
3021
  }).nullish()
2914
3022
  })
2915
3023
  )
2916
3024
  );
2917
3025
  var chunkSchema = (0, import_provider_utils5.lazySchema)(
2918
3026
  () => (0, import_provider_utils5.zodSchema)(
2919
- import_v43.z.object({
2920
- responseId: import_v43.z.string().nullish(),
2921
- candidates: import_v43.z.array(
2922
- import_v43.z.object({
3027
+ import_v44.z.object({
3028
+ error: getGoogleErrorSchema().nullish(),
3029
+ responseId: import_v44.z.string().nullish(),
3030
+ candidates: import_v44.z.array(
3031
+ import_v44.z.object({
2923
3032
  content: getContentSchema().nullish(),
2924
- finishReason: import_v43.z.string().nullish(),
2925
- finishMessage: import_v43.z.string().nullish(),
2926
- continuationToken: import_v43.z.string().nullish(),
2927
- safetyRatings: import_v43.z.array(getSafetyRatingSchema()).nullish(),
3033
+ finishReason: import_v44.z.string().nullish(),
3034
+ finishMessage: import_v44.z.string().nullish(),
3035
+ continuationToken: import_v44.z.string().nullish(),
3036
+ safetyRatings: import_v44.z.array(getSafetyRatingSchema()).nullish(),
2928
3037
  groundingMetadata: getGroundingMetadataSchema().nullish(),
2929
3038
  urlContextMetadata: getUrlContextMetadataSchema().nullish()
2930
3039
  })
2931
3040
  ).nullish(),
2932
3041
  usageMetadata: usageSchema().nullish(),
2933
- promptFeedback: import_v43.z.object({
2934
- blockReason: import_v43.z.string().nullish(),
2935
- safetyRatings: import_v43.z.array(getSafetyRatingSchema()).nullish()
3042
+ promptFeedback: import_v44.z.object({
3043
+ blockReason: import_v44.z.string().nullish(),
3044
+ safetyRatings: import_v44.z.array(getSafetyRatingSchema()).nullish()
2936
3045
  }).nullish()
2937
3046
  })
2938
3047
  )
@@ -2943,43 +3052,43 @@ function isConfirmedPromptBlockReason(blockReason) {
2943
3052
 
2944
3053
  // src/tool/code-execution.ts
2945
3054
  var import_provider_utils6 = require("@ai-sdk/provider-utils");
2946
- var import_v44 = require("zod/v4");
3055
+ var import_v45 = require("zod/v4");
2947
3056
  var codeExecution = (0, import_provider_utils6.createProviderToolFactoryWithOutputSchema)({
2948
3057
  id: "google.code_execution",
2949
- inputSchema: import_v44.z.object({
2950
- language: import_v44.z.string().describe("The programming language of the code."),
2951
- code: import_v44.z.string().describe("The code to be executed.")
3058
+ inputSchema: import_v45.z.object({
3059
+ language: import_v45.z.string().describe("The programming language of the code."),
3060
+ code: import_v45.z.string().describe("The code to be executed.")
2952
3061
  }),
2953
- outputSchema: import_v44.z.object({
2954
- outcome: import_v44.z.string().describe('The outcome of the execution (e.g., "OUTCOME_OK").'),
2955
- output: import_v44.z.string().describe("The output from the code execution.")
3062
+ outputSchema: import_v45.z.object({
3063
+ outcome: import_v45.z.string().describe('The outcome of the execution (e.g., "OUTCOME_OK").'),
3064
+ output: import_v45.z.string().describe("The output from the code execution.")
2956
3065
  })
2957
3066
  });
2958
3067
 
2959
3068
  // src/tool/enterprise-web-search.ts
2960
3069
  var import_provider_utils7 = require("@ai-sdk/provider-utils");
2961
- var import_v45 = require("zod/v4");
3070
+ var import_v46 = require("zod/v4");
2962
3071
  var enterpriseWebSearch = (0, import_provider_utils7.createProviderToolFactory)({
2963
3072
  id: "google.enterprise_web_search",
2964
- inputSchema: (0, import_provider_utils7.lazySchema)(() => (0, import_provider_utils7.zodSchema)(import_v45.z.object({})))
3073
+ inputSchema: (0, import_provider_utils7.lazySchema)(() => (0, import_provider_utils7.zodSchema)(import_v46.z.object({})))
2965
3074
  });
2966
3075
 
2967
3076
  // src/tool/file-search.ts
2968
3077
  var import_provider_utils8 = require("@ai-sdk/provider-utils");
2969
- var import_v46 = require("zod/v4");
2970
- var fileSearchArgsBaseSchema = () => import_v46.z.object({
3078
+ var import_v47 = require("zod/v4");
3079
+ var fileSearchArgsBaseSchema = () => import_v47.z.object({
2971
3080
  /** The names of the file_search_stores to retrieve from.
2972
3081
  * Example: `fileSearchStores/my-file-search-store-123`
2973
3082
  */
2974
- fileSearchStoreNames: import_v46.z.array(import_v46.z.string()).describe(
3083
+ fileSearchStoreNames: import_v47.z.array(import_v47.z.string()).describe(
2975
3084
  "The names of the file_search_stores to retrieve from. Example: `fileSearchStores/my-file-search-store-123`"
2976
3085
  ),
2977
3086
  /** The number of file search retrieval chunks to retrieve. */
2978
- topK: import_v46.z.number().int().positive().describe("The number of file search retrieval chunks to retrieve.").optional(),
3087
+ topK: import_v47.z.number().int().positive().describe("The number of file search retrieval chunks to retrieve.").optional(),
2979
3088
  /** Metadata filter to apply to the file search retrieval documents.
2980
3089
  * See https://google.aip.dev/160 for the syntax of the filter expression.
2981
3090
  */
2982
- metadataFilter: import_v46.z.string().describe(
3091
+ metadataFilter: import_v47.z.string().describe(
2983
3092
  "Metadata filter to apply to the file search retrieval documents. See https://google.aip.dev/160 for the syntax of the filter expression."
2984
3093
  ).optional()
2985
3094
  }).passthrough();
@@ -2993,23 +3102,23 @@ var fileSearch = (0, import_provider_utils8.createProviderToolFactory)({
2993
3102
 
2994
3103
  // src/tool/google-maps.ts
2995
3104
  var import_provider_utils9 = require("@ai-sdk/provider-utils");
2996
- var import_v47 = require("zod/v4");
3105
+ var import_v48 = require("zod/v4");
2997
3106
  var googleMaps = (0, import_provider_utils9.createProviderToolFactory)({
2998
3107
  id: "google.google_maps",
2999
- inputSchema: (0, import_provider_utils9.lazySchema)(() => (0, import_provider_utils9.zodSchema)(import_v47.z.object({})))
3108
+ inputSchema: (0, import_provider_utils9.lazySchema)(() => (0, import_provider_utils9.zodSchema)(import_v48.z.object({})))
3000
3109
  });
3001
3110
 
3002
3111
  // src/tool/google-search.ts
3003
3112
  var import_provider_utils10 = require("@ai-sdk/provider-utils");
3004
- var import_v48 = require("zod/v4");
3005
- var googleSearchToolArgsBaseSchema = () => import_v48.z.object({
3006
- searchTypes: import_v48.z.object({
3007
- webSearch: import_v48.z.object({}).optional(),
3008
- imageSearch: import_v48.z.object({}).optional()
3113
+ var import_v49 = require("zod/v4");
3114
+ var googleSearchToolArgsBaseSchema = () => import_v49.z.object({
3115
+ searchTypes: import_v49.z.object({
3116
+ webSearch: import_v49.z.object({}).optional(),
3117
+ imageSearch: import_v49.z.object({}).optional()
3009
3118
  }).optional(),
3010
- timeRangeFilter: import_v48.z.object({
3011
- startTime: import_v48.z.string(),
3012
- endTime: import_v48.z.string()
3119
+ timeRangeFilter: import_v49.z.object({
3120
+ startTime: import_v49.z.string(),
3121
+ endTime: import_v49.z.string()
3013
3122
  }).optional()
3014
3123
  }).passthrough();
3015
3124
  var googleSearchToolArgsSchema = (0, import_provider_utils10.lazySchema)(
@@ -3024,20 +3133,20 @@ var googleSearch = (0, import_provider_utils10.createProviderToolFactory)(
3024
3133
 
3025
3134
  // src/tool/url-context.ts
3026
3135
  var import_provider_utils11 = require("@ai-sdk/provider-utils");
3027
- var import_v49 = require("zod/v4");
3136
+ var import_v410 = require("zod/v4");
3028
3137
  var urlContext = (0, import_provider_utils11.createProviderToolFactory)({
3029
3138
  id: "google.url_context",
3030
- inputSchema: (0, import_provider_utils11.lazySchema)(() => (0, import_provider_utils11.zodSchema)(import_v49.z.object({})))
3139
+ inputSchema: (0, import_provider_utils11.lazySchema)(() => (0, import_provider_utils11.zodSchema)(import_v410.z.object({})))
3031
3140
  });
3032
3141
 
3033
3142
  // src/tool/vertex-rag-store.ts
3034
3143
  var import_provider_utils12 = require("@ai-sdk/provider-utils");
3035
- var import_v410 = require("zod/v4");
3144
+ var import_v411 = require("zod/v4");
3036
3145
  var vertexRagStore = (0, import_provider_utils12.createProviderToolFactory)({
3037
3146
  id: "google.vertex_rag_store",
3038
- inputSchema: import_v410.z.object({
3039
- ragCorpus: import_v410.z.string(),
3040
- topK: import_v410.z.number().optional()
3147
+ inputSchema: import_v411.z.object({
3148
+ ragCorpus: import_v411.z.string(),
3149
+ topK: import_v411.z.number().optional()
3041
3150
  })
3042
3151
  });
3043
3152
 
@@ -4259,30 +4368,30 @@ ${block.text}`
4259
4368
 
4260
4369
  // src/interactions/google-interactions-api.ts
4261
4370
  var import_provider_utils14 = require("@ai-sdk/provider-utils");
4262
- var import_v411 = require("zod/v4");
4263
- var tokenByModalitySchema = () => import_v411.z.object({
4264
- modality: import_v411.z.string().nullish(),
4265
- tokens: import_v411.z.number().nullish()
4371
+ var import_v412 = require("zod/v4");
4372
+ var tokenByModalitySchema = () => import_v412.z.object({
4373
+ modality: import_v412.z.string().nullish(),
4374
+ tokens: import_v412.z.number().nullish()
4266
4375
  }).loose();
4267
- var usageSchema2 = () => import_v411.z.object({
4268
- total_input_tokens: import_v411.z.number().nullish(),
4269
- total_output_tokens: import_v411.z.number().nullish(),
4270
- total_thought_tokens: import_v411.z.number().nullish(),
4271
- total_cached_tokens: import_v411.z.number().nullish(),
4272
- total_tool_use_tokens: import_v411.z.number().nullish(),
4273
- total_tokens: import_v411.z.number().nullish(),
4274
- input_tokens_by_modality: import_v411.z.array(tokenByModalitySchema()).nullish(),
4275
- output_tokens_by_modality: import_v411.z.array(tokenByModalitySchema()).nullish(),
4276
- cached_tokens_by_modality: import_v411.z.array(tokenByModalitySchema()).nullish(),
4277
- tool_use_tokens_by_modality: import_v411.z.array(tokenByModalitySchema()).nullish(),
4278
- grounding_tool_count: import_v411.z.array(
4279
- import_v411.z.object({
4280
- type: import_v411.z.string().nullish(),
4281
- count: import_v411.z.number().nullish()
4376
+ var usageSchema2 = () => import_v412.z.object({
4377
+ total_input_tokens: import_v412.z.number().nullish(),
4378
+ total_output_tokens: import_v412.z.number().nullish(),
4379
+ total_thought_tokens: import_v412.z.number().nullish(),
4380
+ total_cached_tokens: import_v412.z.number().nullish(),
4381
+ total_tool_use_tokens: import_v412.z.number().nullish(),
4382
+ total_tokens: import_v412.z.number().nullish(),
4383
+ input_tokens_by_modality: import_v412.z.array(tokenByModalitySchema()).nullish(),
4384
+ output_tokens_by_modality: import_v412.z.array(tokenByModalitySchema()).nullish(),
4385
+ cached_tokens_by_modality: import_v412.z.array(tokenByModalitySchema()).nullish(),
4386
+ tool_use_tokens_by_modality: import_v412.z.array(tokenByModalitySchema()).nullish(),
4387
+ grounding_tool_count: import_v412.z.array(
4388
+ import_v412.z.object({
4389
+ type: import_v412.z.string().nullish(),
4390
+ count: import_v412.z.number().nullish()
4282
4391
  }).loose()
4283
4392
  ).nullish()
4284
4393
  }).loose();
4285
- var interactionStatusSchema = () => import_v411.z.enum([
4394
+ var interactionStatusSchema = () => import_v412.z.enum([
4286
4395
  "in_progress",
4287
4396
  "requires_action",
4288
4397
  "completed",
@@ -4291,69 +4400,69 @@ var interactionStatusSchema = () => import_v411.z.enum([
4291
4400
  "incomplete"
4292
4401
  ]);
4293
4402
  var annotationSchema = () => {
4294
- const urlCitation = import_v411.z.object({
4295
- type: import_v411.z.literal("url_citation"),
4296
- url: import_v411.z.string().nullish(),
4297
- title: import_v411.z.string().nullish(),
4298
- start_index: import_v411.z.number().nullish(),
4299
- end_index: import_v411.z.number().nullish()
4403
+ const urlCitation = import_v412.z.object({
4404
+ type: import_v412.z.literal("url_citation"),
4405
+ url: import_v412.z.string().nullish(),
4406
+ title: import_v412.z.string().nullish(),
4407
+ start_index: import_v412.z.number().nullish(),
4408
+ end_index: import_v412.z.number().nullish()
4300
4409
  }).loose();
4301
- const fileCitation = import_v411.z.object({
4302
- type: import_v411.z.literal("file_citation"),
4303
- file_name: import_v411.z.string().nullish(),
4304
- document_uri: import_v411.z.string().nullish(),
4305
- url: import_v411.z.string().nullish(),
4306
- page_number: import_v411.z.number().nullish(),
4307
- media_id: import_v411.z.string().nullish(),
4308
- start_index: import_v411.z.number().nullish(),
4309
- end_index: import_v411.z.number().nullish(),
4310
- custom_metadata: import_v411.z.record(import_v411.z.string(), import_v411.z.unknown()).nullish()
4410
+ const fileCitation = import_v412.z.object({
4411
+ type: import_v412.z.literal("file_citation"),
4412
+ file_name: import_v412.z.string().nullish(),
4413
+ document_uri: import_v412.z.string().nullish(),
4414
+ url: import_v412.z.string().nullish(),
4415
+ page_number: import_v412.z.number().nullish(),
4416
+ media_id: import_v412.z.string().nullish(),
4417
+ start_index: import_v412.z.number().nullish(),
4418
+ end_index: import_v412.z.number().nullish(),
4419
+ custom_metadata: import_v412.z.record(import_v412.z.string(), import_v412.z.unknown()).nullish()
4311
4420
  }).loose();
4312
- const placeCitation = import_v411.z.object({
4313
- type: import_v411.z.literal("place_citation"),
4314
- name: import_v411.z.string().nullish(),
4315
- url: import_v411.z.string().nullish(),
4316
- place_id: import_v411.z.string().nullish(),
4317
- start_index: import_v411.z.number().nullish(),
4318
- end_index: import_v411.z.number().nullish()
4421
+ const placeCitation = import_v412.z.object({
4422
+ type: import_v412.z.literal("place_citation"),
4423
+ name: import_v412.z.string().nullish(),
4424
+ url: import_v412.z.string().nullish(),
4425
+ place_id: import_v412.z.string().nullish(),
4426
+ start_index: import_v412.z.number().nullish(),
4427
+ end_index: import_v412.z.number().nullish()
4319
4428
  }).loose();
4320
- return import_v411.z.union([
4429
+ return import_v412.z.union([
4321
4430
  urlCitation,
4322
4431
  fileCitation,
4323
4432
  placeCitation,
4324
- import_v411.z.object({ type: import_v411.z.string() }).loose()
4433
+ import_v412.z.object({ type: import_v412.z.string() }).loose()
4325
4434
  ]);
4326
4435
  };
4327
- var thoughtSummaryItemSchema = () => import_v411.z.object({
4328
- type: import_v411.z.string(),
4329
- text: import_v411.z.string().nullish(),
4330
- data: import_v411.z.string().nullish(),
4331
- mime_type: import_v411.z.string().nullish()
4436
+ var thoughtSummaryItemSchema = () => import_v412.z.object({
4437
+ type: import_v412.z.string(),
4438
+ text: import_v412.z.string().nullish(),
4439
+ data: import_v412.z.string().nullish(),
4440
+ mime_type: import_v412.z.string().nullish()
4332
4441
  }).loose();
4333
4442
  var contentBlockSchema = () => {
4334
- const textContent = import_v411.z.object({
4335
- type: import_v411.z.literal("text"),
4336
- text: import_v411.z.string(),
4337
- annotations: import_v411.z.array(annotationSchema()).nullish()
4443
+ const textContent = import_v412.z.object({
4444
+ type: import_v412.z.literal("text"),
4445
+ text: import_v412.z.string(),
4446
+ annotations: import_v412.z.array(annotationSchema()).nullish()
4338
4447
  }).loose();
4339
- const imageContent = import_v411.z.object({
4340
- type: import_v411.z.literal("image"),
4341
- data: import_v411.z.string().nullish(),
4342
- mime_type: import_v411.z.string().nullish(),
4343
- resolution: import_v411.z.enum(["low", "medium", "high", "ultra_high"]).nullish(),
4344
- uri: import_v411.z.string().nullish()
4448
+ const imageContent = import_v412.z.object({
4449
+ type: import_v412.z.literal("image"),
4450
+ data: import_v412.z.string().nullish(),
4451
+ mime_type: import_v412.z.string().nullish(),
4452
+ resolution: import_v412.z.enum(["low", "medium", "high", "ultra_high"]).nullish(),
4453
+ uri: import_v412.z.string().nullish()
4345
4454
  }).loose();
4346
- const videoContent = import_v411.z.object({
4347
- type: import_v411.z.literal("video"),
4348
- data: import_v411.z.string().nullish(),
4349
- mime_type: import_v411.z.string().nullish(),
4350
- uri: import_v411.z.string().nullish()
4455
+ const videoContent = import_v412.z.object({
4456
+ type: import_v412.z.literal("video"),
4457
+ data: import_v412.z.string().nullish(),
4458
+ mime_type: import_v412.z.string().nullish(),
4459
+ uri: import_v412.z.string().nullish()
4351
4460
  }).loose();
4352
- return import_v411.z.union([
4461
+ return import_v412.z.union([
4353
4462
  textContent,
4354
4463
  imageContent,
4355
4464
  videoContent,
4356
- import_v411.z.object({ type: import_v411.z.string() }).loose()
4465
+ import_v412.z.object({ type: import_v412.z.string() }).loose()
4357
4466
  ]);
4358
4467
  };
4359
4468
  var BUILTIN_TOOL_CALL_STEP_TYPES = [
@@ -4373,73 +4482,73 @@ var BUILTIN_TOOL_RESULT_STEP_TYPES = [
4373
4482
  "mcp_server_tool_result"
4374
4483
  ];
4375
4484
  var stepSchema = () => {
4376
- const userInputStep = import_v411.z.object({
4377
- type: import_v411.z.literal("user_input"),
4378
- content: import_v411.z.array(contentBlockSchema()).nullish()
4485
+ const userInputStep = import_v412.z.object({
4486
+ type: import_v412.z.literal("user_input"),
4487
+ content: import_v412.z.array(contentBlockSchema()).nullish()
4379
4488
  }).loose();
4380
- const modelOutputStep = import_v411.z.object({
4381
- type: import_v411.z.literal("model_output"),
4382
- content: import_v411.z.array(contentBlockSchema()).nullish()
4489
+ const modelOutputStep = import_v412.z.object({
4490
+ type: import_v412.z.literal("model_output"),
4491
+ content: import_v412.z.array(contentBlockSchema()).nullish()
4383
4492
  }).loose();
4384
- const functionCallStep = import_v411.z.object({
4385
- type: import_v411.z.literal("function_call"),
4386
- id: import_v411.z.string(),
4387
- name: import_v411.z.string(),
4388
- arguments: import_v411.z.record(import_v411.z.string(), import_v411.z.unknown()).nullish(),
4389
- signature: import_v411.z.string().nullish()
4493
+ const functionCallStep = import_v412.z.object({
4494
+ type: import_v412.z.literal("function_call"),
4495
+ id: import_v412.z.string(),
4496
+ name: import_v412.z.string(),
4497
+ arguments: import_v412.z.record(import_v412.z.string(), import_v412.z.unknown()).nullish(),
4498
+ signature: import_v412.z.string().nullish()
4390
4499
  }).loose();
4391
- const thoughtStep = import_v411.z.object({
4392
- type: import_v411.z.literal("thought"),
4393
- signature: import_v411.z.string().nullish(),
4394
- summary: import_v411.z.array(thoughtSummaryItemSchema()).nullish()
4500
+ const thoughtStep = import_v412.z.object({
4501
+ type: import_v412.z.literal("thought"),
4502
+ signature: import_v412.z.string().nullish(),
4503
+ summary: import_v412.z.array(thoughtSummaryItemSchema()).nullish()
4395
4504
  }).loose();
4396
- const builtinToolCallStep = import_v411.z.object({
4397
- type: import_v411.z.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
4398
- id: import_v411.z.string(),
4399
- arguments: import_v411.z.record(import_v411.z.string(), import_v411.z.unknown()).nullish(),
4400
- name: import_v411.z.string().nullish(),
4401
- server_name: import_v411.z.string().nullish(),
4402
- search_type: import_v411.z.string().nullish(),
4403
- signature: import_v411.z.string().nullish()
4505
+ const builtinToolCallStep = import_v412.z.object({
4506
+ type: import_v412.z.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
4507
+ id: import_v412.z.string(),
4508
+ arguments: import_v412.z.record(import_v412.z.string(), import_v412.z.unknown()).nullish(),
4509
+ name: import_v412.z.string().nullish(),
4510
+ server_name: import_v412.z.string().nullish(),
4511
+ search_type: import_v412.z.string().nullish(),
4512
+ signature: import_v412.z.string().nullish()
4404
4513
  }).loose();
4405
- const builtinToolResultStep = import_v411.z.object({
4406
- type: import_v411.z.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
4407
- call_id: import_v411.z.string(),
4408
- result: import_v411.z.unknown().nullish(),
4409
- is_error: import_v411.z.boolean().nullish(),
4410
- name: import_v411.z.string().nullish(),
4411
- server_name: import_v411.z.string().nullish(),
4412
- signature: import_v411.z.string().nullish()
4514
+ const builtinToolResultStep = import_v412.z.object({
4515
+ type: import_v412.z.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
4516
+ call_id: import_v412.z.string(),
4517
+ result: import_v412.z.unknown().nullish(),
4518
+ is_error: import_v412.z.boolean().nullish(),
4519
+ name: import_v412.z.string().nullish(),
4520
+ server_name: import_v412.z.string().nullish(),
4521
+ signature: import_v412.z.string().nullish()
4413
4522
  }).loose();
4414
- return import_v411.z.union([
4523
+ return import_v412.z.union([
4415
4524
  userInputStep,
4416
4525
  modelOutputStep,
4417
4526
  functionCallStep,
4418
4527
  thoughtStep,
4419
4528
  builtinToolCallStep,
4420
4529
  builtinToolResultStep,
4421
- import_v411.z.object({ type: import_v411.z.string() }).loose()
4530
+ import_v412.z.object({ type: import_v412.z.string() }).loose()
4422
4531
  ]);
4423
4532
  };
4424
4533
  var googleInteractionsResponseSchema = (0, import_provider_utils14.lazySchema)(
4425
4534
  () => (0, import_provider_utils14.zodSchema)(
4426
- import_v411.z.object({
4535
+ import_v412.z.object({
4427
4536
  /*
4428
4537
  * `id` is omitted from the response body when `store: false` (fully
4429
4538
  * stateless mode) — there is no server-side interaction record for the
4430
4539
  * client to reference. `nullish` lets the schema accept that shape.
4431
4540
  */
4432
- id: import_v411.z.string().nullish(),
4433
- created: import_v411.z.string().nullish(),
4434
- updated: import_v411.z.string().nullish(),
4541
+ id: import_v412.z.string().nullish(),
4542
+ created: import_v412.z.string().nullish(),
4543
+ updated: import_v412.z.string().nullish(),
4435
4544
  status: interactionStatusSchema(),
4436
- model: import_v411.z.string().nullish(),
4437
- agent: import_v411.z.string().nullish(),
4438
- steps: import_v411.z.array(stepSchema()).nullish(),
4545
+ model: import_v412.z.string().nullish(),
4546
+ agent: import_v412.z.string().nullish(),
4547
+ steps: import_v412.z.array(stepSchema()).nullish(),
4439
4548
  usage: usageSchema2().nullish(),
4440
- service_tier: import_v411.z.string().nullish(),
4441
- previous_interaction_id: import_v411.z.string().nullish(),
4442
- response_modalities: import_v411.z.array(import_v411.z.string()).nullish()
4549
+ service_tier: import_v412.z.string().nullish(),
4550
+ previous_interaction_id: import_v412.z.string().nullish(),
4551
+ response_modalities: import_v412.z.array(import_v412.z.string()).nullish()
4443
4552
  }).loose()
4444
4553
  )
4445
4554
  );
@@ -4449,82 +4558,82 @@ var googleInteractionsEventSchema = (0, import_provider_utils14.lazySchema)(
4449
4558
  const status = interactionStatusSchema();
4450
4559
  const annotation = annotationSchema();
4451
4560
  const thoughtSummaryItem = thoughtSummaryItemSchema();
4452
- const interactionCreatedEvent = import_v411.z.object({
4453
- event_type: import_v411.z.literal("interaction.created"),
4454
- event_id: import_v411.z.string().nullish(),
4455
- interaction: import_v411.z.object({
4561
+ const interactionCreatedEvent = import_v412.z.object({
4562
+ event_type: import_v412.z.literal("interaction.created"),
4563
+ event_id: import_v412.z.string().nullish(),
4564
+ interaction: import_v412.z.object({
4456
4565
  /*
4457
4566
  * `id` is omitted when `store: false` (fully stateless mode);
4458
4567
  * see the matching note on `googleInteractionsResponseSchema.id`.
4459
4568
  */
4460
- id: import_v411.z.string().nullish(),
4461
- created: import_v411.z.string().nullish(),
4462
- model: import_v411.z.string().nullish(),
4463
- agent: import_v411.z.string().nullish(),
4569
+ id: import_v412.z.string().nullish(),
4570
+ created: import_v412.z.string().nullish(),
4571
+ model: import_v412.z.string().nullish(),
4572
+ agent: import_v412.z.string().nullish(),
4464
4573
  status: status.nullish()
4465
4574
  }).loose()
4466
4575
  }).loose();
4467
- const stepStartEvent = import_v411.z.object({
4468
- event_type: import_v411.z.literal("step.start"),
4469
- event_id: import_v411.z.string().nullish(),
4470
- index: import_v411.z.number(),
4576
+ const stepStartEvent = import_v412.z.object({
4577
+ event_type: import_v412.z.literal("step.start"),
4578
+ event_id: import_v412.z.string().nullish(),
4579
+ index: import_v412.z.number(),
4471
4580
  step: stepSchema()
4472
4581
  }).loose();
4473
- const stepDeltaText = import_v411.z.object({
4474
- type: import_v411.z.literal("text"),
4475
- text: import_v411.z.string()
4582
+ const stepDeltaText = import_v412.z.object({
4583
+ type: import_v412.z.literal("text"),
4584
+ text: import_v412.z.string()
4476
4585
  }).loose();
4477
- const stepDeltaThoughtSummary = import_v411.z.object({
4478
- type: import_v411.z.literal("thought_summary"),
4586
+ const stepDeltaThoughtSummary = import_v412.z.object({
4587
+ type: import_v412.z.literal("thought_summary"),
4479
4588
  content: thoughtSummaryItem.nullish()
4480
4589
  }).loose();
4481
- const stepDeltaThoughtSignature = import_v411.z.object({
4482
- type: import_v411.z.literal("thought_signature"),
4483
- signature: import_v411.z.string().nullish()
4590
+ const stepDeltaThoughtSignature = import_v412.z.object({
4591
+ type: import_v412.z.literal("thought_signature"),
4592
+ signature: import_v412.z.string().nullish()
4484
4593
  }).loose();
4485
- const stepDeltaArgumentsDelta = import_v411.z.object({
4486
- type: import_v411.z.literal("arguments_delta"),
4487
- arguments: import_v411.z.string().nullish(),
4488
- id: import_v411.z.string().nullish(),
4489
- signature: import_v411.z.string().nullish()
4594
+ const stepDeltaArgumentsDelta = import_v412.z.object({
4595
+ type: import_v412.z.literal("arguments_delta"),
4596
+ arguments: import_v412.z.string().nullish(),
4597
+ id: import_v412.z.string().nullish(),
4598
+ signature: import_v412.z.string().nullish()
4490
4599
  }).loose();
4491
- const stepDeltaTextAnnotation = import_v411.z.object({
4492
- type: import_v411.z.enum(["text_annotation_delta", "text_annotation"]),
4493
- annotations: import_v411.z.array(annotation).nullish()
4600
+ const stepDeltaTextAnnotation = import_v412.z.object({
4601
+ type: import_v412.z.enum(["text_annotation_delta", "text_annotation"]),
4602
+ annotations: import_v412.z.array(annotation).nullish()
4494
4603
  }).loose();
4495
- const stepDeltaImage = import_v411.z.object({
4496
- type: import_v411.z.literal("image"),
4497
- data: import_v411.z.string().nullish(),
4498
- mime_type: import_v411.z.string().nullish(),
4499
- resolution: import_v411.z.enum(["low", "medium", "high", "ultra_high"]).nullish(),
4500
- uri: import_v411.z.string().nullish()
4604
+ const stepDeltaImage = import_v412.z.object({
4605
+ type: import_v412.z.literal("image"),
4606
+ data: import_v412.z.string().nullish(),
4607
+ mime_type: import_v412.z.string().nullish(),
4608
+ resolution: import_v412.z.enum(["low", "medium", "high", "ultra_high"]).nullish(),
4609
+ uri: import_v412.z.string().nullish()
4501
4610
  }).loose();
4502
- const stepDeltaVideo = import_v411.z.object({
4503
- type: import_v411.z.literal("video"),
4504
- data: import_v411.z.string().nullish(),
4505
- mime_type: import_v411.z.string().nullish(),
4506
- uri: import_v411.z.string().nullish()
4611
+ const stepDeltaVideo = import_v412.z.object({
4612
+ type: import_v412.z.literal("video"),
4613
+ data: import_v412.z.string().nullish(),
4614
+ mime_type: import_v412.z.string().nullish(),
4615
+ uri: import_v412.z.string().nullish()
4507
4616
  }).loose();
4508
- const stepDeltaBuiltinToolCall = import_v411.z.object({
4509
- type: import_v411.z.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
4510
- id: import_v411.z.string().nullish(),
4511
- arguments: import_v411.z.record(import_v411.z.string(), import_v411.z.unknown()).nullish(),
4512
- name: import_v411.z.string().nullish(),
4513
- server_name: import_v411.z.string().nullish(),
4514
- search_type: import_v411.z.string().nullish(),
4515
- signature: import_v411.z.string().nullish()
4617
+ const stepDeltaBuiltinToolCall = import_v412.z.object({
4618
+ type: import_v412.z.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
4619
+ id: import_v412.z.string().nullish(),
4620
+ arguments: import_v412.z.record(import_v412.z.string(), import_v412.z.unknown()).nullish(),
4621
+ name: import_v412.z.string().nullish(),
4622
+ server_name: import_v412.z.string().nullish(),
4623
+ search_type: import_v412.z.string().nullish(),
4624
+ signature: import_v412.z.string().nullish()
4516
4625
  }).loose();
4517
- const stepDeltaBuiltinToolResult = import_v411.z.object({
4518
- type: import_v411.z.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
4519
- call_id: import_v411.z.string().nullish(),
4520
- result: import_v411.z.unknown().nullish(),
4521
- is_error: import_v411.z.boolean().nullish(),
4522
- name: import_v411.z.string().nullish(),
4523
- server_name: import_v411.z.string().nullish(),
4524
- signature: import_v411.z.string().nullish()
4626
+ const stepDeltaBuiltinToolResult = import_v412.z.object({
4627
+ type: import_v412.z.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
4628
+ call_id: import_v412.z.string().nullish(),
4629
+ result: import_v412.z.unknown().nullish(),
4630
+ is_error: import_v412.z.boolean().nullish(),
4631
+ name: import_v412.z.string().nullish(),
4632
+ server_name: import_v412.z.string().nullish(),
4633
+ signature: import_v412.z.string().nullish()
4525
4634
  }).loose();
4526
- const stepDeltaUnknown = import_v411.z.object({ type: import_v411.z.string() }).loose();
4527
- const stepDeltaUnion = import_v411.z.union([
4635
+ const stepDeltaUnknown = import_v412.z.object({ type: import_v412.z.string() }).loose();
4636
+ const stepDeltaUnion = import_v412.z.union([
4528
4637
  stepDeltaText,
4529
4638
  stepDeltaImage,
4530
4639
  stepDeltaVideo,
@@ -4536,55 +4645,55 @@ var googleInteractionsEventSchema = (0, import_provider_utils14.lazySchema)(
4536
4645
  stepDeltaBuiltinToolResult,
4537
4646
  stepDeltaUnknown
4538
4647
  ]);
4539
- const stepDeltaEvent = import_v411.z.object({
4540
- event_type: import_v411.z.literal("step.delta"),
4541
- event_id: import_v411.z.string().nullish(),
4542
- index: import_v411.z.number(),
4648
+ const stepDeltaEvent = import_v412.z.object({
4649
+ event_type: import_v412.z.literal("step.delta"),
4650
+ event_id: import_v412.z.string().nullish(),
4651
+ index: import_v412.z.number(),
4543
4652
  delta: stepDeltaUnion
4544
4653
  }).loose();
4545
- const stepStopEvent = import_v411.z.object({
4546
- event_type: import_v411.z.literal("step.stop"),
4547
- event_id: import_v411.z.string().nullish(),
4548
- index: import_v411.z.number()
4654
+ const stepStopEvent = import_v412.z.object({
4655
+ event_type: import_v412.z.literal("step.stop"),
4656
+ event_id: import_v412.z.string().nullish(),
4657
+ index: import_v412.z.number()
4549
4658
  }).loose();
4550
- const interactionStatusUpdateEvent = import_v411.z.object({
4551
- event_type: import_v411.z.literal("interaction.status_update"),
4552
- event_id: import_v411.z.string().nullish(),
4553
- interaction_id: import_v411.z.string().nullish(),
4659
+ const interactionStatusUpdateEvent = import_v412.z.object({
4660
+ event_type: import_v412.z.literal("interaction.status_update"),
4661
+ event_id: import_v412.z.string().nullish(),
4662
+ interaction_id: import_v412.z.string().nullish(),
4554
4663
  status: status.nullish()
4555
4664
  }).loose();
4556
- const interactionInProgressEvent = import_v411.z.object({
4557
- event_type: import_v411.z.literal("interaction.in_progress"),
4558
- event_id: import_v411.z.string().nullish(),
4559
- interaction_id: import_v411.z.string().nullish(),
4665
+ const interactionInProgressEvent = import_v412.z.object({
4666
+ event_type: import_v412.z.literal("interaction.in_progress"),
4667
+ event_id: import_v412.z.string().nullish(),
4668
+ interaction_id: import_v412.z.string().nullish(),
4560
4669
  status: status.nullish()
4561
4670
  }).loose();
4562
- const interactionRequiresActionEvent = import_v411.z.object({
4563
- event_type: import_v411.z.literal("interaction.requires_action"),
4564
- event_id: import_v411.z.string().nullish(),
4565
- interaction_id: import_v411.z.string().nullish(),
4671
+ const interactionRequiresActionEvent = import_v412.z.object({
4672
+ event_type: import_v412.z.literal("interaction.requires_action"),
4673
+ event_id: import_v412.z.string().nullish(),
4674
+ interaction_id: import_v412.z.string().nullish(),
4566
4675
  status: status.nullish()
4567
4676
  }).loose();
4568
- const interactionCompletedEvent = import_v411.z.object({
4569
- event_type: import_v411.z.literal("interaction.completed"),
4570
- event_id: import_v411.z.string().nullish(),
4571
- interaction: import_v411.z.object({
4572
- id: import_v411.z.string().nullish(),
4677
+ const interactionCompletedEvent = import_v412.z.object({
4678
+ event_type: import_v412.z.literal("interaction.completed"),
4679
+ event_id: import_v412.z.string().nullish(),
4680
+ interaction: import_v412.z.object({
4681
+ id: import_v412.z.string().nullish(),
4573
4682
  status: status.nullish(),
4574
4683
  usage: usageSchema2().nullish(),
4575
- service_tier: import_v411.z.string().nullish()
4684
+ service_tier: import_v412.z.string().nullish()
4576
4685
  }).loose()
4577
4686
  }).loose();
4578
- const errorEvent = import_v411.z.object({
4579
- event_type: import_v411.z.literal("error"),
4580
- event_id: import_v411.z.string().nullish(),
4581
- error: import_v411.z.object({
4582
- code: import_v411.z.string().nullish(),
4583
- message: import_v411.z.string().nullish()
4687
+ const errorEvent = import_v412.z.object({
4688
+ event_type: import_v412.z.literal("error"),
4689
+ event_id: import_v412.z.string().nullish(),
4690
+ error: import_v412.z.object({
4691
+ code: import_v412.z.string().nullish(),
4692
+ message: import_v412.z.string().nullish()
4584
4693
  }).loose().nullish()
4585
4694
  }).loose();
4586
- const unknownEvent = import_v411.z.object({ event_type: import_v411.z.string() }).loose();
4587
- return import_v411.z.union([
4695
+ const unknownEvent = import_v412.z.object({ event_type: import_v412.z.string() }).loose();
4696
+ return import_v412.z.union([
4588
4697
  interactionCreatedEvent,
4589
4698
  stepStartEvent,
4590
4699
  stepDeltaEvent,
@@ -4602,26 +4711,26 @@ var googleInteractionsEventSchema = (0, import_provider_utils14.lazySchema)(
4602
4711
 
4603
4712
  // src/interactions/google-interactions-language-model-options.ts
4604
4713
  var import_provider_utils15 = require("@ai-sdk/provider-utils");
4605
- var import_v412 = require("zod/v4");
4714
+ var import_v413 = require("zod/v4");
4606
4715
  var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySchema)(
4607
4716
  () => (0, import_provider_utils15.zodSchema)(
4608
- import_v412.z.object({
4609
- previousInteractionId: import_v412.z.string().nullish(),
4610
- store: import_v412.z.boolean().nullish(),
4611
- agent: import_v412.z.string().nullish(),
4612
- agentConfig: import_v412.z.union([
4613
- import_v412.z.object({
4614
- type: import_v412.z.literal("dynamic")
4717
+ import_v413.z.object({
4718
+ previousInteractionId: import_v413.z.string().nullish(),
4719
+ store: import_v413.z.boolean().nullish(),
4720
+ agent: import_v413.z.string().nullish(),
4721
+ agentConfig: import_v413.z.union([
4722
+ import_v413.z.object({
4723
+ type: import_v413.z.literal("dynamic")
4615
4724
  }).loose(),
4616
- import_v412.z.object({
4617
- type: import_v412.z.literal("deep-research"),
4618
- thinkingSummaries: import_v412.z.enum(["auto", "none"]).nullish(),
4619
- visualization: import_v412.z.enum(["off", "auto"]).nullish(),
4620
- collaborativePlanning: import_v412.z.boolean().nullish()
4725
+ import_v413.z.object({
4726
+ type: import_v413.z.literal("deep-research"),
4727
+ thinkingSummaries: import_v413.z.enum(["auto", "none"]).nullish(),
4728
+ visualization: import_v413.z.enum(["off", "auto"]).nullish(),
4729
+ collaborativePlanning: import_v413.z.boolean().nullish()
4621
4730
  })
4622
4731
  ]).nullish(),
4623
- thinkingLevel: import_v412.z.enum(["minimal", "low", "medium", "high"]).nullish(),
4624
- thinkingSummaries: import_v412.z.enum(["auto", "none"]).nullish(),
4732
+ thinkingLevel: import_v413.z.enum(["minimal", "low", "medium", "high"]).nullish(),
4733
+ thinkingSummaries: import_v413.z.enum(["auto", "none"]).nullish(),
4625
4734
  /**
4626
4735
  * Output-format entries that map directly to the API's `response_format`
4627
4736
  * array. Use this to request image, audio, video, or non-JSON text
@@ -4631,17 +4740,17 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
4631
4740
  * type: 'json', schema }` still drives JSON-mode and adds a matching
4632
4741
  * text entry automatically; entries listed here are appended.
4633
4742
  */
4634
- responseFormat: import_v412.z.array(
4635
- import_v412.z.union([
4636
- import_v412.z.object({
4637
- type: import_v412.z.literal("text"),
4638
- mimeType: import_v412.z.string().nullish(),
4639
- schema: import_v412.z.unknown().nullish()
4743
+ responseFormat: import_v413.z.array(
4744
+ import_v413.z.union([
4745
+ import_v413.z.object({
4746
+ type: import_v413.z.literal("text"),
4747
+ mimeType: import_v413.z.string().nullish(),
4748
+ schema: import_v413.z.unknown().nullish()
4640
4749
  }).loose(),
4641
- import_v412.z.object({
4642
- type: import_v412.z.literal("image"),
4643
- mimeType: import_v412.z.string().nullish(),
4644
- aspectRatio: import_v412.z.enum([
4750
+ import_v413.z.object({
4751
+ type: import_v413.z.literal("image"),
4752
+ mimeType: import_v413.z.string().nullish(),
4753
+ aspectRatio: import_v413.z.enum([
4645
4754
  "1:1",
4646
4755
  "2:3",
4647
4756
  "3:2",
@@ -4657,19 +4766,19 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
4657
4766
  "1:4",
4658
4767
  "4:1"
4659
4768
  ]).nullish(),
4660
- imageSize: import_v412.z.enum(["1K", "2K", "4K", "512"]).nullish()
4769
+ imageSize: import_v413.z.enum(["1K", "2K", "4K", "512"]).nullish()
4661
4770
  }).loose(),
4662
- import_v412.z.object({
4663
- type: import_v412.z.literal("audio"),
4664
- mimeType: import_v412.z.string().nullish()
4771
+ import_v413.z.object({
4772
+ type: import_v413.z.literal("audio"),
4773
+ mimeType: import_v413.z.string().nullish()
4665
4774
  }).loose(),
4666
- import_v412.z.object({
4667
- type: import_v412.z.literal("video"),
4668
- aspectRatio: import_v412.z.enum(["16:9", "9:16"]).nullish(),
4669
- resolution: import_v412.z.enum(["360p", "720p", "1080p", "4k"]).nullish(),
4670
- duration: import_v412.z.string().nullish(),
4671
- delivery: import_v412.z.enum(["inline", "uri"]).nullish(),
4672
- gcsUri: import_v412.z.string().nullish()
4775
+ import_v413.z.object({
4776
+ type: import_v413.z.literal("video"),
4777
+ aspectRatio: import_v413.z.enum(["16:9", "9:16"]).nullish(),
4778
+ resolution: import_v413.z.enum(["360p", "720p", "1080p", "4k"]).nullish(),
4779
+ duration: import_v413.z.string().nullish(),
4780
+ delivery: import_v413.z.enum(["inline", "uri"]).nullish(),
4781
+ gcsUri: import_v413.z.string().nullish()
4673
4782
  }).loose()
4674
4783
  ])
4675
4784
  ).nullish(),
@@ -4679,8 +4788,8 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
4679
4788
  * translates it into a matching `response_format` image entry and
4680
4789
  * emits a warning when set.
4681
4790
  */
4682
- imageConfig: import_v412.z.object({
4683
- aspectRatio: import_v412.z.enum([
4791
+ imageConfig: import_v413.z.object({
4792
+ aspectRatio: import_v413.z.enum([
4684
4793
  "1:1",
4685
4794
  "2:3",
4686
4795
  "3:2",
@@ -4696,35 +4805,35 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
4696
4805
  "1:4",
4697
4806
  "4:1"
4698
4807
  ]).nullish(),
4699
- imageSize: import_v412.z.enum(["1K", "2K", "4K", "512"]).nullish()
4808
+ imageSize: import_v413.z.enum(["1K", "2K", "4K", "512"]).nullish()
4700
4809
  }).nullish(),
4701
- mediaResolution: import_v412.z.enum(["low", "medium", "high", "ultra_high"]).nullish(),
4702
- responseModalities: import_v412.z.array(import_v412.z.enum(["text", "image", "audio", "video", "document"])).nullish(),
4703
- serviceTier: import_v412.z.enum(["flex", "standard", "priority"]).nullish(),
4810
+ mediaResolution: import_v413.z.enum(["low", "medium", "high", "ultra_high"]).nullish(),
4811
+ responseModalities: import_v413.z.array(import_v413.z.enum(["text", "image", "audio", "video", "document"])).nullish(),
4812
+ serviceTier: import_v413.z.enum(["flex", "standard", "priority"]).nullish(),
4704
4813
  /**
4705
4814
  * Alternative to AI SDK `system` message. If both are set, the AI SDK
4706
4815
  * `system` message wins and a warning is emitted.
4707
4816
  */
4708
- systemInstruction: import_v412.z.string().nullish(),
4817
+ systemInstruction: import_v413.z.string().nullish(),
4709
4818
  /**
4710
4819
  * Per-block signature for round-tripping `thought.signature` and
4711
4820
  * `function_call.signature` blocks. Set by the SDK on output reasoning /
4712
4821
  * tool-call parts; passed back unchanged on input parts so the API
4713
4822
  * accepts the prior turn.
4714
4823
  */
4715
- signature: import_v412.z.string().nullish(),
4824
+ signature: import_v413.z.string().nullish(),
4716
4825
  /**
4717
4826
  * Set by the SDK on output assistant messages. The converter uses it to
4718
4827
  * decide which messages to drop when compacting under
4719
4828
  * `previousInteractionId`.
4720
4829
  */
4721
- interactionId: import_v412.z.string().nullish(),
4830
+ interactionId: import_v413.z.string().nullish(),
4722
4831
  /**
4723
4832
  * Maximum time, in milliseconds, to poll a background interaction (agent
4724
4833
  * call) before giving up. Defaults to 30 minutes. Long-running agents
4725
4834
  * such as deep research can take tens of minutes — increase if needed.
4726
4835
  */
4727
- pollingTimeoutMs: import_v412.z.number().int().positive().nullish(),
4836
+ pollingTimeoutMs: import_v413.z.number().int().positive().nullish(),
4728
4837
  /**
4729
4838
  * Run the interaction in the background. Required for agents whose
4730
4839
  * server-side workflow cannot complete within a single request/response.
@@ -4733,7 +4842,7 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
4733
4842
  * reject `true`; see the agent's documentation for which mode it
4734
4843
  * requires.
4735
4844
  */
4736
- background: import_v412.z.boolean().nullish(),
4845
+ background: import_v413.z.boolean().nullish(),
4737
4846
  /**
4738
4847
  * Environment configuration for the agent sandbox. Only applies to agent
4739
4848
  * calls (`google.interactions({ agent })`); ignored on model-id calls.
@@ -4743,36 +4852,36 @@ var googleInteractionsLanguageModelOptions = (0, import_provider_utils15.lazySch
4743
4852
  * - object: provision a fresh sandbox and optionally preload `sources`
4744
4853
  * and/or constrain outbound traffic via `network`.
4745
4854
  */
4746
- environment: import_v412.z.union([
4747
- import_v412.z.string(),
4748
- import_v412.z.object({
4749
- type: import_v412.z.literal("remote"),
4750
- sources: import_v412.z.array(
4751
- import_v412.z.union([
4752
- import_v412.z.object({
4753
- type: import_v412.z.literal("gcs"),
4754
- source: import_v412.z.string(),
4755
- target: import_v412.z.string().nullish()
4855
+ environment: import_v413.z.union([
4856
+ import_v413.z.string(),
4857
+ import_v413.z.object({
4858
+ type: import_v413.z.literal("remote"),
4859
+ sources: import_v413.z.array(
4860
+ import_v413.z.union([
4861
+ import_v413.z.object({
4862
+ type: import_v413.z.literal("gcs"),
4863
+ source: import_v413.z.string(),
4864
+ target: import_v413.z.string().nullish()
4756
4865
  }),
4757
- import_v412.z.object({
4758
- type: import_v412.z.literal("repository"),
4759
- source: import_v412.z.string(),
4760
- target: import_v412.z.string().nullish()
4866
+ import_v413.z.object({
4867
+ type: import_v413.z.literal("repository"),
4868
+ source: import_v413.z.string(),
4869
+ target: import_v413.z.string().nullish()
4761
4870
  }),
4762
- import_v412.z.object({
4763
- type: import_v412.z.literal("inline"),
4764
- content: import_v412.z.string(),
4765
- target: import_v412.z.string()
4871
+ import_v413.z.object({
4872
+ type: import_v413.z.literal("inline"),
4873
+ content: import_v413.z.string(),
4874
+ target: import_v413.z.string()
4766
4875
  })
4767
4876
  ])
4768
4877
  ).nullish(),
4769
- network: import_v412.z.union([
4770
- import_v412.z.literal("disabled"),
4771
- import_v412.z.object({
4772
- allowlist: import_v412.z.array(
4773
- import_v412.z.object({
4774
- domain: import_v412.z.string(),
4775
- transform: import_v412.z.array(import_v412.z.record(import_v412.z.string(), import_v412.z.string())).nullish()
4878
+ network: import_v413.z.union([
4879
+ import_v413.z.literal("disabled"),
4880
+ import_v413.z.object({
4881
+ allowlist: import_v413.z.array(
4882
+ import_v413.z.object({
4883
+ domain: import_v413.z.string(),
4884
+ transform: import_v413.z.array(import_v413.z.record(import_v413.z.string(), import_v413.z.string())).nullish()
4776
4885
  })
4777
4886
  )
4778
4887
  })
@@ -5076,6 +5185,9 @@ function prepareGoogleInteractionsTools({
5076
5185
  }) {
5077
5186
  var _a, _b, _c, _d;
5078
5187
  const toolWarnings = [];
5188
+ if ((toolChoice == null ? void 0 : toolChoice.type) === "none") {
5189
+ return { tools: void 0, toolChoice: void 0, toolWarnings };
5190
+ }
5079
5191
  const normalized = (tools == null ? void 0 : tools.length) ? tools : void 0;
5080
5192
  if (normalized == null) {
5081
5193
  return { tools: void 0, toolChoice: void 0, toolWarnings };
@@ -5197,9 +5309,6 @@ function prepareGoogleInteractionsTools({
5197
5309
  case "required":
5198
5310
  mappedToolChoice = "any";
5199
5311
  break;
5200
- case "none":
5201
- mappedToolChoice = "none";
5202
- break;
5203
5312
  case "tool":
5204
5313
  mappedToolChoice = {
5205
5314
  allowed_tools: {