@ai-sdk/gladia 3.0.0-beta.9 → 3.0.0-canary.32

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