@ai-sdk/gladia 3.0.0-beta.3 → 3.0.0-beta.30

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