@ai-sdk/google-vertex 5.0.63 → 5.0.66

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.d.ts CHANGED
@@ -3,9 +3,9 @@ import { GoogleLanguageModelOptions, GoogleSpeechModelOptions } from '@ai-sdk/go
3
3
  import { GoogleAuthOptions } from 'google-auth-library';
4
4
  import { GoogleInteractionsModelId, GoogleInteractionsAgentName } from '@ai-sdk/google/internal';
5
5
  import * as _ai_sdk_provider from '@ai-sdk/provider';
6
- import { EmbeddingModelV4, ProviderV4, LanguageModelV4, ImageModelV4, Experimental_VideoModelV4, SpeechModelV4, TranscriptionModelV4 } from '@ai-sdk/provider';
6
+ import { EmbeddingModelV4, ProviderV4, LanguageModelV4, ImageModelV4, Experimental_VideoModelV4, SpeechModelV4, TranscriptionModelV4, JSONObject, Experimental_TranscriptionModelV4StreamOptions } from '@ai-sdk/provider';
7
7
  import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
8
- import { Resolvable, FetchFunction, WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@ai-sdk/provider-utils';
8
+ import { Resolvable, FetchFunction, WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE, WebSocketConstructor } from '@ai-sdk/provider-utils';
9
9
 
10
10
  type GoogleVertexEmbeddingModelId = 'textembedding-gecko' | 'textembedding-gecko@001' | 'textembedding-gecko@003' | 'textembedding-gecko-multilingual' | 'textembedding-gecko-multilingual@001' | 'text-multilingual-embedding-002' | 'text-embedding-004' | 'text-embedding-005' | 'gemini-embedding-001' | 'gemini-embedding-2' | 'gemini-embedding-2-preview' | (string & {});
11
11
  declare const googleVertexEmbeddingModelOptions: z.ZodObject<{
@@ -207,6 +207,12 @@ interface GoogleVertexProviderSettings$1 {
207
207
  * Base URL for the Google Vertex API calls.
208
208
  */
209
209
  baseURL?: string;
210
+ /**
211
+ * Custom WebSocket implementation for streaming transcription. Useful for
212
+ * runtimes that need a WebSocket constructor with header support (e.g. the
213
+ * `ws` package in Node.js, which Vertex's OAuth Bearer header requires).
214
+ */
215
+ webSocket?: WebSocketConstructor;
210
216
  }
211
217
 
212
218
  interface GoogleVertexProviderSettings extends GoogleVertexProviderSettings$1 {
@@ -225,6 +231,64 @@ declare function createGoogleVertex(options?: GoogleVertexProviderSettings): Goo
225
231
  */
226
232
  declare const googleVertex: GoogleVertexProvider;
227
233
 
234
+ type GoogleVertexGeminiTranscriptionModelId = 'gemini-3.5-transcribe' | 'gemini-3.5-transcribe-live' | (string & {});
235
+ /**
236
+ * Speech recognition options for Gemini transcription models on Vertex,
237
+ * shared by unary (`gemini-3.5-transcribe`) and live
238
+ * (`gemini-3.5-transcribe-live`) variants. Maps onto Google's
239
+ * `AudioTranscriptionConfig`.
240
+ */
241
+ declare const googleVertexGeminiTranscriptionModelOptions: z.ZodObject<{
242
+ languageCodes: z.ZodOptional<z.ZodArray<z.ZodString>>;
243
+ customVocabulary: z.ZodOptional<z.ZodArray<z.ZodString>>;
244
+ wordTimestamp: z.ZodOptional<z.ZodBoolean>;
245
+ diarization: z.ZodOptional<z.ZodBoolean>;
246
+ mode: z.ZodOptional<z.ZodEnum<{
247
+ SMART: "SMART";
248
+ VERBATIM: "VERBATIM";
249
+ }>>;
250
+ }, z.core.$strip>;
251
+ type GoogleVertexTranscriptionModelGeminiOptions = z.infer<typeof googleVertexGeminiTranscriptionModelOptions>;
252
+
253
+ interface GoogleVertexGeminiTranscriptionModelConfig {
254
+ provider: string;
255
+ /** Regional base URL ending in `/publishers/google`. */
256
+ baseURL: string;
257
+ headers?: Resolvable<Record<string, string | undefined>>;
258
+ fetch?: FetchFunction;
259
+ webSocket?: WebSocketConstructor;
260
+ project: string;
261
+ location: string;
262
+ _internal?: {
263
+ currentDate?: () => Date;
264
+ finishGraceMs?: number;
265
+ };
266
+ }
267
+ /**
268
+ * Gemini transcription on Vertex AI. Unary variants transcribe via
269
+ * `generateContent`; live variants stream over the Vertex Live API WebSocket
270
+ * (`LlmBidiService/BidiGenerateContent`) with OAuth Bearer authentication
271
+ * from the provider's resolved headers.
272
+ */
273
+ declare class GoogleVertexGeminiTranscriptionModel implements TranscriptionModelV4 {
274
+ readonly modelId: GoogleVertexGeminiTranscriptionModelId;
275
+ private readonly config;
276
+ readonly specificationVersion = "v4";
277
+ static [WORKFLOW_SERIALIZE](model: GoogleVertexGeminiTranscriptionModel): {
278
+ modelId: string;
279
+ config: JSONObject;
280
+ };
281
+ static [WORKFLOW_DESERIALIZE](options: {
282
+ modelId: GoogleVertexGeminiTranscriptionModelId;
283
+ config: GoogleVertexGeminiTranscriptionModelConfig;
284
+ }): GoogleVertexGeminiTranscriptionModel;
285
+ get provider(): string;
286
+ constructor(modelId: GoogleVertexGeminiTranscriptionModelId, config: GoogleVertexGeminiTranscriptionModelConfig);
287
+ private parseOptions;
288
+ doGenerate(options: Parameters<TranscriptionModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<TranscriptionModelV4['doGenerate']>>>;
289
+ doStream(options: Experimental_TranscriptionModelV4StreamOptions): Promise<Awaited<ReturnType<NonNullable<TranscriptionModelV4['doStream']>>>>;
290
+ }
291
+
228
292
  declare const VERSION: string;
229
293
 
230
- export { type GoogleVertexEmbeddingModelOptions, type GoogleVertexImageModelOptions, type GoogleVertexImageModelOptions as GoogleVertexImageProviderOptions, type GoogleVertexProvider, type GoogleVertexProviderSettings, type GoogleVertexSpeechModelId, type GoogleVertexSpeechModelOptions, type GoogleVertexTranscriptionModelId, type GoogleVertexTranscriptionModelOptions, type GoogleVertexVideoModelId, type GoogleVertexVideoModelOptions, type GoogleVertexVideoModelOptions as GoogleVertexVideoProviderOptions, VERSION, createGoogleVertex, createGoogleVertex as createVertex, googleVertex, googleVertex as vertex };
294
+ export { type GoogleVertexEmbeddingModelOptions, GoogleVertexGeminiTranscriptionModel, type GoogleVertexGeminiTranscriptionModelId, type GoogleVertexImageModelOptions, type GoogleVertexImageModelOptions as GoogleVertexImageProviderOptions, type GoogleVertexProvider, type GoogleVertexProviderSettings, type GoogleVertexSpeechModelId, type GoogleVertexSpeechModelOptions, type GoogleVertexTranscriptionModelGeminiOptions, type GoogleVertexTranscriptionModelId, type GoogleVertexTranscriptionModelOptions, type GoogleVertexVideoModelId, type GoogleVertexVideoModelOptions, type GoogleVertexVideoModelOptions as GoogleVertexVideoProviderOptions, VERSION, createGoogleVertex, createGoogleVertex as createVertex, googleVertex, googleVertex as vertex };