@ai-sdk/google-vertex 4.0.219 → 4.0.221

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -3,6 +3,8 @@ import {
3
3
  InvalidArgumentError
4
4
  } from "@ai-sdk/provider";
5
5
  import {
6
+ lazySchema as lazySchema3,
7
+ zodSchema as zodSchema3,
6
8
  combineHeaders,
7
9
  convertToBase64,
8
10
  createJsonResponseHandler,
@@ -13,15 +15,23 @@ import {
13
15
  import { z as z3 } from "zod/v4";
14
16
 
15
17
  // src/google-vertex-error.ts
16
- import { createJsonErrorResponseHandler } from "@ai-sdk/provider-utils";
18
+ import {
19
+ lazySchema,
20
+ zodSchema,
21
+ createJsonErrorResponseHandler
22
+ } from "@ai-sdk/provider-utils";
17
23
  import { z } from "zod/v4";
18
- var googleVertexErrorDataSchema = z.object({
19
- error: z.object({
20
- code: z.number().nullable(),
21
- message: z.string(),
22
- status: z.string()
23
- })
24
- });
24
+ var googleVertexErrorDataSchema = lazySchema(
25
+ () => zodSchema(
26
+ z.object({
27
+ error: z.object({
28
+ code: z.number().nullable(),
29
+ message: z.string(),
30
+ status: z.string()
31
+ })
32
+ })
33
+ )
34
+ );
25
35
  var googleVertexFailedResponseHandler = createJsonErrorResponseHandler(
26
36
  {
27
37
  errorSchema: googleVertexErrorDataSchema,
@@ -30,37 +40,45 @@ var googleVertexFailedResponseHandler = createJsonErrorResponseHandler(
30
40
  );
31
41
 
32
42
  // src/gemini-transcription/google-vertex-gemini-transcription-model-options.ts
43
+ import {
44
+ lazySchema as lazySchema2,
45
+ zodSchema as zodSchema2
46
+ } from "@ai-sdk/provider-utils";
33
47
  import { z as z2 } from "zod/v4";
34
- var googleVertexGeminiTranscriptionModelOptions = z2.object({
35
- /**
36
- * BCP-47 language codes providing hints about the languages present in the
37
- * audio. If omitted or empty, defaults to automatic language detection.
38
- */
39
- languageCodes: z2.array(z2.string()).optional(),
40
- /**
41
- * Custom vocabulary phrases, which bias the speech recognition model
42
- * toward recognizing specific terms.
43
- */
44
- customVocabulary: z2.array(z2.string()).optional(),
45
- /**
46
- * Enables word-level timestamp generation.
47
- */
48
- wordTimestamp: z2.boolean().optional(),
49
- /**
50
- * Enables speaker diarization.
51
- */
52
- diarization: z2.boolean().optional(),
53
- /**
54
- * Transcription output formatting mode.
55
- *
56
- * - `VERBATIM` (default): exact literal transcript preserving filler
57
- * words, repetitions, and false starts.
58
- * - `SMART`: cleans up and structures the transcript in real time —
59
- * disfluency removal, inline self-corrections, structured formatting
60
- * (lists, numbers, dates, paragraph breaks), and grammar/casing polish.
61
- */
62
- mode: z2.enum(["SMART", "VERBATIM"]).optional()
63
- });
48
+ var googleVertexGeminiTranscriptionModelOptions = lazySchema2(
49
+ () => zodSchema2(
50
+ z2.object({
51
+ /**
52
+ * BCP-47 language codes providing hints about the languages present in the
53
+ * audio. If omitted or empty, defaults to automatic language detection.
54
+ */
55
+ languageCodes: z2.array(z2.string()).optional(),
56
+ /**
57
+ * Custom vocabulary phrases, which bias the speech recognition model
58
+ * toward recognizing specific terms.
59
+ */
60
+ customVocabulary: z2.array(z2.string()).optional(),
61
+ /**
62
+ * Enables word-level timestamp generation.
63
+ */
64
+ wordTimestamp: z2.boolean().optional(),
65
+ /**
66
+ * Enables speaker diarization.
67
+ */
68
+ diarization: z2.boolean().optional(),
69
+ /**
70
+ * Transcription output formatting mode.
71
+ *
72
+ * - `VERBATIM` (default): exact literal transcript preserving filler
73
+ * words, repetitions, and false starts.
74
+ * - `SMART`: cleans up and structures the transcript in real time —
75
+ * disfluency removal, inline self-corrections, structured formatting
76
+ * (lists, numbers, dates, paragraph breaks), and grammar/casing polish.
77
+ */
78
+ mode: z2.enum(["SMART", "VERBATIM"]).optional()
79
+ })
80
+ )
81
+ );
64
82
 
65
83
  // src/gemini-transcription/google-vertex-gemini-transcription-model.ts
66
84
  function isLiveTranscriptionModelId(modelId) {
@@ -202,31 +220,35 @@ function parseOffsetSeconds(offset) {
202
220
  const parsed = Number.parseFloat(offset);
203
221
  return Number.isFinite(parsed) ? parsed : void 0;
204
222
  }
205
- var googleVertexGeminiTranscriptionWordSchema = z3.object({
223
+ var googleVertexGeminiTranscriptionWordSchema = () => z3.object({
206
224
  word: z3.string().nullish(),
207
225
  startOffset: z3.string().nullish(),
208
226
  endOffset: z3.string().nullish()
209
227
  });
210
- var googleVertexGeminiTranscriptionResponseSchema = z3.object({
211
- candidates: z3.array(
228
+ var googleVertexGeminiTranscriptionResponseSchema = lazySchema3(
229
+ () => zodSchema3(
212
230
  z3.object({
213
- content: z3.object({
214
- parts: z3.array(
215
- z3.object({
216
- text: z3.string().nullish(),
217
- audioTranscription: z3.object({
218
- text: z3.string().nullish(),
219
- languageCode: z3.string().nullish(),
220
- speakerLabel: z3.string().nullish(),
221
- words: z3.array(googleVertexGeminiTranscriptionWordSchema).nullish()
222
- }).nullish()
223
- })
224
- ).nullish()
225
- }).nullish()
231
+ candidates: z3.array(
232
+ z3.object({
233
+ content: z3.object({
234
+ parts: z3.array(
235
+ z3.object({
236
+ text: z3.string().nullish(),
237
+ audioTranscription: z3.object({
238
+ text: z3.string().nullish(),
239
+ languageCode: z3.string().nullish(),
240
+ speakerLabel: z3.string().nullish(),
241
+ words: z3.array(googleVertexGeminiTranscriptionWordSchema()).nullish()
242
+ }).nullish()
243
+ })
244
+ ).nullish()
245
+ }).nullish()
246
+ })
247
+ ).nullish(),
248
+ usageMetadata: z3.record(z3.string(), z3.unknown()).nullish()
226
249
  })
227
- ).nullish(),
228
- usageMetadata: z3.record(z3.string(), z3.unknown()).nullish()
229
- });
250
+ )
251
+ );
230
252
 
231
253
  // src/google-vertex-provider-node.ts
232
254
  import { loadOptionalSetting as loadOptionalSetting2, resolve as resolve7 } from "@ai-sdk/provider-utils";
@@ -262,13 +284,15 @@ import {
262
284
  } from "@ai-sdk/provider-utils";
263
285
 
264
286
  // src/version.ts
265
- var VERSION = true ? "4.0.219" : "0.0.0-test";
287
+ var VERSION = true ? "4.0.221" : "0.0.0-test";
266
288
 
267
289
  // src/google-vertex-embedding-model.ts
268
290
  import {
269
291
  TooManyEmbeddingValuesForCallError
270
292
  } from "@ai-sdk/provider";
271
293
  import {
294
+ lazySchema as lazySchema5,
295
+ zodSchema as zodSchema5,
272
296
  combineHeaders as combineHeaders2,
273
297
  createJsonResponseHandler as createJsonResponseHandler2,
274
298
  postJsonToApi as postJsonToApi2,
@@ -278,47 +302,55 @@ import {
278
302
  import { z as z5 } from "zod/v4";
279
303
 
280
304
  // src/google-vertex-embedding-options.ts
305
+ import {
306
+ lazySchema as lazySchema4,
307
+ zodSchema as zodSchema4
308
+ } from "@ai-sdk/provider-utils";
281
309
  import { z as z4 } from "zod/v4";
282
- var googleVertexEmbeddingModelOptions = z4.object({
283
- /**
284
- * Optional. Optional reduced dimension for the output embedding.
285
- * If set, excessive values in the output embedding are truncated from the end.
286
- */
287
- outputDimensionality: z4.number().optional(),
288
- /**
289
- * Optional. Specifies the task type for generating embeddings.
290
- * Supported task types:
291
- * - SEMANTIC_SIMILARITY: Optimized for text similarity.
292
- * - CLASSIFICATION: Optimized for text classification.
293
- * - CLUSTERING: Optimized for clustering texts based on similarity.
294
- * - RETRIEVAL_DOCUMENT: Optimized for document retrieval.
295
- * - RETRIEVAL_QUERY: Optimized for query-based retrieval.
296
- * - QUESTION_ANSWERING: Optimized for answering questions.
297
- * - FACT_VERIFICATION: Optimized for verifying factual information.
298
- * - CODE_RETRIEVAL_QUERY: Optimized for retrieving code blocks based on natural language queries.
299
- */
300
- taskType: z4.enum([
301
- "SEMANTIC_SIMILARITY",
302
- "CLASSIFICATION",
303
- "CLUSTERING",
304
- "RETRIEVAL_DOCUMENT",
305
- "RETRIEVAL_QUERY",
306
- "QUESTION_ANSWERING",
307
- "FACT_VERIFICATION",
308
- "CODE_RETRIEVAL_QUERY"
309
- ]).optional(),
310
- /**
311
- * Optional. The title of the document being embedded.
312
- * Only valid when task_type is set to 'RETRIEVAL_DOCUMENT'.
313
- * Helps the model produce better embeddings by providing additional context.
314
- */
315
- title: z4.string().optional(),
316
- /**
317
- * Optional. When set to true, input text will be truncated. When set to false,
318
- * an error is returned if the input text is longer than the maximum length supported by the model. Defaults to true.
319
- */
320
- autoTruncate: z4.boolean().optional()
321
- });
310
+ var googleVertexEmbeddingModelOptions = lazySchema4(
311
+ () => zodSchema4(
312
+ z4.object({
313
+ /**
314
+ * Optional. Optional reduced dimension for the output embedding.
315
+ * If set, excessive values in the output embedding are truncated from the end.
316
+ */
317
+ outputDimensionality: z4.number().optional(),
318
+ /**
319
+ * Optional. Specifies the task type for generating embeddings.
320
+ * Supported task types:
321
+ * - SEMANTIC_SIMILARITY: Optimized for text similarity.
322
+ * - CLASSIFICATION: Optimized for text classification.
323
+ * - CLUSTERING: Optimized for clustering texts based on similarity.
324
+ * - RETRIEVAL_DOCUMENT: Optimized for document retrieval.
325
+ * - RETRIEVAL_QUERY: Optimized for query-based retrieval.
326
+ * - QUESTION_ANSWERING: Optimized for answering questions.
327
+ * - FACT_VERIFICATION: Optimized for verifying factual information.
328
+ * - CODE_RETRIEVAL_QUERY: Optimized for retrieving code blocks based on natural language queries.
329
+ */
330
+ taskType: z4.enum([
331
+ "SEMANTIC_SIMILARITY",
332
+ "CLASSIFICATION",
333
+ "CLUSTERING",
334
+ "RETRIEVAL_DOCUMENT",
335
+ "RETRIEVAL_QUERY",
336
+ "QUESTION_ANSWERING",
337
+ "FACT_VERIFICATION",
338
+ "CODE_RETRIEVAL_QUERY"
339
+ ]).optional(),
340
+ /**
341
+ * Optional. The title of the document being embedded.
342
+ * Only valid when task_type is set to 'RETRIEVAL_DOCUMENT'.
343
+ * Helps the model produce better embeddings by providing additional context.
344
+ */
345
+ title: z4.string().optional(),
346
+ /**
347
+ * Optional. When set to true, input text will be truncated. When set to false,
348
+ * an error is returned if the input text is longer than the maximum length supported by the model. Defaults to true.
349
+ */
350
+ autoTruncate: z4.boolean().optional()
351
+ })
352
+ )
353
+ );
322
354
 
323
355
  // src/google-vertex-embedding-model.ts
324
356
  var GoogleVertexEmbeddingModel = class {
@@ -440,26 +472,34 @@ var GoogleVertexEmbeddingModel = class {
440
472
  };
441
473
  }
442
474
  };
443
- var googleVertexTextEmbeddingResponseSchema = z5.object({
444
- predictions: z5.array(
475
+ var googleVertexTextEmbeddingResponseSchema = lazySchema5(
476
+ () => zodSchema5(
445
477
  z5.object({
446
- embeddings: z5.object({
447
- values: z5.array(z5.number()),
448
- statistics: z5.object({
449
- token_count: z5.number()
478
+ predictions: z5.array(
479
+ z5.object({
480
+ embeddings: z5.object({
481
+ values: z5.array(z5.number()),
482
+ statistics: z5.object({
483
+ token_count: z5.number()
484
+ })
485
+ })
450
486
  })
451
- })
487
+ )
452
488
  })
453
489
  )
454
- });
455
- var googleVertexEmbedContentResponseSchema = z5.object({
456
- embedding: z5.object({
457
- values: z5.array(z5.number())
458
- }),
459
- usageMetadata: z5.object({
460
- promptTokenCount: z5.number().nullish()
461
- }).nullish()
462
- });
490
+ );
491
+ var googleVertexEmbedContentResponseSchema = lazySchema5(
492
+ () => zodSchema5(
493
+ z5.object({
494
+ embedding: z5.object({
495
+ values: z5.array(z5.number())
496
+ }),
497
+ usageMetadata: z5.object({
498
+ promptTokenCount: z5.number().nullish()
499
+ }).nullish()
500
+ })
501
+ )
502
+ );
463
503
  function usesEmbedContentEndpoint(modelId) {
464
504
  return modelId === "gemini-embedding-2" || modelId === "gemini-embedding-2-preview";
465
505
  }
@@ -467,6 +507,8 @@ function usesEmbedContentEndpoint(modelId) {
467
507
  // src/google-vertex-image-model.ts
468
508
  import { GoogleGenerativeAILanguageModel } from "@ai-sdk/google/internal";
469
509
  import {
510
+ lazySchema as lazySchema6,
511
+ zodSchema as zodSchema6,
470
512
  combineHeaders as combineHeaders3,
471
513
  convertToBase64 as convertToBase642,
472
514
  convertUint8ArrayToBase64,
@@ -733,74 +775,82 @@ var GoogleVertexImageModel = class {
733
775
  function isGeminiModel(modelId) {
734
776
  return modelId.startsWith("gemini-");
735
777
  }
736
- var vertexImageResponseSchema = z6.object({
737
- predictions: z6.array(
738
- z6.union([
739
- z6.object({
740
- bytesBase64Encoded: z6.string(),
741
- mimeType: z6.string(),
742
- prompt: z6.string().nullish()
743
- }),
744
- z6.object({ raiFilteredReason: z6.string() })
745
- ])
746
- ).nullish()
747
- });
748
- var googleVertexImageModelOptionsSchema = z6.object({
749
- negativePrompt: z6.string().nullish(),
750
- personGeneration: z6.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
751
- safetySetting: z6.enum([
752
- "block_low_and_above",
753
- "block_medium_and_above",
754
- "block_only_high",
755
- "block_none"
756
- ]).nullish(),
757
- addWatermark: z6.boolean().nullish(),
758
- storageUri: z6.string().nullish(),
759
- sampleImageSize: z6.enum(["1K", "2K"]).nullish(),
760
- /**
761
- * Configuration for image editing operations
762
- */
763
- edit: z6.object({
764
- /**
765
- * An integer that represents the number of sampling steps.
766
- * A higher value offers better image quality, a lower value offers better latency.
767
- * Try 35 steps to start. If the quality doesn't meet your requirements,
768
- * increase the value towards an upper limit of 75.
769
- */
770
- baseSteps: z6.number().nullish(),
771
- // Edit mode options
772
- // https://cloud.google.com/vertex-ai/generative-ai/docs/image/edit-insert-objects
773
- mode: z6.enum([
774
- "EDIT_MODE_INPAINT_INSERTION",
775
- "EDIT_MODE_INPAINT_REMOVAL",
776
- "EDIT_MODE_OUTPAINT",
777
- "EDIT_MODE_CONTROLLED_EDITING",
778
- "EDIT_MODE_PRODUCT_IMAGE",
779
- "EDIT_MODE_BGSWAP"
780
- ]).nullish(),
781
- /**
782
- * The mask mode to use.
783
- * - `MASK_MODE_DEFAULT` - Default value for mask mode.
784
- * - `MASK_MODE_USER_PROVIDED` - User provided mask. No segmentation needed.
785
- * - `MASK_MODE_DETECTION_BOX` - Mask from detected bounding boxes.
786
- * - `MASK_MODE_CLOTHING_AREA` - Masks from segmenting the clothing area with open-vocab segmentation.
787
- * - `MASK_MODE_PARSED_PERSON` - Masks from segmenting the person body and clothing using the person-parsing model.
788
- */
789
- maskMode: z6.enum([
790
- "MASK_MODE_DEFAULT",
791
- "MASK_MODE_USER_PROVIDED",
792
- "MASK_MODE_DETECTION_BOX",
793
- "MASK_MODE_CLOTHING_AREA",
794
- "MASK_MODE_PARSED_PERSON"
795
- ]).nullish(),
796
- /**
797
- * Optional. A float value between 0 and 1, inclusive, that represents the
798
- * percentage of the image width to grow the mask by. Using dilation helps
799
- * compensate for imprecise masks. We recommend a value of 0.01.
800
- */
801
- maskDilation: z6.number().nullish()
802
- }).nullish()
803
- });
778
+ var vertexImageResponseSchema = lazySchema6(
779
+ () => zodSchema6(
780
+ z6.object({
781
+ predictions: z6.array(
782
+ z6.union([
783
+ z6.object({
784
+ bytesBase64Encoded: z6.string(),
785
+ mimeType: z6.string(),
786
+ prompt: z6.string().nullish()
787
+ }),
788
+ z6.object({ raiFilteredReason: z6.string() })
789
+ ])
790
+ ).nullish()
791
+ })
792
+ )
793
+ );
794
+ var googleVertexImageModelOptionsSchema = lazySchema6(
795
+ () => zodSchema6(
796
+ z6.object({
797
+ negativePrompt: z6.string().nullish(),
798
+ personGeneration: z6.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
799
+ safetySetting: z6.enum([
800
+ "block_low_and_above",
801
+ "block_medium_and_above",
802
+ "block_only_high",
803
+ "block_none"
804
+ ]).nullish(),
805
+ addWatermark: z6.boolean().nullish(),
806
+ storageUri: z6.string().nullish(),
807
+ sampleImageSize: z6.enum(["1K", "2K"]).nullish(),
808
+ /**
809
+ * Configuration for image editing operations
810
+ */
811
+ edit: z6.object({
812
+ /**
813
+ * An integer that represents the number of sampling steps.
814
+ * A higher value offers better image quality, a lower value offers better latency.
815
+ * Try 35 steps to start. If the quality doesn't meet your requirements,
816
+ * increase the value towards an upper limit of 75.
817
+ */
818
+ baseSteps: z6.number().nullish(),
819
+ // Edit mode options
820
+ // https://cloud.google.com/vertex-ai/generative-ai/docs/image/edit-insert-objects
821
+ mode: z6.enum([
822
+ "EDIT_MODE_INPAINT_INSERTION",
823
+ "EDIT_MODE_INPAINT_REMOVAL",
824
+ "EDIT_MODE_OUTPAINT",
825
+ "EDIT_MODE_CONTROLLED_EDITING",
826
+ "EDIT_MODE_PRODUCT_IMAGE",
827
+ "EDIT_MODE_BGSWAP"
828
+ ]).nullish(),
829
+ /**
830
+ * The mask mode to use.
831
+ * - `MASK_MODE_DEFAULT` - Default value for mask mode.
832
+ * - `MASK_MODE_USER_PROVIDED` - User provided mask. No segmentation needed.
833
+ * - `MASK_MODE_DETECTION_BOX` - Mask from detected bounding boxes.
834
+ * - `MASK_MODE_CLOTHING_AREA` - Masks from segmenting the clothing area with open-vocab segmentation.
835
+ * - `MASK_MODE_PARSED_PERSON` - Masks from segmenting the person body and clothing using the person-parsing model.
836
+ */
837
+ maskMode: z6.enum([
838
+ "MASK_MODE_DEFAULT",
839
+ "MASK_MODE_USER_PROVIDED",
840
+ "MASK_MODE_DETECTION_BOX",
841
+ "MASK_MODE_CLOTHING_AREA",
842
+ "MASK_MODE_PARSED_PERSON"
843
+ ]).nullish(),
844
+ /**
845
+ * Optional. A float value between 0 and 1, inclusive, that represents the
846
+ * percentage of the image width to grow the mask by. Using dilation helps
847
+ * compensate for imprecise masks. We recommend a value of 0.01.
848
+ */
849
+ maskDilation: z6.number().nullish()
850
+ }).nullish()
851
+ })
852
+ )
853
+ );
804
854
  function getBase64Data(file) {
805
855
  if (file.type === "url") {
806
856
  throw new Error(
@@ -827,6 +877,8 @@ var googleVertexTools = {
827
877
 
828
878
  // src/google-vertex-transcription-model.ts
829
879
  import {
880
+ lazySchema as lazySchema8,
881
+ zodSchema as zodSchema8,
830
882
  combineHeaders as combineHeaders4,
831
883
  convertUint8ArrayToBase64 as convertUint8ArrayToBase642,
832
884
  createJsonResponseHandler as createJsonResponseHandler4,
@@ -837,36 +889,44 @@ import {
837
889
  import { z as z8 } from "zod/v4";
838
890
 
839
891
  // src/google-vertex-transcription-model-options.ts
892
+ import {
893
+ lazySchema as lazySchema7,
894
+ zodSchema as zodSchema7
895
+ } from "@ai-sdk/provider-utils";
840
896
  import { z as z7 } from "zod/v4";
841
- var googleVertexTranscriptionProviderOptionsSchema = z7.object({
842
- /**
843
- * BCP-47 language codes to recognize (e.g. `['en-US']`), or `['auto']` to let
844
- * Chirp auto-detect the spoken language. Defaults to `['auto']`. For
845
- * `telephony`, pass a supported explicit language code.
846
- */
847
- languageCodes: z7.array(z7.string()).optional(),
848
- /**
849
- * Whether to add punctuation to the transcript. Defaults to `true`.
850
- */
851
- enableAutomaticPunctuation: z7.boolean().optional(),
852
- /**
853
- * Whether to include word-level timestamps. Defaults to `true` so the
854
- * transcription result can include segments.
855
- *
856
- * Enabling word-level timestamps can reduce transcription quality and speed
857
- * for Chirp models.
858
- */
859
- enableWordTimeOffsets: z7.boolean().optional(),
860
- /**
861
- * The Cloud Speech-to-Text region for the request (e.g. `'us'`, `'eu'`,
862
- * `'us-central1'`). Defaults to the provider `location`.
863
- *
864
- * Note: Speech-to-Text regions differ from Vertex AI regions. Chirp is only
865
- * available in specific Speech-to-Text regions and is not available in the
866
- * `global` location.
867
- */
868
- region: z7.string().optional()
869
- });
897
+ var googleVertexTranscriptionProviderOptionsSchema = lazySchema7(
898
+ () => zodSchema7(
899
+ z7.object({
900
+ /**
901
+ * BCP-47 language codes to recognize (e.g. `['en-US']`), or `['auto']` to let
902
+ * Chirp auto-detect the spoken language. Defaults to `['auto']`. For
903
+ * `telephony`, pass a supported explicit language code.
904
+ */
905
+ languageCodes: z7.array(z7.string()).optional(),
906
+ /**
907
+ * Whether to add punctuation to the transcript. Defaults to `true`.
908
+ */
909
+ enableAutomaticPunctuation: z7.boolean().optional(),
910
+ /**
911
+ * Whether to include word-level timestamps. Defaults to `true` so the
912
+ * transcription result can include segments.
913
+ *
914
+ * Enabling word-level timestamps can reduce transcription quality and speed
915
+ * for Chirp models.
916
+ */
917
+ enableWordTimeOffsets: z7.boolean().optional(),
918
+ /**
919
+ * The Cloud Speech-to-Text region for the request (e.g. `'us'`, `'eu'`,
920
+ * `'us-central1'`). Defaults to the provider `location`.
921
+ *
922
+ * Note: Speech-to-Text regions differ from Vertex AI regions. Chirp is only
923
+ * available in specific Speech-to-Text regions and is not available in the
924
+ * `global` location.
925
+ */
926
+ region: z7.string().optional()
927
+ })
928
+ )
929
+ );
870
930
 
871
931
  // src/google-vertex-transcription-model.ts
872
932
  function parseDurationSeconds(value) {
@@ -981,28 +1041,32 @@ var GoogleVertexTranscriptionModel = class {
981
1041
  };
982
1042
  }
983
1043
  };
984
- var googleVertexTranscriptionResponseSchema = z8.object({
985
- results: z8.array(
1044
+ var googleVertexTranscriptionResponseSchema = lazySchema8(
1045
+ () => zodSchema8(
986
1046
  z8.object({
987
- alternatives: z8.array(
1047
+ results: z8.array(
988
1048
  z8.object({
989
- transcript: z8.string().nullish(),
990
- words: z8.array(
1049
+ alternatives: z8.array(
991
1050
  z8.object({
992
- word: z8.string().nullish(),
993
- startOffset: z8.string().nullish(),
994
- endOffset: z8.string().nullish()
1051
+ transcript: z8.string().nullish(),
1052
+ words: z8.array(
1053
+ z8.object({
1054
+ word: z8.string().nullish(),
1055
+ startOffset: z8.string().nullish(),
1056
+ endOffset: z8.string().nullish()
1057
+ })
1058
+ ).nullish()
995
1059
  })
996
- ).nullish()
1060
+ ).nullish(),
1061
+ languageCode: z8.string().nullish()
997
1062
  })
998
1063
  ).nullish(),
999
- languageCode: z8.string().nullish()
1064
+ metadata: z8.object({
1065
+ totalBilledDuration: z8.string().nullish()
1066
+ }).nullish()
1000
1067
  })
1001
- ).nullish(),
1002
- metadata: z8.object({
1003
- totalBilledDuration: z8.string().nullish()
1004
- }).nullish()
1005
- });
1068
+ )
1069
+ );
1006
1070
 
1007
1071
  // src/google-vertex-video-model.ts
1008
1072
  import {
@@ -1013,11 +1077,11 @@ import {
1013
1077
  convertUint8ArrayToBase64 as convertUint8ArrayToBase643,
1014
1078
  createJsonResponseHandler as createJsonResponseHandler5,
1015
1079
  delay,
1016
- lazySchema,
1080
+ lazySchema as lazySchema9,
1017
1081
  parseProviderOptions as parseProviderOptions5,
1018
1082
  postJsonToApi as postJsonToApi5,
1019
1083
  resolve as resolve5,
1020
- zodSchema
1084
+ zodSchema as zodSchema9
1021
1085
  } from "@ai-sdk/provider-utils";
1022
1086
  import { z as z9 } from "zod/v4";
1023
1087
  function getFirstFrameImage(options) {
@@ -1282,27 +1346,31 @@ var GoogleVertexVideoModel = class {
1282
1346
  };
1283
1347
  }
1284
1348
  };
1285
- var vertexOperationSchema = z9.object({
1286
- name: z9.string().nullish(),
1287
- done: z9.boolean().nullish(),
1288
- error: z9.object({
1289
- code: z9.number().nullish(),
1290
- message: z9.string(),
1291
- status: z9.string().nullish()
1292
- }).nullish(),
1293
- response: z9.object({
1294
- videos: z9.array(
1295
- z9.object({
1296
- bytesBase64Encoded: z9.string().nullish(),
1297
- gcsUri: z9.string().nullish(),
1298
- mimeType: z9.string().nullish()
1299
- })
1300
- ).nullish(),
1301
- raiMediaFilteredCount: z9.number().nullish()
1302
- }).nullish()
1303
- });
1304
- var googleVertexVideoModelOptionsSchema = lazySchema(
1305
- () => zodSchema(
1349
+ var vertexOperationSchema = lazySchema9(
1350
+ () => zodSchema9(
1351
+ z9.object({
1352
+ name: z9.string().nullish(),
1353
+ done: z9.boolean().nullish(),
1354
+ error: z9.object({
1355
+ code: z9.number().nullish(),
1356
+ message: z9.string(),
1357
+ status: z9.string().nullish()
1358
+ }).nullish(),
1359
+ response: z9.object({
1360
+ videos: z9.array(
1361
+ z9.object({
1362
+ bytesBase64Encoded: z9.string().nullish(),
1363
+ gcsUri: z9.string().nullish(),
1364
+ mimeType: z9.string().nullish()
1365
+ })
1366
+ ).nullish(),
1367
+ raiMediaFilteredCount: z9.number().nullish()
1368
+ }).nullish()
1369
+ })
1370
+ )
1371
+ );
1372
+ var googleVertexVideoModelOptionsSchema = lazySchema9(
1373
+ () => zodSchema9(
1306
1374
  z9.object({
1307
1375
  pollIntervalMs: z9.number().positive().nullish(),
1308
1376
  pollTimeoutMs: z9.number().positive().nullish(),