@ai-sdk/google-vertex 4.0.218 → 4.0.220
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/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 {
|
|
18
|
+
import {
|
|
19
|
+
lazySchema,
|
|
20
|
+
zodSchema,
|
|
21
|
+
createJsonErrorResponseHandler
|
|
22
|
+
} from "@ai-sdk/provider-utils";
|
|
17
23
|
import { z } from "zod/v4";
|
|
18
|
-
var googleVertexErrorDataSchema =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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 =
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
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 =
|
|
211
|
-
|
|
228
|
+
var googleVertexGeminiTranscriptionResponseSchema = lazySchema3(
|
|
229
|
+
() => zodSchema3(
|
|
212
230
|
z3.object({
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
z3.object({
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
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
|
-
)
|
|
228
|
-
|
|
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.
|
|
287
|
+
var VERSION = true ? "4.0.220" : "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 =
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
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 =
|
|
444
|
-
|
|
475
|
+
var googleVertexTextEmbeddingResponseSchema = lazySchema5(
|
|
476
|
+
() => zodSchema5(
|
|
445
477
|
z5.object({
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
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 =
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
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 =
|
|
737
|
-
|
|
738
|
-
z6.
|
|
739
|
-
z6.
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
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 =
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
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 =
|
|
985
|
-
|
|
1044
|
+
var googleVertexTranscriptionResponseSchema = lazySchema8(
|
|
1045
|
+
() => zodSchema8(
|
|
986
1046
|
z8.object({
|
|
987
|
-
|
|
1047
|
+
results: z8.array(
|
|
988
1048
|
z8.object({
|
|
989
|
-
|
|
990
|
-
words: z8.array(
|
|
1049
|
+
alternatives: z8.array(
|
|
991
1050
|
z8.object({
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
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
|
-
|
|
1064
|
+
metadata: z8.object({
|
|
1065
|
+
totalBilledDuration: z8.string().nullish()
|
|
1066
|
+
}).nullish()
|
|
1000
1067
|
})
|
|
1001
|
-
)
|
|
1002
|
-
|
|
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 =
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
z9.object({
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
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(),
|