@ai-sdk/google-vertex 4.0.219 → 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 +16 -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
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { SharedV3Warning, TranscriptionModelV3 } from '@ai-sdk/provider';
|
|
2
2
|
import {
|
|
3
|
+
lazySchema,
|
|
4
|
+
zodSchema,
|
|
3
5
|
combineHeaders,
|
|
4
6
|
convertUint8ArrayToBase64,
|
|
5
7
|
createJsonResponseHandler,
|
|
@@ -182,33 +184,37 @@ export class GoogleVertexTranscriptionModel implements TranscriptionModelV3 {
|
|
|
182
184
|
|
|
183
185
|
// Minimal schema: only the fields the implementation reads, with `.nullish()`
|
|
184
186
|
// so provider API changes don't break parsing.
|
|
185
|
-
const googleVertexTranscriptionResponseSchema =
|
|
186
|
-
|
|
187
|
-
.
|
|
188
|
-
z
|
|
189
|
-
|
|
190
|
-
.
|
|
191
|
-
z
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
z
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
})
|
|
187
|
+
const googleVertexTranscriptionResponseSchema = lazySchema(() =>
|
|
188
|
+
zodSchema(
|
|
189
|
+
z.object({
|
|
190
|
+
results: z
|
|
191
|
+
.array(
|
|
192
|
+
z.object({
|
|
193
|
+
alternatives: z
|
|
194
|
+
.array(
|
|
195
|
+
z.object({
|
|
196
|
+
transcript: z.string().nullish(),
|
|
197
|
+
words: z
|
|
198
|
+
.array(
|
|
199
|
+
z.object({
|
|
200
|
+
word: z.string().nullish(),
|
|
201
|
+
startOffset: z.string().nullish(),
|
|
202
|
+
endOffset: z.string().nullish(),
|
|
203
|
+
}),
|
|
204
|
+
)
|
|
205
|
+
.nullish(),
|
|
206
|
+
}),
|
|
207
|
+
)
|
|
208
|
+
.nullish(),
|
|
209
|
+
languageCode: z.string().nullish(),
|
|
210
|
+
}),
|
|
211
|
+
)
|
|
212
|
+
.nullish(),
|
|
213
|
+
metadata: z
|
|
214
|
+
.object({
|
|
215
|
+
totalBilledDuration: z.string().nullish(),
|
|
216
|
+
})
|
|
217
|
+
.nullish(),
|
|
218
|
+
}),
|
|
219
|
+
),
|
|
220
|
+
);
|
|
@@ -399,31 +399,35 @@ export class GoogleVertexVideoModel implements Experimental_VideoModelV3 {
|
|
|
399
399
|
}
|
|
400
400
|
}
|
|
401
401
|
|
|
402
|
-
const vertexOperationSchema =
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
.
|
|
416
|
-
z
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
402
|
+
const vertexOperationSchema = lazySchema(() =>
|
|
403
|
+
zodSchema(
|
|
404
|
+
z.object({
|
|
405
|
+
name: z.string().nullish(),
|
|
406
|
+
done: z.boolean().nullish(),
|
|
407
|
+
error: z
|
|
408
|
+
.object({
|
|
409
|
+
code: z.number().nullish(),
|
|
410
|
+
message: z.string(),
|
|
411
|
+
status: z.string().nullish(),
|
|
412
|
+
})
|
|
413
|
+
.nullish(),
|
|
414
|
+
response: z
|
|
415
|
+
.object({
|
|
416
|
+
videos: z
|
|
417
|
+
.array(
|
|
418
|
+
z.object({
|
|
419
|
+
bytesBase64Encoded: z.string().nullish(),
|
|
420
|
+
gcsUri: z.string().nullish(),
|
|
421
|
+
mimeType: z.string().nullish(),
|
|
422
|
+
}),
|
|
423
|
+
)
|
|
424
|
+
.nullish(),
|
|
425
|
+
raiMediaFilteredCount: z.number().nullish(),
|
|
426
|
+
})
|
|
422
427
|
.nullish(),
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
});
|
|
428
|
+
}),
|
|
429
|
+
),
|
|
430
|
+
);
|
|
427
431
|
|
|
428
432
|
const googleVertexVideoModelOptionsSchema = lazySchema(() =>
|
|
429
433
|
zodSchema(
|