@ai-sdk/gladia 3.0.0-beta.19 → 3.0.0-beta.20

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