@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.
@@ -10,7 +10,7 @@ import {
10
10
  resolve,
11
11
  zodSchema as zodSchema3
12
12
  } from "@ai-sdk/provider-utils";
13
- import { z as z3 } from "zod/v4";
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" ? (_g = output.reason) != null ? _g : "Tool call execution denied." : output.value
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
- z.object({
909
- error: z.object({
910
- code: z.number().nullable(),
911
- message: z.string(),
912
- status: z.string(),
913
- details: z.array(z.unknown()).nullish()
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 z2 } from "zod/v4";
948
+ import { z as z3 } from "zod/v4";
929
949
  var googleLanguageModelOptions = lazySchema2(
930
950
  () => zodSchema2(
931
- z2.object({
932
- responseModalities: z2.array(z2.enum(["TEXT", "IMAGE"])).optional(),
933
- thinkingConfig: z2.object({
934
- thinkingBudget: z2.number().optional(),
935
- includeThoughts: z2.boolean().optional(),
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: z2.enum(["minimal", "low", "medium", "high"]).optional()
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: z2.string().optional(),
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: z2.boolean().optional(),
973
+ structuredOutputs: z3.boolean().optional(),
954
974
  /**
955
975
  * Optional. A list of unique safety settings for blocking unsafe content.
956
976
  */
957
- safetySettings: z2.array(
958
- z2.object({
959
- category: z2.enum([
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: z2.enum([
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: z2.enum([
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: z2.boolean().optional(),
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: z2.record(z2.string(), z2.string()).optional(),
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: z2.enum([
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: z2.object({
1014
- aspectRatio: z2.enum([
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: z2.enum(["1K", "2K", "4K", "512"]).optional(),
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: z2.enum([
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: z2.enum([
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: z2.object({
1059
- mimeType: z2.enum(["image/jpeg", "image/png"]).optional(),
1060
- compressionQuality: z2.number().optional()
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: z2.object({
1070
- latLng: z2.object({
1071
- latitude: z2.number(),
1072
- longitude: z2.number()
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: z2.boolean().optional(),
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: z2.enum(["standard", "flex", "priority"]).optional(),
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: z2.string().optional(),
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: z2.enum(["priority", "flex", "standard"]).optional(),
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: z2.enum(["shared"]).optional()
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 = () => z3.object({
2739
- webSearchQueries: z3.array(z3.string()).nullish(),
2740
- imageSearchQueries: z3.array(z3.string()).nullish(),
2741
- retrievalQueries: z3.array(z3.string()).nullish(),
2742
- searchEntryPoint: z3.object({ renderedContent: z3.string() }).nullish(),
2743
- groundingChunks: z3.array(
2744
- z3.object({
2745
- web: z3.object({ uri: z3.string(), title: z3.string().nullish() }).nullish(),
2746
- image: z3.object({
2747
- sourceUri: z3.string(),
2748
- imageUri: z3.string(),
2749
- title: z3.string().nullish(),
2750
- domain: z3.string().nullish()
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: z3.object({
2753
- uri: z3.string().nullish(),
2754
- title: z3.string().nullish(),
2755
- text: z3.string().nullish(),
2756
- fileSearchStore: z3.string().nullish(),
2757
- customMetadata: z3.array(
2758
- z3.object({
2759
- key: z3.string(),
2760
- stringValue: z3.string().nullish(),
2761
- numericValue: z3.number().nullish(),
2762
- stringListValue: z3.object({ values: z3.array(z3.string()).nullish() }).nullish()
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: z3.object({
2767
- uri: z3.string().nullish(),
2768
- title: z3.string().nullish(),
2769
- text: z3.string().nullish(),
2770
- placeId: z3.string().nullish()
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: z3.array(
2775
- z3.object({
2776
- segment: z3.object({
2777
- startIndex: z3.number().nullish(),
2778
- endIndex: z3.number().nullish(),
2779
- text: z3.string().nullish()
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: z3.string().nullish(),
2782
- groundingChunkIndices: z3.array(z3.number()).nullish(),
2783
- supportChunkIndices: z3.array(z3.number()).nullish(),
2784
- confidenceScores: z3.array(z3.number()).nullish(),
2785
- confidenceScore: z3.array(z3.number()).nullish()
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: z3.union([
2789
- z3.object({
2790
- webDynamicRetrievalScore: z3.number()
2808
+ retrievalMetadata: z4.union([
2809
+ z4.object({
2810
+ webDynamicRetrievalScore: z4.number()
2791
2811
  }),
2792
- z3.object({})
2812
+ z4.object({})
2793
2813
  ]).nullish()
2794
2814
  });
2795
- var partialArgSchema = () => z3.object({
2796
- jsonPath: z3.string(),
2797
- stringValue: z3.string().nullish(),
2798
- numberValue: z3.number().nullish(),
2799
- boolValue: z3.boolean().nullish(),
2800
- nullValue: z3.unknown().nullish(),
2801
- willContinue: z3.boolean().nullish()
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 = () => z3.object({
2804
- parts: z3.array(
2805
- z3.union([
2823
+ var getContentSchema = () => z4.object({
2824
+ parts: z4.array(
2825
+ z4.union([
2806
2826
  // note: order matters since text can be fully empty
2807
- z3.object({
2808
- functionCall: z3.object({
2809
- id: z3.string().nullish(),
2810
- name: z3.string().nullish(),
2811
- args: z3.unknown().nullish(),
2812
- partialArgs: z3.array(partialArgSchema()).nullish(),
2813
- willContinue: z3.boolean().nullish()
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: z3.string().nullish()
2835
+ thoughtSignature: z4.string().nullish()
2816
2836
  }),
2817
- z3.object({
2818
- inlineData: z3.object({
2819
- mimeType: z3.string(),
2820
- data: z3.string()
2837
+ z4.object({
2838
+ inlineData: z4.object({
2839
+ mimeType: z4.string(),
2840
+ data: z4.string()
2821
2841
  }),
2822
- thought: z3.boolean().nullish(),
2823
- thoughtSignature: z3.string().nullish()
2842
+ thought: z4.boolean().nullish(),
2843
+ thoughtSignature: z4.string().nullish()
2824
2844
  }),
2825
- z3.object({
2826
- toolCall: z3.object({
2827
- toolType: z3.string(),
2828
- args: z3.unknown().nullish(),
2829
- id: z3.string()
2845
+ z4.object({
2846
+ toolCall: z4.object({
2847
+ toolType: z4.string(),
2848
+ args: z4.unknown().nullish(),
2849
+ id: z4.string()
2830
2850
  }),
2831
- thoughtSignature: z3.string().nullish()
2851
+ thoughtSignature: z4.string().nullish()
2832
2852
  }),
2833
- z3.object({
2834
- toolResponse: z3.object({
2835
- toolType: z3.string(),
2836
- response: z3.unknown().nullish(),
2837
- id: z3.string()
2853
+ z4.object({
2854
+ toolResponse: z4.object({
2855
+ toolType: z4.string(),
2856
+ response: z4.unknown().nullish(),
2857
+ id: z4.string()
2838
2858
  }),
2839
- thoughtSignature: z3.string().nullish()
2859
+ thoughtSignature: z4.string().nullish()
2840
2860
  }),
2841
- z3.object({
2842
- executableCode: z3.object({
2843
- language: z3.string(),
2844
- code: z3.string()
2861
+ z4.object({
2862
+ executableCode: z4.object({
2863
+ language: z4.string(),
2864
+ code: z4.string()
2845
2865
  }).nullish(),
2846
- codeExecutionResult: z3.object({
2847
- outcome: z3.string(),
2848
- output: z3.string().nullish()
2866
+ codeExecutionResult: z4.object({
2867
+ outcome: z4.string(),
2868
+ output: z4.string().nullish()
2849
2869
  }).nullish(),
2850
- text: z3.string().nullish(),
2851
- thought: z3.boolean().nullish(),
2852
- thoughtSignature: z3.string().nullish()
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 = () => z3.object({
2858
- category: z3.string().nullish(),
2859
- probability: z3.string().nullish(),
2860
- probabilityScore: z3.number().nullish(),
2861
- severity: z3.string().nullish(),
2862
- severityScore: z3.number().nullish(),
2863
- blocked: z3.boolean().nullish()
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 = () => z3.array(
2866
- z3.object({
2867
- modality: z3.string(),
2868
- tokenCount: z3.number()
2869
- }).catchall(z3.json())
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 = () => z3.object({
2872
- cachedContentTokenCount: z3.number().nullish(),
2873
- thoughtsTokenCount: z3.number().nullish(),
2874
- promptTokenCount: z3.number().nullish(),
2875
- candidatesTokenCount: z3.number().nullish(),
2876
- toolUsePromptTokenCount: z3.number().nullish(),
2877
- totalTokenCount: z3.number().nullish(),
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: z3.string().nullish(),
2880
- serviceTier: z3.string().nullish(),
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(z3.json());
2887
- var getUrlContextMetadataSchema = () => z3.object({
2888
- urlMetadata: z3.array(
2889
- z3.object({
2890
- retrievedUrl: z3.string(),
2891
- urlRetrievalStatus: z3.string()
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
- z3.object({
2898
- responseId: z3.string().nullish(),
2899
- candidates: z3.array(
2900
- z3.object({
2901
- content: getContentSchema().nullish().or(z3.object({}).strict()),
2902
- finishReason: z3.string().nullish(),
2903
- finishMessage: z3.string().nullish(),
2904
- continuationToken: z3.string().nullish(),
2905
- safetyRatings: z3.array(getSafetyRatingSchema()).nullish(),
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: z3.object({
2912
- blockReason: z3.string().nullish(),
2913
- safetyRatings: z3.array(getSafetyRatingSchema()).nullish()
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
- z3.object({
2921
- responseId: z3.string().nullish(),
2922
- candidates: z3.array(
2923
- z3.object({
2940
+ z4.object({
2941
+ responseId: z4.string().nullish(),
2942
+ candidates: z4.array(
2943
+ z4.object({
2924
2944
  content: getContentSchema().nullish(),
2925
- finishReason: z3.string().nullish(),
2926
- finishMessage: z3.string().nullish(),
2927
- continuationToken: z3.string().nullish(),
2928
- safetyRatings: z3.array(getSafetyRatingSchema()).nullish(),
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: z3.object({
2935
- blockReason: z3.string().nullish(),
2936
- safetyRatings: z3.array(getSafetyRatingSchema()).nullish()
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 z4 } from "zod/v4";
2967
+ import { z as z5 } from "zod/v4";
2948
2968
  var codeExecution = createProviderToolFactoryWithOutputSchema({
2949
2969
  id: "google.code_execution",
2950
- inputSchema: z4.object({
2951
- language: z4.string().describe("The programming language of the code."),
2952
- code: z4.string().describe("The code to be executed.")
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: z4.object({
2955
- outcome: z4.string().describe('The outcome of the execution (e.g., "OUTCOME_OK").'),
2956
- output: z4.string().describe("The output from the code execution.")
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 z5 } from "zod/v4";
2986
+ import { z as z6 } from "zod/v4";
2967
2987
  var enterpriseWebSearch = createProviderToolFactory({
2968
2988
  id: "google.enterprise_web_search",
2969
- inputSchema: lazySchema4(() => zodSchema4(z5.object({})))
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 z6 } from "zod/v4";
2979
- var fileSearchArgsBaseSchema = () => z6.object({
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: z6.array(z6.string()).describe(
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: z6.number().int().positive().describe("The number of file search retrieval chunks to retrieve.").optional(),
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: z6.string().describe(
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 z7 } from "zod/v4";
3029
+ import { z as z8 } from "zod/v4";
3010
3030
  var googleMaps = createProviderToolFactory3({
3011
3031
  id: "google.google_maps",
3012
- inputSchema: lazySchema6(() => zodSchema6(z7.object({})))
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 z8 } from "zod/v4";
3022
- var googleSearchToolArgsBaseSchema = () => z8.object({
3023
- searchTypes: z8.object({
3024
- webSearch: z8.object({}).optional(),
3025
- imageSearch: z8.object({}).optional()
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: z8.object({
3028
- startTime: z8.string(),
3029
- endTime: z8.string()
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 z9 } from "zod/v4";
3068
+ import { z as z10 } from "zod/v4";
3049
3069
  var urlContext = createProviderToolFactory5({
3050
3070
  id: "google.url_context",
3051
- inputSchema: lazySchema8(() => zodSchema8(z9.object({})))
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 z10 } from "zod/v4";
3076
+ import { z as z11 } from "zod/v4";
3057
3077
  var vertexRagStore = createProviderToolFactory6({
3058
3078
  id: "google.vertex_rag_store",
3059
- inputSchema: z10.object({
3060
- ragCorpus: z10.string(),
3061
- topK: z10.number().optional()
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 z11 } from "zod/v4";
4295
- var tokenByModalitySchema = () => z11.object({
4296
- modality: z11.string().nullish(),
4297
- tokens: z11.number().nullish()
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 = () => z11.object({
4300
- total_input_tokens: z11.number().nullish(),
4301
- total_output_tokens: z11.number().nullish(),
4302
- total_thought_tokens: z11.number().nullish(),
4303
- total_cached_tokens: z11.number().nullish(),
4304
- total_tool_use_tokens: z11.number().nullish(),
4305
- total_tokens: z11.number().nullish(),
4306
- input_tokens_by_modality: z11.array(tokenByModalitySchema()).nullish(),
4307
- output_tokens_by_modality: z11.array(tokenByModalitySchema()).nullish(),
4308
- cached_tokens_by_modality: z11.array(tokenByModalitySchema()).nullish(),
4309
- tool_use_tokens_by_modality: z11.array(tokenByModalitySchema()).nullish(),
4310
- grounding_tool_count: z11.array(
4311
- z11.object({
4312
- type: z11.string().nullish(),
4313
- count: z11.number().nullish()
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 = () => z11.enum([
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 = z11.object({
4327
- type: z11.literal("url_citation"),
4328
- url: z11.string().nullish(),
4329
- title: z11.string().nullish(),
4330
- start_index: z11.number().nullish(),
4331
- end_index: z11.number().nullish()
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 = z11.object({
4334
- type: z11.literal("file_citation"),
4335
- file_name: z11.string().nullish(),
4336
- document_uri: z11.string().nullish(),
4337
- url: z11.string().nullish(),
4338
- page_number: z11.number().nullish(),
4339
- media_id: z11.string().nullish(),
4340
- start_index: z11.number().nullish(),
4341
- end_index: z11.number().nullish(),
4342
- custom_metadata: z11.record(z11.string(), z11.unknown()).nullish()
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 = z11.object({
4345
- type: z11.literal("place_citation"),
4346
- name: z11.string().nullish(),
4347
- url: z11.string().nullish(),
4348
- place_id: z11.string().nullish(),
4349
- start_index: z11.number().nullish(),
4350
- end_index: z11.number().nullish()
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 z11.union([
4372
+ return z12.union([
4353
4373
  urlCitation,
4354
4374
  fileCitation,
4355
4375
  placeCitation,
4356
- z11.object({ type: z11.string() }).loose()
4376
+ z12.object({ type: z12.string() }).loose()
4357
4377
  ]);
4358
4378
  };
4359
- var thoughtSummaryItemSchema = () => z11.object({
4360
- type: z11.string(),
4361
- text: z11.string().nullish(),
4362
- data: z11.string().nullish(),
4363
- mime_type: z11.string().nullish()
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 = z11.object({
4367
- type: z11.literal("text"),
4368
- text: z11.string(),
4369
- annotations: z11.array(annotationSchema()).nullish()
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 = z11.object({
4372
- type: z11.literal("image"),
4373
- data: z11.string().nullish(),
4374
- mime_type: z11.string().nullish(),
4375
- resolution: z11.enum(["low", "medium", "high", "ultra_high"]).nullish(),
4376
- uri: z11.string().nullish()
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 = z11.object({
4379
- type: z11.literal("video"),
4380
- data: z11.string().nullish(),
4381
- mime_type: z11.string().nullish(),
4382
- uri: z11.string().nullish()
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 z11.union([
4404
+ return z12.union([
4385
4405
  textContent,
4386
4406
  imageContent,
4387
4407
  videoContent,
4388
- z11.object({ type: z11.string() }).loose()
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 = z11.object({
4409
- type: z11.literal("user_input"),
4410
- content: z11.array(contentBlockSchema()).nullish()
4428
+ const userInputStep = z12.object({
4429
+ type: z12.literal("user_input"),
4430
+ content: z12.array(contentBlockSchema()).nullish()
4411
4431
  }).loose();
4412
- const modelOutputStep = z11.object({
4413
- type: z11.literal("model_output"),
4414
- content: z11.array(contentBlockSchema()).nullish()
4432
+ const modelOutputStep = z12.object({
4433
+ type: z12.literal("model_output"),
4434
+ content: z12.array(contentBlockSchema()).nullish()
4415
4435
  }).loose();
4416
- const functionCallStep = z11.object({
4417
- type: z11.literal("function_call"),
4418
- id: z11.string(),
4419
- name: z11.string(),
4420
- arguments: z11.record(z11.string(), z11.unknown()).nullish(),
4421
- signature: z11.string().nullish()
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 = z11.object({
4424
- type: z11.literal("thought"),
4425
- signature: z11.string().nullish(),
4426
- summary: z11.array(thoughtSummaryItemSchema()).nullish()
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 = z11.object({
4429
- type: z11.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
4430
- id: z11.string(),
4431
- arguments: z11.record(z11.string(), z11.unknown()).nullish(),
4432
- name: z11.string().nullish(),
4433
- server_name: z11.string().nullish(),
4434
- search_type: z11.string().nullish(),
4435
- signature: z11.string().nullish()
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 = z11.object({
4438
- type: z11.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
4439
- call_id: z11.string(),
4440
- result: z11.unknown().nullish(),
4441
- is_error: z11.boolean().nullish(),
4442
- name: z11.string().nullish(),
4443
- server_name: z11.string().nullish(),
4444
- signature: z11.string().nullish()
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 z11.union([
4466
+ return z12.union([
4447
4467
  userInputStep,
4448
4468
  modelOutputStep,
4449
4469
  functionCallStep,
4450
4470
  thoughtStep,
4451
4471
  builtinToolCallStep,
4452
4472
  builtinToolResultStep,
4453
- z11.object({ type: z11.string() }).loose()
4473
+ z12.object({ type: z12.string() }).loose()
4454
4474
  ]);
4455
4475
  };
4456
4476
  var googleInteractionsResponseSchema = lazySchema9(
4457
4477
  () => zodSchema9(
4458
- z11.object({
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: z11.string().nullish(),
4465
- created: z11.string().nullish(),
4466
- updated: z11.string().nullish(),
4484
+ id: z12.string().nullish(),
4485
+ created: z12.string().nullish(),
4486
+ updated: z12.string().nullish(),
4467
4487
  status: interactionStatusSchema(),
4468
- model: z11.string().nullish(),
4469
- agent: z11.string().nullish(),
4470
- steps: z11.array(stepSchema()).nullish(),
4488
+ model: z12.string().nullish(),
4489
+ agent: z12.string().nullish(),
4490
+ steps: z12.array(stepSchema()).nullish(),
4471
4491
  usage: usageSchema2().nullish(),
4472
- service_tier: z11.string().nullish(),
4473
- previous_interaction_id: z11.string().nullish(),
4474
- response_modalities: z11.array(z11.string()).nullish()
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 = z11.object({
4485
- event_type: z11.literal("interaction.created"),
4486
- event_id: z11.string().nullish(),
4487
- interaction: z11.object({
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: z11.string().nullish(),
4493
- created: z11.string().nullish(),
4494
- model: z11.string().nullish(),
4495
- agent: z11.string().nullish(),
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 = z11.object({
4500
- event_type: z11.literal("step.start"),
4501
- event_id: z11.string().nullish(),
4502
- index: z11.number(),
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 = z11.object({
4506
- type: z11.literal("text"),
4507
- text: z11.string()
4525
+ const stepDeltaText = z12.object({
4526
+ type: z12.literal("text"),
4527
+ text: z12.string()
4508
4528
  }).loose();
4509
- const stepDeltaThoughtSummary = z11.object({
4510
- type: z11.literal("thought_summary"),
4529
+ const stepDeltaThoughtSummary = z12.object({
4530
+ type: z12.literal("thought_summary"),
4511
4531
  content: thoughtSummaryItem.nullish()
4512
4532
  }).loose();
4513
- const stepDeltaThoughtSignature = z11.object({
4514
- type: z11.literal("thought_signature"),
4515
- signature: z11.string().nullish()
4533
+ const stepDeltaThoughtSignature = z12.object({
4534
+ type: z12.literal("thought_signature"),
4535
+ signature: z12.string().nullish()
4516
4536
  }).loose();
4517
- const stepDeltaArgumentsDelta = z11.object({
4518
- type: z11.literal("arguments_delta"),
4519
- arguments: z11.string().nullish(),
4520
- id: z11.string().nullish(),
4521
- signature: z11.string().nullish()
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 = z11.object({
4524
- type: z11.enum(["text_annotation_delta", "text_annotation"]),
4525
- annotations: z11.array(annotation).nullish()
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 = z11.object({
4528
- type: z11.literal("image"),
4529
- data: z11.string().nullish(),
4530
- mime_type: z11.string().nullish(),
4531
- resolution: z11.enum(["low", "medium", "high", "ultra_high"]).nullish(),
4532
- uri: z11.string().nullish()
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 = z11.object({
4535
- type: z11.literal("video"),
4536
- data: z11.string().nullish(),
4537
- mime_type: z11.string().nullish(),
4538
- uri: z11.string().nullish()
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 = z11.object({
4541
- type: z11.enum(BUILTIN_TOOL_CALL_STEP_TYPES),
4542
- id: z11.string().nullish(),
4543
- arguments: z11.record(z11.string(), z11.unknown()).nullish(),
4544
- name: z11.string().nullish(),
4545
- server_name: z11.string().nullish(),
4546
- search_type: z11.string().nullish(),
4547
- signature: z11.string().nullish()
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 = z11.object({
4550
- type: z11.enum(BUILTIN_TOOL_RESULT_STEP_TYPES),
4551
- call_id: z11.string().nullish(),
4552
- result: z11.unknown().nullish(),
4553
- is_error: z11.boolean().nullish(),
4554
- name: z11.string().nullish(),
4555
- server_name: z11.string().nullish(),
4556
- signature: z11.string().nullish()
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 = z11.object({ type: z11.string() }).loose();
4559
- const stepDeltaUnion = z11.union([
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 = z11.object({
4572
- event_type: z11.literal("step.delta"),
4573
- event_id: z11.string().nullish(),
4574
- index: z11.number(),
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 = z11.object({
4578
- event_type: z11.literal("step.stop"),
4579
- event_id: z11.string().nullish(),
4580
- index: z11.number()
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 = z11.object({
4583
- event_type: z11.literal("interaction.status_update"),
4584
- event_id: z11.string().nullish(),
4585
- interaction_id: z11.string().nullish(),
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 = z11.object({
4589
- event_type: z11.literal("interaction.in_progress"),
4590
- event_id: z11.string().nullish(),
4591
- interaction_id: z11.string().nullish(),
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 = z11.object({
4595
- event_type: z11.literal("interaction.requires_action"),
4596
- event_id: z11.string().nullish(),
4597
- interaction_id: z11.string().nullish(),
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 = z11.object({
4601
- event_type: z11.literal("interaction.completed"),
4602
- event_id: z11.string().nullish(),
4603
- interaction: z11.object({
4604
- id: z11.string().nullish(),
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: z11.string().nullish()
4627
+ service_tier: z12.string().nullish()
4608
4628
  }).loose()
4609
4629
  }).loose();
4610
- const errorEvent = z11.object({
4611
- event_type: z11.literal("error"),
4612
- event_id: z11.string().nullish(),
4613
- error: z11.object({
4614
- code: z11.string().nullish(),
4615
- message: z11.string().nullish()
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 = z11.object({ event_type: z11.string() }).loose();
4619
- return z11.union([
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 z12 } from "zod/v4";
4660
+ import { z as z13 } from "zod/v4";
4641
4661
  var googleInteractionsLanguageModelOptions = lazySchema10(
4642
4662
  () => zodSchema10(
4643
- z12.object({
4644
- previousInteractionId: z12.string().nullish(),
4645
- store: z12.boolean().nullish(),
4646
- agent: z12.string().nullish(),
4647
- agentConfig: z12.union([
4648
- z12.object({
4649
- type: z12.literal("dynamic")
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
- z12.object({
4652
- type: z12.literal("deep-research"),
4653
- thinkingSummaries: z12.enum(["auto", "none"]).nullish(),
4654
- visualization: z12.enum(["off", "auto"]).nullish(),
4655
- collaborativePlanning: z12.boolean().nullish()
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: z12.enum(["minimal", "low", "medium", "high"]).nullish(),
4659
- thinkingSummaries: z12.enum(["auto", "none"]).nullish(),
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: z12.array(
4670
- z12.union([
4671
- z12.object({
4672
- type: z12.literal("text"),
4673
- mimeType: z12.string().nullish(),
4674
- schema: z12.unknown().nullish()
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
- z12.object({
4677
- type: z12.literal("image"),
4678
- mimeType: z12.string().nullish(),
4679
- aspectRatio: z12.enum([
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: z12.enum(["1K", "2K", "4K", "512"]).nullish()
4715
+ imageSize: z13.enum(["1K", "2K", "4K", "512"]).nullish()
4696
4716
  }).loose(),
4697
- z12.object({
4698
- type: z12.literal("audio"),
4699
- mimeType: z12.string().nullish()
4717
+ z13.object({
4718
+ type: z13.literal("audio"),
4719
+ mimeType: z13.string().nullish()
4700
4720
  }).loose(),
4701
- z12.object({
4702
- type: z12.literal("video"),
4703
- aspectRatio: z12.enum(["16:9", "9:16"]).nullish(),
4704
- resolution: z12.enum(["360p", "720p", "1080p", "4k"]).nullish(),
4705
- duration: z12.string().nullish(),
4706
- delivery: z12.enum(["inline", "uri"]).nullish(),
4707
- gcsUri: z12.string().nullish()
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: z12.object({
4718
- aspectRatio: z12.enum([
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: z12.enum(["1K", "2K", "4K", "512"]).nullish()
4754
+ imageSize: z13.enum(["1K", "2K", "4K", "512"]).nullish()
4735
4755
  }).nullish(),
4736
- mediaResolution: z12.enum(["low", "medium", "high", "ultra_high"]).nullish(),
4737
- responseModalities: z12.array(z12.enum(["text", "image", "audio", "video", "document"])).nullish(),
4738
- serviceTier: z12.enum(["flex", "standard", "priority"]).nullish(),
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: z12.string().nullish(),
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: z12.string().nullish(),
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: z12.string().nullish(),
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: z12.number().int().positive().nullish(),
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: z12.boolean().nullish(),
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: z12.union([
4782
- z12.string(),
4783
- z12.object({
4784
- type: z12.literal("remote"),
4785
- sources: z12.array(
4786
- z12.union([
4787
- z12.object({
4788
- type: z12.literal("gcs"),
4789
- source: z12.string(),
4790
- target: z12.string().nullish()
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
- z12.object({
4793
- type: z12.literal("repository"),
4794
- source: z12.string(),
4795
- target: z12.string().nullish()
4812
+ z13.object({
4813
+ type: z13.literal("repository"),
4814
+ source: z13.string(),
4815
+ target: z13.string().nullish()
4796
4816
  }),
4797
- z12.object({
4798
- type: z12.literal("inline"),
4799
- content: z12.string(),
4800
- target: z12.string()
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: z12.union([
4805
- z12.literal("disabled"),
4806
- z12.object({
4807
- allowlist: z12.array(
4808
- z12.object({
4809
- domain: z12.string(),
4810
- transform: z12.array(z12.record(z12.string(), z12.string())).nullish()
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
  })