@ai-sdk/gladia 3.0.0-beta.5 → 3.0.0-beta.50

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.js CHANGED
@@ -1,307 +1,303 @@
1
- "use strict";
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __hasOwnProp = Object.prototype.hasOwnProperty;
6
- var __export = (target, all) => {
7
- for (var name in all)
8
- __defProp(target, name, { get: all[name], enumerable: true });
9
- };
10
- var __copyProps = (to, from, except, desc) => {
11
- if (from && typeof from === "object" || typeof from === "function") {
12
- for (let key of __getOwnPropNames(from))
13
- if (!__hasOwnProp.call(to, key) && key !== except)
14
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
- }
16
- return to;
17
- };
18
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
-
20
- // src/index.ts
21
- var index_exports = {};
22
- __export(index_exports, {
23
- VERSION: () => VERSION,
24
- createGladia: () => createGladia,
25
- gladia: () => gladia
26
- });
27
- module.exports = __toCommonJS(index_exports);
28
-
29
1
  // src/gladia-provider.ts
30
- var import_provider2 = require("@ai-sdk/provider");
31
- var import_provider_utils3 = require("@ai-sdk/provider-utils");
2
+ import {
3
+ NoSuchModelError
4
+ } from "@ai-sdk/provider";
5
+ import {
6
+ loadApiKey,
7
+ withUserAgentSuffix
8
+ } from "@ai-sdk/provider-utils";
32
9
 
33
10
  // src/gladia-transcription-model.ts
34
- var import_provider = require("@ai-sdk/provider");
35
- var import_provider_utils2 = require("@ai-sdk/provider-utils");
36
- var import_v42 = require("zod/v4");
11
+ import {
12
+ AISDKError
13
+ } from "@ai-sdk/provider";
14
+ import {
15
+ combineHeaders,
16
+ convertBase64ToUint8Array,
17
+ createJsonResponseHandler,
18
+ mediaTypeToExtension,
19
+ delay,
20
+ getFromApi,
21
+ isSameOrigin,
22
+ parseProviderOptions,
23
+ postFormDataToApi,
24
+ postJsonToApi,
25
+ serializeModelOptions,
26
+ WORKFLOW_SERIALIZE,
27
+ WORKFLOW_DESERIALIZE
28
+ } from "@ai-sdk/provider-utils";
29
+ import { z as z3 } from "zod/v4";
37
30
 
38
31
  // src/gladia-error.ts
39
- var import_v4 = require("zod/v4");
40
- var import_provider_utils = require("@ai-sdk/provider-utils");
41
- var gladiaErrorDataSchema = import_v4.z.object({
42
- error: import_v4.z.object({
43
- message: import_v4.z.string(),
44
- code: import_v4.z.number()
32
+ import { z } from "zod/v4";
33
+ import { createJsonErrorResponseHandler } from "@ai-sdk/provider-utils";
34
+ var gladiaErrorDataSchema = z.object({
35
+ error: z.object({
36
+ message: z.string(),
37
+ code: z.number()
45
38
  })
46
39
  });
47
- var gladiaFailedResponseHandler = (0, import_provider_utils.createJsonErrorResponseHandler)({
40
+ var gladiaFailedResponseHandler = createJsonErrorResponseHandler({
48
41
  errorSchema: gladiaErrorDataSchema,
49
42
  errorToMessage: (data) => data.error.message
50
43
  });
51
44
 
52
- // src/gladia-transcription-model.ts
53
- var gladiaTranscriptionModelOptionsSchema = import_v42.z.object({
45
+ // src/gladia-transcription-model-options.ts
46
+ import { z as z2 } from "zod/v4";
47
+ var gladiaTranscriptionModelOptionsSchema = z2.object({
54
48
  /**
55
49
  * Optional context prompt to guide the transcription.
56
50
  */
57
- contextPrompt: import_v42.z.string().nullish(),
51
+ contextPrompt: z2.string().nullish(),
58
52
  /**
59
53
  * Custom vocabulary to improve transcription accuracy.
60
54
  * Can be a boolean or an array of custom terms.
61
55
  */
62
- customVocabulary: import_v42.z.union([import_v42.z.boolean(), import_v42.z.array(import_v42.z.any())]).nullish(),
56
+ customVocabulary: z2.union([z2.boolean(), z2.array(z2.any())]).nullish(),
63
57
  /**
64
58
  * Configuration for custom vocabulary.
65
59
  */
66
- customVocabularyConfig: import_v42.z.object({
60
+ customVocabularyConfig: z2.object({
67
61
  /**
68
62
  * Array of vocabulary terms or objects with pronunciation details.
69
63
  */
70
- vocabulary: import_v42.z.array(
71
- import_v42.z.union([
72
- import_v42.z.string(),
73
- import_v42.z.object({
64
+ vocabulary: z2.array(
65
+ z2.union([
66
+ z2.string(),
67
+ z2.object({
74
68
  /**
75
69
  * The vocabulary term.
76
70
  */
77
- value: import_v42.z.string(),
71
+ value: z2.string(),
78
72
  /**
79
73
  * Intensity of the term in recognition (optional).
80
74
  */
81
- intensity: import_v42.z.number().nullish(),
75
+ intensity: z2.number().nullish(),
82
76
  /**
83
77
  * Alternative pronunciations for the term (optional).
84
78
  */
85
- pronunciations: import_v42.z.array(import_v42.z.string()).nullish(),
79
+ pronunciations: z2.array(z2.string()).nullish(),
86
80
  /**
87
81
  * Language of the term (optional).
88
82
  */
89
- language: import_v42.z.string().nullish()
83
+ language: z2.string().nullish()
90
84
  })
91
85
  ])
92
86
  ),
93
87
  /**
94
88
  * Default intensity for all vocabulary terms.
95
89
  */
96
- defaultIntensity: import_v42.z.number().nullish()
90
+ defaultIntensity: z2.number().nullish()
97
91
  }).nullish(),
98
92
  /**
99
93
  * Whether to automatically detect the language of the audio.
100
94
  */
101
- detectLanguage: import_v42.z.boolean().nullish(),
95
+ detectLanguage: z2.boolean().nullish(),
102
96
  /**
103
97
  * Whether to enable code switching (multiple languages in the same audio).
104
98
  */
105
- enableCodeSwitching: import_v42.z.boolean().nullish(),
99
+ enableCodeSwitching: z2.boolean().nullish(),
106
100
  /**
107
101
  * Configuration for code switching.
108
102
  */
109
- codeSwitchingConfig: import_v42.z.object({
103
+ codeSwitchingConfig: z2.object({
110
104
  /**
111
105
  * Languages to consider for code switching.
112
106
  */
113
- languages: import_v42.z.array(import_v42.z.string()).nullish()
107
+ languages: z2.array(z2.string()).nullish()
114
108
  }).nullish(),
115
109
  /**
116
110
  * Specific language for transcription.
117
111
  */
118
- language: import_v42.z.string().nullish(),
112
+ language: z2.string().nullish(),
119
113
  /**
120
114
  * Whether to enable callback when transcription is complete.
121
115
  */
122
- callback: import_v42.z.boolean().nullish(),
116
+ callback: z2.boolean().nullish(),
123
117
  /**
124
118
  * Configuration for callback.
125
119
  */
126
- callbackConfig: import_v42.z.object({
120
+ callbackConfig: z2.object({
127
121
  /**
128
122
  * URL to send the callback to.
129
123
  */
130
- url: import_v42.z.string(),
124
+ url: z2.string(),
131
125
  /**
132
126
  * HTTP method for the callback.
133
127
  */
134
- method: import_v42.z.enum(["POST", "PUT"]).nullish()
128
+ method: z2.enum(["POST", "PUT"]).nullish()
135
129
  }).nullish(),
136
130
  /**
137
131
  * Whether to generate subtitles.
138
132
  */
139
- subtitles: import_v42.z.boolean().nullish(),
133
+ subtitles: z2.boolean().nullish(),
140
134
  /**
141
135
  * Configuration for subtitles generation.
142
136
  */
143
- subtitlesConfig: import_v42.z.object({
137
+ subtitlesConfig: z2.object({
144
138
  /**
145
139
  * Subtitle file formats to generate.
146
140
  */
147
- formats: import_v42.z.array(import_v42.z.enum(["srt", "vtt"])).nullish(),
141
+ formats: z2.array(z2.enum(["srt", "vtt"])).nullish(),
148
142
  /**
149
143
  * Minimum duration for subtitle segments.
150
144
  */
151
- minimumDuration: import_v42.z.number().nullish(),
145
+ minimumDuration: z2.number().nullish(),
152
146
  /**
153
147
  * Maximum duration for subtitle segments.
154
148
  */
155
- maximumDuration: import_v42.z.number().nullish(),
149
+ maximumDuration: z2.number().nullish(),
156
150
  /**
157
151
  * Maximum characters per row in subtitles.
158
152
  */
159
- maximumCharactersPerRow: import_v42.z.number().nullish(),
153
+ maximumCharactersPerRow: z2.number().nullish(),
160
154
  /**
161
155
  * Maximum rows per caption in subtitles.
162
156
  */
163
- maximumRowsPerCaption: import_v42.z.number().nullish(),
157
+ maximumRowsPerCaption: z2.number().nullish(),
164
158
  /**
165
159
  * Style of subtitles.
166
160
  */
167
- style: import_v42.z.enum(["default", "compliance"]).nullish()
161
+ style: z2.enum(["default", "compliance"]).nullish()
168
162
  }).nullish(),
169
163
  /**
170
164
  * Whether to enable speaker diarization (speaker identification).
171
165
  */
172
- diarization: import_v42.z.boolean().nullish(),
166
+ diarization: z2.boolean().nullish(),
173
167
  /**
174
168
  * Configuration for diarization.
175
169
  */
176
- diarizationConfig: import_v42.z.object({
170
+ diarizationConfig: z2.object({
177
171
  /**
178
172
  * Exact number of speakers to identify.
179
173
  */
180
- numberOfSpeakers: import_v42.z.number().nullish(),
174
+ numberOfSpeakers: z2.number().nullish(),
181
175
  /**
182
176
  * Minimum number of speakers to identify.
183
177
  */
184
- minSpeakers: import_v42.z.number().nullish(),
178
+ minSpeakers: z2.number().nullish(),
185
179
  /**
186
180
  * Maximum number of speakers to identify.
187
181
  */
188
- maxSpeakers: import_v42.z.number().nullish(),
182
+ maxSpeakers: z2.number().nullish(),
189
183
  /**
190
184
  * Whether to use enhanced diarization.
191
185
  */
192
- enhanced: import_v42.z.boolean().nullish()
186
+ enhanced: z2.boolean().nullish()
193
187
  }).nullish(),
194
188
  /**
195
189
  * Whether to translate the transcription.
196
190
  */
197
- translation: import_v42.z.boolean().nullish(),
191
+ translation: z2.boolean().nullish(),
198
192
  /**
199
193
  * Configuration for translation.
200
194
  */
201
- translationConfig: import_v42.z.object({
195
+ translationConfig: z2.object({
202
196
  /**
203
197
  * Target languages for translation.
204
198
  */
205
- targetLanguages: import_v42.z.array(import_v42.z.string()),
199
+ targetLanguages: z2.array(z2.string()),
206
200
  /**
207
201
  * Translation model to use.
208
202
  */
209
- model: import_v42.z.enum(["base", "enhanced"]).nullish(),
203
+ model: z2.enum(["base", "enhanced"]).nullish(),
210
204
  /**
211
205
  * Whether to match original utterances in translation.
212
206
  */
213
- matchOriginalUtterances: import_v42.z.boolean().nullish()
207
+ matchOriginalUtterances: z2.boolean().nullish()
214
208
  }).nullish(),
215
209
  /**
216
210
  * Whether to generate a summary of the transcription.
217
211
  */
218
- summarization: import_v42.z.boolean().nullish(),
212
+ summarization: z2.boolean().nullish(),
219
213
  /**
220
214
  * Configuration for summarization.
221
215
  */
222
- summarizationConfig: import_v42.z.object({
216
+ summarizationConfig: z2.object({
223
217
  /**
224
218
  * Type of summary to generate.
225
219
  */
226
- type: import_v42.z.enum(["general", "bullet_points", "concise"]).nullish()
220
+ type: z2.enum(["general", "bullet_points", "concise"]).nullish()
227
221
  }).nullish(),
228
222
  /**
229
223
  * Whether to enable content moderation.
230
224
  */
231
- moderation: import_v42.z.boolean().nullish(),
225
+ moderation: z2.boolean().nullish(),
232
226
  /**
233
227
  * Whether to enable named entity recognition.
234
228
  */
235
- namedEntityRecognition: import_v42.z.boolean().nullish(),
229
+ namedEntityRecognition: z2.boolean().nullish(),
236
230
  /**
237
231
  * Whether to enable automatic chapter creation.
238
232
  */
239
- chapterization: import_v42.z.boolean().nullish(),
233
+ chapterization: z2.boolean().nullish(),
240
234
  /**
241
235
  * Whether to ensure consistent naming of entities.
242
236
  */
243
- nameConsistency: import_v42.z.boolean().nullish(),
237
+ nameConsistency: z2.boolean().nullish(),
244
238
  /**
245
239
  * Whether to enable custom spelling.
246
240
  */
247
- customSpelling: import_v42.z.boolean().nullish(),
241
+ customSpelling: z2.boolean().nullish(),
248
242
  /**
249
243
  * Configuration for custom spelling.
250
244
  */
251
- customSpellingConfig: import_v42.z.object({
245
+ customSpellingConfig: z2.object({
252
246
  /**
253
247
  * Dictionary of custom spellings.
254
248
  */
255
- spellingDictionary: import_v42.z.record(import_v42.z.string(), import_v42.z.array(import_v42.z.string()))
249
+ spellingDictionary: z2.record(z2.string(), z2.array(z2.string()))
256
250
  }).nullish(),
257
251
  /**
258
252
  * Whether to extract structured data from the transcription.
259
253
  */
260
- structuredDataExtraction: import_v42.z.boolean().nullish(),
254
+ structuredDataExtraction: z2.boolean().nullish(),
261
255
  /**
262
256
  * Configuration for structured data extraction.
263
257
  */
264
- structuredDataExtractionConfig: import_v42.z.object({
258
+ structuredDataExtractionConfig: z2.object({
265
259
  /**
266
260
  * Classes of data to extract.
267
261
  */
268
- classes: import_v42.z.array(import_v42.z.string())
262
+ classes: z2.array(z2.string())
269
263
  }).nullish(),
270
264
  /**
271
265
  * Whether to perform sentiment analysis on the transcription.
272
266
  */
273
- sentimentAnalysis: import_v42.z.boolean().nullish(),
267
+ sentimentAnalysis: z2.boolean().nullish(),
274
268
  /**
275
269
  * Whether to send audio to a language model for processing.
276
270
  */
277
- audioToLlm: import_v42.z.boolean().nullish(),
271
+ audioToLlm: z2.boolean().nullish(),
278
272
  /**
279
273
  * Configuration for audio to language model processing.
280
274
  */
281
- audioToLlmConfig: import_v42.z.object({
275
+ audioToLlmConfig: z2.object({
282
276
  /**
283
277
  * Prompts to send to the language model.
284
278
  */
285
- prompts: import_v42.z.array(import_v42.z.string())
279
+ prompts: z2.array(z2.string())
286
280
  }).nullish(),
287
281
  /**
288
282
  * Custom metadata to include with the transcription.
289
283
  */
290
- customMetadata: import_v42.z.record(import_v42.z.string(), import_v42.z.any()).nullish(),
284
+ customMetadata: z2.record(z2.string(), z2.any()).nullish(),
291
285
  /**
292
286
  * Whether to include sentence-level segmentation.
293
287
  */
294
- sentences: import_v42.z.boolean().nullish(),
288
+ sentences: z2.boolean().nullish(),
295
289
  /**
296
290
  * Whether to enable display mode.
297
291
  */
298
- displayMode: import_v42.z.boolean().nullish(),
292
+ displayMode: z2.boolean().nullish(),
299
293
  /**
300
294
  * Whether to enhance punctuation in the transcription.
301
295
  */
302
- punctuationEnhanced: import_v42.z.boolean().nullish()
296
+ punctuationEnhanced: z2.boolean().nullish()
303
297
  });
304
- var GladiaTranscriptionModel = class {
298
+
299
+ // src/gladia-transcription-model.ts
300
+ var GladiaTranscriptionModel = class _GladiaTranscriptionModel {
305
301
  constructor(modelId, config) {
306
302
  this.modelId = modelId;
307
303
  this.config = config;
@@ -310,12 +306,21 @@ var GladiaTranscriptionModel = class {
310
306
  get provider() {
311
307
  return this.config.provider;
312
308
  }
309
+ static [WORKFLOW_SERIALIZE](model) {
310
+ return serializeModelOptions({
311
+ modelId: model.modelId,
312
+ config: model.config
313
+ });
314
+ }
315
+ static [WORKFLOW_DESERIALIZE](options) {
316
+ return new _GladiaTranscriptionModel(options.modelId, options.config);
317
+ }
313
318
  async getArgs({
314
319
  providerOptions
315
320
  }) {
316
321
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N;
317
322
  const warnings = [];
318
- const gladiaOptions = await (0, import_provider_utils2.parseProviderOptions)({
323
+ const gladiaOptions = await parseProviderOptions({
319
324
  provider: "gladia",
320
325
  providerOptions,
321
326
  schema: gladiaTranscriptionModelOptionsSchema
@@ -416,49 +421,50 @@ var GladiaTranscriptionModel = class {
416
421
  };
417
422
  }
418
423
  async doGenerate(options) {
419
- var _a, _b, _c;
424
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
420
425
  const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
421
426
  const formData = new FormData();
422
- const blob = options.audio instanceof Uint8Array ? new Blob([options.audio]) : new Blob([(0, import_provider_utils2.convertBase64ToUint8Array)(options.audio)]);
423
- const fileExtension = (0, import_provider_utils2.mediaTypeToExtension)(options.mediaType);
427
+ const blob = options.audio instanceof Uint8Array ? new Blob([options.audio]) : new Blob([convertBase64ToUint8Array(options.audio)]);
428
+ const fileExtension = mediaTypeToExtension(options.mediaType);
424
429
  formData.append(
425
430
  "audio",
426
431
  new File([blob], "audio", { type: options.mediaType }),
427
432
  `audio.${fileExtension}`
428
433
  );
429
- const { value: uploadResponse } = await (0, import_provider_utils2.postFormDataToApi)({
434
+ const { value: uploadResponse } = await postFormDataToApi({
430
435
  url: this.config.url({
431
436
  path: "/v2/upload",
432
437
  modelId: "default"
433
438
  }),
434
- headers: (0, import_provider_utils2.combineHeaders)(this.config.headers(), options.headers),
439
+ headers: combineHeaders((_e = (_d = this.config).headers) == null ? void 0 : _e.call(_d), options.headers),
435
440
  formData,
436
441
  failedResponseHandler: gladiaFailedResponseHandler,
437
- successfulResponseHandler: (0, import_provider_utils2.createJsonResponseHandler)(
442
+ successfulResponseHandler: createJsonResponseHandler(
438
443
  gladiaUploadResponseSchema
439
444
  ),
440
445
  abortSignal: options.abortSignal,
441
446
  fetch: this.config.fetch
442
447
  });
443
448
  const { body, warnings } = await this.getArgs(options);
444
- const { value: transcriptionInitResponse } = await (0, import_provider_utils2.postJsonToApi)({
449
+ const { value: transcriptionInitResponse } = await postJsonToApi({
445
450
  url: this.config.url({
446
451
  path: "/v2/pre-recorded",
447
452
  modelId: "default"
448
453
  }),
449
- headers: (0, import_provider_utils2.combineHeaders)(this.config.headers(), options.headers),
454
+ headers: combineHeaders((_g = (_f = this.config).headers) == null ? void 0 : _g.call(_f), options.headers),
450
455
  body: {
451
456
  ...body,
452
457
  audio_url: uploadResponse.audio_url
453
458
  },
454
459
  failedResponseHandler: gladiaFailedResponseHandler,
455
- successfulResponseHandler: (0, import_provider_utils2.createJsonResponseHandler)(
460
+ successfulResponseHandler: createJsonResponseHandler(
456
461
  gladiaTranscriptionInitializeResponseSchema
457
462
  ),
458
463
  abortSignal: options.abortSignal,
459
464
  fetch: this.config.fetch
460
465
  });
461
466
  const resultUrl = transcriptionInitResponse.result_url;
467
+ const apiOrigin = this.config.url({ modelId: "default", path: "" });
462
468
  let transcriptionResult;
463
469
  let transcriptionResultHeaders;
464
470
  const timeoutMs = 60 * 1e3;
@@ -466,17 +472,17 @@ var GladiaTranscriptionModel = class {
466
472
  const pollingInterval = 1e3;
467
473
  while (true) {
468
474
  if (Date.now() - startTime > timeoutMs) {
469
- throw new import_provider.AISDKError({
475
+ throw new AISDKError({
470
476
  message: "Transcription job polling timed out",
471
477
  name: "TranscriptionJobPollingTimedOut",
472
478
  cause: transcriptionResult
473
479
  });
474
480
  }
475
- const response = await (0, import_provider_utils2.getFromApi)({
481
+ const response = await getFromApi({
476
482
  url: resultUrl,
477
- headers: (0, import_provider_utils2.combineHeaders)(this.config.headers(), options.headers),
483
+ headers: isSameOrigin(resultUrl, apiOrigin) ? combineHeaders((_i = (_h = this.config).headers) == null ? void 0 : _i.call(_h), options.headers) : void 0,
478
484
  failedResponseHandler: gladiaFailedResponseHandler,
479
- successfulResponseHandler: (0, import_provider_utils2.createJsonResponseHandler)(
485
+ successfulResponseHandler: createJsonResponseHandler(
480
486
  gladiaTranscriptionResultResponseSchema
481
487
  ),
482
488
  abortSignal: options.abortSignal,
@@ -488,16 +494,16 @@ var GladiaTranscriptionModel = class {
488
494
  break;
489
495
  }
490
496
  if (transcriptionResult.status === "error") {
491
- throw new import_provider.AISDKError({
497
+ throw new AISDKError({
492
498
  message: "Transcription job failed",
493
499
  name: "TranscriptionJobFailed",
494
500
  cause: transcriptionResult
495
501
  });
496
502
  }
497
- await (0, import_provider_utils2.delay)(pollingInterval);
503
+ await delay(pollingInterval);
498
504
  }
499
505
  if (!transcriptionResult.result) {
500
- throw new import_provider.AISDKError({
506
+ throw new AISDKError({
501
507
  message: "Transcription result is empty",
502
508
  name: "TranscriptionResultEmpty",
503
509
  cause: transcriptionResult
@@ -526,26 +532,26 @@ var GladiaTranscriptionModel = class {
526
532
  };
527
533
  }
528
534
  };
529
- var gladiaUploadResponseSchema = import_v42.z.object({
530
- audio_url: import_v42.z.string()
535
+ var gladiaUploadResponseSchema = z3.object({
536
+ audio_url: z3.string()
531
537
  });
532
- var gladiaTranscriptionInitializeResponseSchema = import_v42.z.object({
533
- result_url: import_v42.z.string()
538
+ var gladiaTranscriptionInitializeResponseSchema = z3.object({
539
+ result_url: z3.string()
534
540
  });
535
- var gladiaTranscriptionResultResponseSchema = import_v42.z.object({
536
- status: import_v42.z.enum(["queued", "processing", "done", "error"]),
537
- result: import_v42.z.object({
538
- metadata: import_v42.z.object({
539
- audio_duration: import_v42.z.number()
541
+ var gladiaTranscriptionResultResponseSchema = z3.object({
542
+ status: z3.enum(["queued", "processing", "done", "error"]),
543
+ result: z3.object({
544
+ metadata: z3.object({
545
+ audio_duration: z3.number()
540
546
  }),
541
- transcription: import_v42.z.object({
542
- full_transcript: import_v42.z.string(),
543
- languages: import_v42.z.array(import_v42.z.string()),
544
- utterances: import_v42.z.array(
545
- import_v42.z.object({
546
- start: import_v42.z.number(),
547
- end: import_v42.z.number(),
548
- text: import_v42.z.string()
547
+ transcription: z3.object({
548
+ full_transcript: z3.string(),
549
+ languages: z3.array(z3.string()),
550
+ utterances: z3.array(
551
+ z3.object({
552
+ start: z3.number(),
553
+ end: z3.number(),
554
+ text: z3.string()
549
555
  })
550
556
  )
551
557
  })
@@ -553,13 +559,13 @@ var gladiaTranscriptionResultResponseSchema = import_v42.z.object({
553
559
  });
554
560
 
555
561
  // src/version.ts
556
- var VERSION = true ? "3.0.0-beta.5" : "0.0.0-test";
562
+ var VERSION = true ? "3.0.0-beta.50" : "0.0.0-test";
557
563
 
558
564
  // src/gladia-provider.ts
559
565
  function createGladia(options = {}) {
560
- const getHeaders = () => (0, import_provider_utils3.withUserAgentSuffix)(
566
+ const getHeaders = () => withUserAgentSuffix(
561
567
  {
562
- "x-gladia-key": (0, import_provider_utils3.loadApiKey)({
568
+ "x-gladia-key": loadApiKey({
563
569
  apiKey: options.apiKey,
564
570
  environmentVariableName: "GLADIA_API_KEY",
565
571
  description: "Gladia"
@@ -583,14 +589,14 @@ function createGladia(options = {}) {
583
589
  provider.transcription = createTranscriptionModel;
584
590
  provider.transcriptionModel = createTranscriptionModel;
585
591
  provider.languageModel = (modelId) => {
586
- throw new import_provider2.NoSuchModelError({
592
+ throw new NoSuchModelError({
587
593
  modelId,
588
594
  modelType: "languageModel",
589
595
  message: "Gladia does not provide language models"
590
596
  });
591
597
  };
592
598
  provider.embeddingModel = (modelId) => {
593
- throw new import_provider2.NoSuchModelError({
599
+ throw new NoSuchModelError({
594
600
  modelId,
595
601
  modelType: "embeddingModel",
596
602
  message: "Gladia does not provide embedding models"
@@ -598,7 +604,7 @@ function createGladia(options = {}) {
598
604
  };
599
605
  provider.textEmbeddingModel = provider.embeddingModel;
600
606
  provider.imageModel = (modelId) => {
601
- throw new import_provider2.NoSuchModelError({
607
+ throw new NoSuchModelError({
602
608
  modelId,
603
609
  modelType: "imageModel",
604
610
  message: "Gladia does not provide image models"
@@ -607,10 +613,9 @@ function createGladia(options = {}) {
607
613
  return provider;
608
614
  }
609
615
  var gladia = createGladia();
610
- // Annotate the CommonJS export names for ESM import in node:
611
- 0 && (module.exports = {
616
+ export {
612
617
  VERSION,
613
618
  createGladia,
614
619
  gladia
615
- });
620
+ };
616
621
  //# sourceMappingURL=index.js.map