@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/CHANGELOG.md +23 -0
- package/dist/anthropic/edge/index.js +1 -1
- package/dist/anthropic/edge/index.mjs +1 -1
- package/dist/edge/index.js +358 -311
- package/dist/edge/index.js.map +1 -1
- package/dist/edge/index.mjs +317 -249
- package/dist/edge/index.mjs.map +1 -1
- package/dist/index.d.mts +39 -77
- package/dist/index.d.ts +39 -77
- package/dist/index.js +352 -305
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +317 -249
- package/dist/index.mjs.map +1 -1
- package/dist/maas/edge/index.js +1 -1
- package/dist/maas/edge/index.mjs +1 -1
- package/dist/xai/edge/index.js +1 -1
- package/dist/xai/edge/index.mjs +1 -1
- package/package.json +5 -5
- package/src/gemini-transcription/google-vertex-gemini-transcription-model-options.ts +40 -31
- package/src/gemini-transcription/google-vertex-gemini-transcription-model.ts +40 -33
- package/src/google-vertex-embedding-model.ts +28 -18
- package/src/google-vertex-embedding-options.ts +52 -43
- package/src/google-vertex-error.ts +20 -9
- package/src/google-vertex-image-model.ts +90 -79
- package/src/google-vertex-transcription-model-options.ts +39 -30
- package/src/google-vertex-transcription-model.ts +36 -30
- package/src/google-vertex-video-model.ts +28 -24
package/dist/edge/index.mjs
CHANGED
|
@@ -17,13 +17,15 @@ import {
|
|
|
17
17
|
} from "@ai-sdk/provider-utils";
|
|
18
18
|
|
|
19
19
|
// src/version.ts
|
|
20
|
-
var VERSION = true ? "4.0.
|
|
20
|
+
var VERSION = true ? "4.0.221" : "0.0.0-test";
|
|
21
21
|
|
|
22
22
|
// src/google-vertex-embedding-model.ts
|
|
23
23
|
import {
|
|
24
24
|
TooManyEmbeddingValuesForCallError
|
|
25
25
|
} from "@ai-sdk/provider";
|
|
26
26
|
import {
|
|
27
|
+
lazySchema as lazySchema3,
|
|
28
|
+
zodSchema as zodSchema3,
|
|
27
29
|
combineHeaders,
|
|
28
30
|
createJsonResponseHandler,
|
|
29
31
|
postJsonToApi,
|
|
@@ -33,15 +35,23 @@ import {
|
|
|
33
35
|
import { z as z3 } from "zod/v4";
|
|
34
36
|
|
|
35
37
|
// src/google-vertex-error.ts
|
|
36
|
-
import {
|
|
38
|
+
import {
|
|
39
|
+
lazySchema,
|
|
40
|
+
zodSchema,
|
|
41
|
+
createJsonErrorResponseHandler
|
|
42
|
+
} from "@ai-sdk/provider-utils";
|
|
37
43
|
import { z } from "zod/v4";
|
|
38
|
-
var googleVertexErrorDataSchema =
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
44
|
+
var googleVertexErrorDataSchema = lazySchema(
|
|
45
|
+
() => zodSchema(
|
|
46
|
+
z.object({
|
|
47
|
+
error: z.object({
|
|
48
|
+
code: z.number().nullable(),
|
|
49
|
+
message: z.string(),
|
|
50
|
+
status: z.string()
|
|
51
|
+
})
|
|
52
|
+
})
|
|
53
|
+
)
|
|
54
|
+
);
|
|
45
55
|
var googleVertexFailedResponseHandler = createJsonErrorResponseHandler(
|
|
46
56
|
{
|
|
47
57
|
errorSchema: googleVertexErrorDataSchema,
|
|
@@ -50,47 +60,55 @@ var googleVertexFailedResponseHandler = createJsonErrorResponseHandler(
|
|
|
50
60
|
);
|
|
51
61
|
|
|
52
62
|
// src/google-vertex-embedding-options.ts
|
|
63
|
+
import {
|
|
64
|
+
lazySchema as lazySchema2,
|
|
65
|
+
zodSchema as zodSchema2
|
|
66
|
+
} from "@ai-sdk/provider-utils";
|
|
53
67
|
import { z as z2 } from "zod/v4";
|
|
54
|
-
var googleVertexEmbeddingModelOptions =
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
68
|
+
var googleVertexEmbeddingModelOptions = lazySchema2(
|
|
69
|
+
() => zodSchema2(
|
|
70
|
+
z2.object({
|
|
71
|
+
/**
|
|
72
|
+
* Optional. Optional reduced dimension for the output embedding.
|
|
73
|
+
* If set, excessive values in the output embedding are truncated from the end.
|
|
74
|
+
*/
|
|
75
|
+
outputDimensionality: z2.number().optional(),
|
|
76
|
+
/**
|
|
77
|
+
* Optional. Specifies the task type for generating embeddings.
|
|
78
|
+
* Supported task types:
|
|
79
|
+
* - SEMANTIC_SIMILARITY: Optimized for text similarity.
|
|
80
|
+
* - CLASSIFICATION: Optimized for text classification.
|
|
81
|
+
* - CLUSTERING: Optimized for clustering texts based on similarity.
|
|
82
|
+
* - RETRIEVAL_DOCUMENT: Optimized for document retrieval.
|
|
83
|
+
* - RETRIEVAL_QUERY: Optimized for query-based retrieval.
|
|
84
|
+
* - QUESTION_ANSWERING: Optimized for answering questions.
|
|
85
|
+
* - FACT_VERIFICATION: Optimized for verifying factual information.
|
|
86
|
+
* - CODE_RETRIEVAL_QUERY: Optimized for retrieving code blocks based on natural language queries.
|
|
87
|
+
*/
|
|
88
|
+
taskType: z2.enum([
|
|
89
|
+
"SEMANTIC_SIMILARITY",
|
|
90
|
+
"CLASSIFICATION",
|
|
91
|
+
"CLUSTERING",
|
|
92
|
+
"RETRIEVAL_DOCUMENT",
|
|
93
|
+
"RETRIEVAL_QUERY",
|
|
94
|
+
"QUESTION_ANSWERING",
|
|
95
|
+
"FACT_VERIFICATION",
|
|
96
|
+
"CODE_RETRIEVAL_QUERY"
|
|
97
|
+
]).optional(),
|
|
98
|
+
/**
|
|
99
|
+
* Optional. The title of the document being embedded.
|
|
100
|
+
* Only valid when task_type is set to 'RETRIEVAL_DOCUMENT'.
|
|
101
|
+
* Helps the model produce better embeddings by providing additional context.
|
|
102
|
+
*/
|
|
103
|
+
title: z2.string().optional(),
|
|
104
|
+
/**
|
|
105
|
+
* Optional. When set to true, input text will be truncated. When set to false,
|
|
106
|
+
* an error is returned if the input text is longer than the maximum length supported by the model. Defaults to true.
|
|
107
|
+
*/
|
|
108
|
+
autoTruncate: z2.boolean().optional()
|
|
109
|
+
})
|
|
110
|
+
)
|
|
111
|
+
);
|
|
94
112
|
|
|
95
113
|
// src/google-vertex-embedding-model.ts
|
|
96
114
|
var GoogleVertexEmbeddingModel = class {
|
|
@@ -212,26 +230,34 @@ var GoogleVertexEmbeddingModel = class {
|
|
|
212
230
|
};
|
|
213
231
|
}
|
|
214
232
|
};
|
|
215
|
-
var googleVertexTextEmbeddingResponseSchema =
|
|
216
|
-
|
|
233
|
+
var googleVertexTextEmbeddingResponseSchema = lazySchema3(
|
|
234
|
+
() => zodSchema3(
|
|
217
235
|
z3.object({
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
236
|
+
predictions: z3.array(
|
|
237
|
+
z3.object({
|
|
238
|
+
embeddings: z3.object({
|
|
239
|
+
values: z3.array(z3.number()),
|
|
240
|
+
statistics: z3.object({
|
|
241
|
+
token_count: z3.number()
|
|
242
|
+
})
|
|
243
|
+
})
|
|
222
244
|
})
|
|
223
|
-
|
|
245
|
+
)
|
|
224
246
|
})
|
|
225
247
|
)
|
|
226
|
-
|
|
227
|
-
var googleVertexEmbedContentResponseSchema =
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
248
|
+
);
|
|
249
|
+
var googleVertexEmbedContentResponseSchema = lazySchema3(
|
|
250
|
+
() => zodSchema3(
|
|
251
|
+
z3.object({
|
|
252
|
+
embedding: z3.object({
|
|
253
|
+
values: z3.array(z3.number())
|
|
254
|
+
}),
|
|
255
|
+
usageMetadata: z3.object({
|
|
256
|
+
promptTokenCount: z3.number().nullish()
|
|
257
|
+
}).nullish()
|
|
258
|
+
})
|
|
259
|
+
)
|
|
260
|
+
);
|
|
235
261
|
function usesEmbedContentEndpoint(modelId) {
|
|
236
262
|
return modelId === "gemini-embedding-2" || modelId === "gemini-embedding-2-preview";
|
|
237
263
|
}
|
|
@@ -239,6 +265,8 @@ function usesEmbedContentEndpoint(modelId) {
|
|
|
239
265
|
// src/google-vertex-image-model.ts
|
|
240
266
|
import { GoogleGenerativeAILanguageModel } from "@ai-sdk/google/internal";
|
|
241
267
|
import {
|
|
268
|
+
lazySchema as lazySchema4,
|
|
269
|
+
zodSchema as zodSchema4,
|
|
242
270
|
combineHeaders as combineHeaders2,
|
|
243
271
|
convertToBase64,
|
|
244
272
|
convertUint8ArrayToBase64,
|
|
@@ -505,74 +533,82 @@ var GoogleVertexImageModel = class {
|
|
|
505
533
|
function isGeminiModel(modelId) {
|
|
506
534
|
return modelId.startsWith("gemini-");
|
|
507
535
|
}
|
|
508
|
-
var vertexImageResponseSchema =
|
|
509
|
-
|
|
510
|
-
z4.
|
|
511
|
-
z4.
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
536
|
+
var vertexImageResponseSchema = lazySchema4(
|
|
537
|
+
() => zodSchema4(
|
|
538
|
+
z4.object({
|
|
539
|
+
predictions: z4.array(
|
|
540
|
+
z4.union([
|
|
541
|
+
z4.object({
|
|
542
|
+
bytesBase64Encoded: z4.string(),
|
|
543
|
+
mimeType: z4.string(),
|
|
544
|
+
prompt: z4.string().nullish()
|
|
545
|
+
}),
|
|
546
|
+
z4.object({ raiFilteredReason: z4.string() })
|
|
547
|
+
])
|
|
548
|
+
).nullish()
|
|
549
|
+
})
|
|
550
|
+
)
|
|
551
|
+
);
|
|
552
|
+
var googleVertexImageModelOptionsSchema = lazySchema4(
|
|
553
|
+
() => zodSchema4(
|
|
554
|
+
z4.object({
|
|
555
|
+
negativePrompt: z4.string().nullish(),
|
|
556
|
+
personGeneration: z4.enum(["dont_allow", "allow_adult", "allow_all"]).nullish(),
|
|
557
|
+
safetySetting: z4.enum([
|
|
558
|
+
"block_low_and_above",
|
|
559
|
+
"block_medium_and_above",
|
|
560
|
+
"block_only_high",
|
|
561
|
+
"block_none"
|
|
562
|
+
]).nullish(),
|
|
563
|
+
addWatermark: z4.boolean().nullish(),
|
|
564
|
+
storageUri: z4.string().nullish(),
|
|
565
|
+
sampleImageSize: z4.enum(["1K", "2K"]).nullish(),
|
|
566
|
+
/**
|
|
567
|
+
* Configuration for image editing operations
|
|
568
|
+
*/
|
|
569
|
+
edit: z4.object({
|
|
570
|
+
/**
|
|
571
|
+
* An integer that represents the number of sampling steps.
|
|
572
|
+
* A higher value offers better image quality, a lower value offers better latency.
|
|
573
|
+
* Try 35 steps to start. If the quality doesn't meet your requirements,
|
|
574
|
+
* increase the value towards an upper limit of 75.
|
|
575
|
+
*/
|
|
576
|
+
baseSteps: z4.number().nullish(),
|
|
577
|
+
// Edit mode options
|
|
578
|
+
// https://cloud.google.com/vertex-ai/generative-ai/docs/image/edit-insert-objects
|
|
579
|
+
mode: z4.enum([
|
|
580
|
+
"EDIT_MODE_INPAINT_INSERTION",
|
|
581
|
+
"EDIT_MODE_INPAINT_REMOVAL",
|
|
582
|
+
"EDIT_MODE_OUTPAINT",
|
|
583
|
+
"EDIT_MODE_CONTROLLED_EDITING",
|
|
584
|
+
"EDIT_MODE_PRODUCT_IMAGE",
|
|
585
|
+
"EDIT_MODE_BGSWAP"
|
|
586
|
+
]).nullish(),
|
|
587
|
+
/**
|
|
588
|
+
* The mask mode to use.
|
|
589
|
+
* - `MASK_MODE_DEFAULT` - Default value for mask mode.
|
|
590
|
+
* - `MASK_MODE_USER_PROVIDED` - User provided mask. No segmentation needed.
|
|
591
|
+
* - `MASK_MODE_DETECTION_BOX` - Mask from detected bounding boxes.
|
|
592
|
+
* - `MASK_MODE_CLOTHING_AREA` - Masks from segmenting the clothing area with open-vocab segmentation.
|
|
593
|
+
* - `MASK_MODE_PARSED_PERSON` - Masks from segmenting the person body and clothing using the person-parsing model.
|
|
594
|
+
*/
|
|
595
|
+
maskMode: z4.enum([
|
|
596
|
+
"MASK_MODE_DEFAULT",
|
|
597
|
+
"MASK_MODE_USER_PROVIDED",
|
|
598
|
+
"MASK_MODE_DETECTION_BOX",
|
|
599
|
+
"MASK_MODE_CLOTHING_AREA",
|
|
600
|
+
"MASK_MODE_PARSED_PERSON"
|
|
601
|
+
]).nullish(),
|
|
602
|
+
/**
|
|
603
|
+
* Optional. A float value between 0 and 1, inclusive, that represents the
|
|
604
|
+
* percentage of the image width to grow the mask by. Using dilation helps
|
|
605
|
+
* compensate for imprecise masks. We recommend a value of 0.01.
|
|
606
|
+
*/
|
|
607
|
+
maskDilation: z4.number().nullish()
|
|
608
|
+
}).nullish()
|
|
609
|
+
})
|
|
610
|
+
)
|
|
611
|
+
);
|
|
576
612
|
function getBase64Data(file) {
|
|
577
613
|
if (file.type === "url") {
|
|
578
614
|
throw new Error(
|
|
@@ -599,6 +635,8 @@ var googleVertexTools = {
|
|
|
599
635
|
|
|
600
636
|
// src/google-vertex-transcription-model.ts
|
|
601
637
|
import {
|
|
638
|
+
lazySchema as lazySchema6,
|
|
639
|
+
zodSchema as zodSchema6,
|
|
602
640
|
combineHeaders as combineHeaders3,
|
|
603
641
|
convertUint8ArrayToBase64 as convertUint8ArrayToBase642,
|
|
604
642
|
createJsonResponseHandler as createJsonResponseHandler3,
|
|
@@ -609,36 +647,44 @@ import {
|
|
|
609
647
|
import { z as z6 } from "zod/v4";
|
|
610
648
|
|
|
611
649
|
// src/google-vertex-transcription-model-options.ts
|
|
650
|
+
import {
|
|
651
|
+
lazySchema as lazySchema5,
|
|
652
|
+
zodSchema as zodSchema5
|
|
653
|
+
} from "@ai-sdk/provider-utils";
|
|
612
654
|
import { z as z5 } from "zod/v4";
|
|
613
|
-
var googleVertexTranscriptionProviderOptionsSchema =
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
655
|
+
var googleVertexTranscriptionProviderOptionsSchema = lazySchema5(
|
|
656
|
+
() => zodSchema5(
|
|
657
|
+
z5.object({
|
|
658
|
+
/**
|
|
659
|
+
* BCP-47 language codes to recognize (e.g. `['en-US']`), or `['auto']` to let
|
|
660
|
+
* Chirp auto-detect the spoken language. Defaults to `['auto']`. For
|
|
661
|
+
* `telephony`, pass a supported explicit language code.
|
|
662
|
+
*/
|
|
663
|
+
languageCodes: z5.array(z5.string()).optional(),
|
|
664
|
+
/**
|
|
665
|
+
* Whether to add punctuation to the transcript. Defaults to `true`.
|
|
666
|
+
*/
|
|
667
|
+
enableAutomaticPunctuation: z5.boolean().optional(),
|
|
668
|
+
/**
|
|
669
|
+
* Whether to include word-level timestamps. Defaults to `true` so the
|
|
670
|
+
* transcription result can include segments.
|
|
671
|
+
*
|
|
672
|
+
* Enabling word-level timestamps can reduce transcription quality and speed
|
|
673
|
+
* for Chirp models.
|
|
674
|
+
*/
|
|
675
|
+
enableWordTimeOffsets: z5.boolean().optional(),
|
|
676
|
+
/**
|
|
677
|
+
* The Cloud Speech-to-Text region for the request (e.g. `'us'`, `'eu'`,
|
|
678
|
+
* `'us-central1'`). Defaults to the provider `location`.
|
|
679
|
+
*
|
|
680
|
+
* Note: Speech-to-Text regions differ from Vertex AI regions. Chirp is only
|
|
681
|
+
* available in specific Speech-to-Text regions and is not available in the
|
|
682
|
+
* `global` location.
|
|
683
|
+
*/
|
|
684
|
+
region: z5.string().optional()
|
|
685
|
+
})
|
|
686
|
+
)
|
|
687
|
+
);
|
|
642
688
|
|
|
643
689
|
// src/google-vertex-transcription-model.ts
|
|
644
690
|
function parseDurationSeconds(value) {
|
|
@@ -753,34 +799,40 @@ var GoogleVertexTranscriptionModel = class {
|
|
|
753
799
|
};
|
|
754
800
|
}
|
|
755
801
|
};
|
|
756
|
-
var googleVertexTranscriptionResponseSchema =
|
|
757
|
-
|
|
802
|
+
var googleVertexTranscriptionResponseSchema = lazySchema6(
|
|
803
|
+
() => zodSchema6(
|
|
758
804
|
z6.object({
|
|
759
|
-
|
|
805
|
+
results: z6.array(
|
|
760
806
|
z6.object({
|
|
761
|
-
|
|
762
|
-
words: z6.array(
|
|
807
|
+
alternatives: z6.array(
|
|
763
808
|
z6.object({
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
809
|
+
transcript: z6.string().nullish(),
|
|
810
|
+
words: z6.array(
|
|
811
|
+
z6.object({
|
|
812
|
+
word: z6.string().nullish(),
|
|
813
|
+
startOffset: z6.string().nullish(),
|
|
814
|
+
endOffset: z6.string().nullish()
|
|
815
|
+
})
|
|
816
|
+
).nullish()
|
|
767
817
|
})
|
|
768
|
-
).nullish()
|
|
818
|
+
).nullish(),
|
|
819
|
+
languageCode: z6.string().nullish()
|
|
769
820
|
})
|
|
770
821
|
).nullish(),
|
|
771
|
-
|
|
822
|
+
metadata: z6.object({
|
|
823
|
+
totalBilledDuration: z6.string().nullish()
|
|
824
|
+
}).nullish()
|
|
772
825
|
})
|
|
773
|
-
)
|
|
774
|
-
|
|
775
|
-
totalBilledDuration: z6.string().nullish()
|
|
776
|
-
}).nullish()
|
|
777
|
-
});
|
|
826
|
+
)
|
|
827
|
+
);
|
|
778
828
|
|
|
779
829
|
// src/gemini-transcription/google-vertex-gemini-transcription-model.ts
|
|
780
830
|
import {
|
|
781
831
|
InvalidArgumentError
|
|
782
832
|
} from "@ai-sdk/provider";
|
|
783
833
|
import {
|
|
834
|
+
lazySchema as lazySchema8,
|
|
835
|
+
zodSchema as zodSchema8,
|
|
784
836
|
combineHeaders as combineHeaders4,
|
|
785
837
|
convertToBase64 as convertToBase642,
|
|
786
838
|
createJsonResponseHandler as createJsonResponseHandler4,
|
|
@@ -791,37 +843,45 @@ import {
|
|
|
791
843
|
import { z as z8 } from "zod/v4";
|
|
792
844
|
|
|
793
845
|
// src/gemini-transcription/google-vertex-gemini-transcription-model-options.ts
|
|
846
|
+
import {
|
|
847
|
+
lazySchema as lazySchema7,
|
|
848
|
+
zodSchema as zodSchema7
|
|
849
|
+
} from "@ai-sdk/provider-utils";
|
|
794
850
|
import { z as z7 } from "zod/v4";
|
|
795
|
-
var googleVertexGeminiTranscriptionModelOptions =
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
851
|
+
var googleVertexGeminiTranscriptionModelOptions = lazySchema7(
|
|
852
|
+
() => zodSchema7(
|
|
853
|
+
z7.object({
|
|
854
|
+
/**
|
|
855
|
+
* BCP-47 language codes providing hints about the languages present in the
|
|
856
|
+
* audio. If omitted or empty, defaults to automatic language detection.
|
|
857
|
+
*/
|
|
858
|
+
languageCodes: z7.array(z7.string()).optional(),
|
|
859
|
+
/**
|
|
860
|
+
* Custom vocabulary phrases, which bias the speech recognition model
|
|
861
|
+
* toward recognizing specific terms.
|
|
862
|
+
*/
|
|
863
|
+
customVocabulary: z7.array(z7.string()).optional(),
|
|
864
|
+
/**
|
|
865
|
+
* Enables word-level timestamp generation.
|
|
866
|
+
*/
|
|
867
|
+
wordTimestamp: z7.boolean().optional(),
|
|
868
|
+
/**
|
|
869
|
+
* Enables speaker diarization.
|
|
870
|
+
*/
|
|
871
|
+
diarization: z7.boolean().optional(),
|
|
872
|
+
/**
|
|
873
|
+
* Transcription output formatting mode.
|
|
874
|
+
*
|
|
875
|
+
* - `VERBATIM` (default): exact literal transcript preserving filler
|
|
876
|
+
* words, repetitions, and false starts.
|
|
877
|
+
* - `SMART`: cleans up and structures the transcript in real time —
|
|
878
|
+
* disfluency removal, inline self-corrections, structured formatting
|
|
879
|
+
* (lists, numbers, dates, paragraph breaks), and grammar/casing polish.
|
|
880
|
+
*/
|
|
881
|
+
mode: z7.enum(["SMART", "VERBATIM"]).optional()
|
|
882
|
+
})
|
|
883
|
+
)
|
|
884
|
+
);
|
|
825
885
|
|
|
826
886
|
// src/gemini-transcription/google-vertex-gemini-transcription-model.ts
|
|
827
887
|
function isLiveTranscriptionModelId(modelId) {
|
|
@@ -963,31 +1023,35 @@ function parseOffsetSeconds(offset) {
|
|
|
963
1023
|
const parsed = Number.parseFloat(offset);
|
|
964
1024
|
return Number.isFinite(parsed) ? parsed : void 0;
|
|
965
1025
|
}
|
|
966
|
-
var googleVertexGeminiTranscriptionWordSchema = z8.object({
|
|
1026
|
+
var googleVertexGeminiTranscriptionWordSchema = () => z8.object({
|
|
967
1027
|
word: z8.string().nullish(),
|
|
968
1028
|
startOffset: z8.string().nullish(),
|
|
969
1029
|
endOffset: z8.string().nullish()
|
|
970
1030
|
});
|
|
971
|
-
var googleVertexGeminiTranscriptionResponseSchema =
|
|
972
|
-
|
|
1031
|
+
var googleVertexGeminiTranscriptionResponseSchema = lazySchema8(
|
|
1032
|
+
() => zodSchema8(
|
|
973
1033
|
z8.object({
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
z8.object({
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
1034
|
+
candidates: z8.array(
|
|
1035
|
+
z8.object({
|
|
1036
|
+
content: z8.object({
|
|
1037
|
+
parts: z8.array(
|
|
1038
|
+
z8.object({
|
|
1039
|
+
text: z8.string().nullish(),
|
|
1040
|
+
audioTranscription: z8.object({
|
|
1041
|
+
text: z8.string().nullish(),
|
|
1042
|
+
languageCode: z8.string().nullish(),
|
|
1043
|
+
speakerLabel: z8.string().nullish(),
|
|
1044
|
+
words: z8.array(googleVertexGeminiTranscriptionWordSchema()).nullish()
|
|
1045
|
+
}).nullish()
|
|
1046
|
+
})
|
|
1047
|
+
).nullish()
|
|
1048
|
+
}).nullish()
|
|
1049
|
+
})
|
|
1050
|
+
).nullish(),
|
|
1051
|
+
usageMetadata: z8.record(z8.string(), z8.unknown()).nullish()
|
|
987
1052
|
})
|
|
988
|
-
)
|
|
989
|
-
|
|
990
|
-
});
|
|
1053
|
+
)
|
|
1054
|
+
);
|
|
991
1055
|
|
|
992
1056
|
// src/google-vertex-video-model.ts
|
|
993
1057
|
import {
|
|
@@ -998,11 +1062,11 @@ import {
|
|
|
998
1062
|
convertUint8ArrayToBase64 as convertUint8ArrayToBase643,
|
|
999
1063
|
createJsonResponseHandler as createJsonResponseHandler5,
|
|
1000
1064
|
delay,
|
|
1001
|
-
lazySchema,
|
|
1065
|
+
lazySchema as lazySchema9,
|
|
1002
1066
|
parseProviderOptions as parseProviderOptions5,
|
|
1003
1067
|
postJsonToApi as postJsonToApi5,
|
|
1004
1068
|
resolve as resolve5,
|
|
1005
|
-
zodSchema
|
|
1069
|
+
zodSchema as zodSchema9
|
|
1006
1070
|
} from "@ai-sdk/provider-utils";
|
|
1007
1071
|
import { z as z9 } from "zod/v4";
|
|
1008
1072
|
function getFirstFrameImage(options) {
|
|
@@ -1267,27 +1331,31 @@ var GoogleVertexVideoModel = class {
|
|
|
1267
1331
|
};
|
|
1268
1332
|
}
|
|
1269
1333
|
};
|
|
1270
|
-
var vertexOperationSchema =
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
z9.object({
|
|
1281
|
-
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1334
|
+
var vertexOperationSchema = lazySchema9(
|
|
1335
|
+
() => zodSchema9(
|
|
1336
|
+
z9.object({
|
|
1337
|
+
name: z9.string().nullish(),
|
|
1338
|
+
done: z9.boolean().nullish(),
|
|
1339
|
+
error: z9.object({
|
|
1340
|
+
code: z9.number().nullish(),
|
|
1341
|
+
message: z9.string(),
|
|
1342
|
+
status: z9.string().nullish()
|
|
1343
|
+
}).nullish(),
|
|
1344
|
+
response: z9.object({
|
|
1345
|
+
videos: z9.array(
|
|
1346
|
+
z9.object({
|
|
1347
|
+
bytesBase64Encoded: z9.string().nullish(),
|
|
1348
|
+
gcsUri: z9.string().nullish(),
|
|
1349
|
+
mimeType: z9.string().nullish()
|
|
1350
|
+
})
|
|
1351
|
+
).nullish(),
|
|
1352
|
+
raiMediaFilteredCount: z9.number().nullish()
|
|
1353
|
+
}).nullish()
|
|
1354
|
+
})
|
|
1355
|
+
)
|
|
1356
|
+
);
|
|
1357
|
+
var googleVertexVideoModelOptionsSchema = lazySchema9(
|
|
1358
|
+
() => zodSchema9(
|
|
1291
1359
|
z9.object({
|
|
1292
1360
|
pollIntervalMs: z9.number().positive().nullish(),
|
|
1293
1361
|
pollTimeoutMs: z9.number().positive().nullish(),
|