@ai-sdk/assemblyai 3.0.0-beta.20 → 3.0.0-beta.22

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,34 @@
1
1
  # @ai-sdk/assemblyai
2
2
 
3
+ ## 3.0.0-beta.22
4
+
5
+ ### Patch Changes
6
+
7
+ - b3976a2: Add workflow serialization support to all provider models.
8
+
9
+ **`@ai-sdk/provider-utils`:** New `serializeModel()` helper that extracts only serializable properties from a model instance, filtering out functions and objects containing functions. Third-party provider authors can use this to add workflow support to their own models.
10
+
11
+ **All providers:** `headers` is now optional in provider config types. This is non-breaking — existing code that passes `headers` continues to work. Custom provider implementations that construct model configs manually can now omit `headers`, which is useful when models are deserialized from a workflow step boundary where auth is provided separately.
12
+
13
+ All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
14
+
15
+ - Updated dependencies [b3976a2]
16
+ - Updated dependencies [ff5eba1]
17
+ - @ai-sdk/provider-utils@5.0.0-beta.20
18
+ - @ai-sdk/provider@4.0.0-beta.12
19
+
20
+ ## 3.0.0-beta.21
21
+
22
+ ### Major Changes
23
+
24
+ - ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
25
+
26
+ ### Patch Changes
27
+
28
+ - Updated dependencies [ef992f8]
29
+ - @ai-sdk/provider@4.0.0-beta.11
30
+ - @ai-sdk/provider-utils@5.0.0-beta.19
31
+
3
32
  ## 3.0.0-beta.20
4
33
 
5
34
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
+ import * as _ai_sdk_provider from '@ai-sdk/provider';
1
2
  import { TranscriptionModelV4, ProviderV4 } from '@ai-sdk/provider';
2
- import { FetchFunction } from '@ai-sdk/provider-utils';
3
+ import { FetchFunction, WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@ai-sdk/provider-utils';
3
4
  import { z } from 'zod/v4';
4
5
 
5
6
  type AssemblyAIConfig = {
@@ -8,12 +9,12 @@ type AssemblyAIConfig = {
8
9
  modelId: string;
9
10
  path: string;
10
11
  }) => string;
11
- headers: () => Record<string, string | undefined>;
12
+ headers?: () => Record<string, string | undefined>;
12
13
  fetch?: FetchFunction;
13
14
  generateId?: () => string;
14
15
  };
15
16
 
16
- type AssemblyAITranscriptionModelId = 'best' | 'nano';
17
+ type AssemblyAITranscriptionModelId = 'best' | 'nano' | (string & {});
17
18
 
18
19
  declare const assemblyaiTranscriptionModelOptionsSchema: z.ZodObject<{
19
20
  audioEndAt: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
@@ -70,6 +71,14 @@ declare class AssemblyAITranscriptionModel implements TranscriptionModelV4 {
70
71
  readonly specificationVersion = "v4";
71
72
  private readonly POLLING_INTERVAL_MS;
72
73
  get provider(): string;
74
+ static [WORKFLOW_SERIALIZE](model: AssemblyAITranscriptionModel): {
75
+ modelId: string;
76
+ config: _ai_sdk_provider.JSONObject;
77
+ };
78
+ static [WORKFLOW_DESERIALIZE](options: {
79
+ modelId: AssemblyAITranscriptionModelId;
80
+ config: AssemblyAITranscriptionModelConfig;
81
+ }): AssemblyAITranscriptionModel;
73
82
  constructor(modelId: AssemblyAITranscriptionModelId, config: AssemblyAITranscriptionModelConfig);
74
83
  private getArgs;
75
84
  /**
package/dist/index.js CHANGED
@@ -1,199 +1,186 @@
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
- assemblyai: () => assemblyai,
25
- createAssemblyAI: () => createAssemblyAI
26
- });
27
- module.exports = __toCommonJS(index_exports);
28
-
29
1
  // src/assemblyai-provider.ts
30
- var import_provider = 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/assemblyai-transcription-model.ts
34
- var import_provider_utils2 = require("@ai-sdk/provider-utils");
35
- var import_v42 = require("zod/v4");
11
+ import {
12
+ combineHeaders,
13
+ createJsonResponseHandler,
14
+ extractResponseHeaders,
15
+ parseProviderOptions,
16
+ postJsonToApi,
17
+ postToApi,
18
+ serializeModelOptions,
19
+ WORKFLOW_SERIALIZE,
20
+ WORKFLOW_DESERIALIZE
21
+ } from "@ai-sdk/provider-utils";
22
+ import { z as z2 } from "zod/v4";
36
23
 
37
24
  // src/assemblyai-error.ts
38
- var import_v4 = require("zod/v4");
39
- var import_provider_utils = require("@ai-sdk/provider-utils");
40
- var assemblyaiErrorDataSchema = import_v4.z.object({
41
- error: import_v4.z.object({
42
- message: import_v4.z.string(),
43
- code: import_v4.z.number()
25
+ import { z } from "zod/v4";
26
+ import { createJsonErrorResponseHandler } from "@ai-sdk/provider-utils";
27
+ var assemblyaiErrorDataSchema = z.object({
28
+ error: z.object({
29
+ message: z.string(),
30
+ code: z.number()
44
31
  })
45
32
  });
46
- var assemblyaiFailedResponseHandler = (0, import_provider_utils.createJsonErrorResponseHandler)({
33
+ var assemblyaiFailedResponseHandler = createJsonErrorResponseHandler({
47
34
  errorSchema: assemblyaiErrorDataSchema,
48
35
  errorToMessage: (data) => data.error.message
49
36
  });
50
37
 
51
38
  // src/assemblyai-transcription-model.ts
52
- var assemblyaiTranscriptionModelOptionsSchema = import_v42.z.object({
39
+ var assemblyaiTranscriptionModelOptionsSchema = z2.object({
53
40
  /**
54
41
  * End time of the audio in milliseconds.
55
42
  */
56
- audioEndAt: import_v42.z.number().int().nullish(),
43
+ audioEndAt: z2.number().int().nullish(),
57
44
  /**
58
45
  * Start time of the audio in milliseconds.
59
46
  */
60
- audioStartFrom: import_v42.z.number().int().nullish(),
47
+ audioStartFrom: z2.number().int().nullish(),
61
48
  /**
62
49
  * Whether to automatically generate chapters for the transcription.
63
50
  */
64
- autoChapters: import_v42.z.boolean().nullish(),
51
+ autoChapters: z2.boolean().nullish(),
65
52
  /**
66
53
  * Whether to automatically generate highlights for the transcription.
67
54
  */
68
- autoHighlights: import_v42.z.boolean().nullish(),
55
+ autoHighlights: z2.boolean().nullish(),
69
56
  /**
70
57
  * Boost parameter for the transcription.
71
58
  * Allowed values: 'low', 'default', 'high'.
72
59
  */
73
- boostParam: import_v42.z.string().nullish(),
60
+ boostParam: z2.string().nullish(),
74
61
  /**
75
62
  * Whether to enable content safety filtering.
76
63
  */
77
- contentSafety: import_v42.z.boolean().nullish(),
64
+ contentSafety: z2.boolean().nullish(),
78
65
  /**
79
66
  * Confidence threshold for content safety filtering (25-100).
80
67
  */
81
- contentSafetyConfidence: import_v42.z.number().int().min(25).max(100).nullish(),
68
+ contentSafetyConfidence: z2.number().int().min(25).max(100).nullish(),
82
69
  /**
83
70
  * Custom spelling rules for the transcription.
84
71
  */
85
- customSpelling: import_v42.z.array(
86
- import_v42.z.object({
87
- from: import_v42.z.array(import_v42.z.string()),
88
- to: import_v42.z.string()
72
+ customSpelling: z2.array(
73
+ z2.object({
74
+ from: z2.array(z2.string()),
75
+ to: z2.string()
89
76
  })
90
77
  ).nullish(),
91
78
  /**
92
79
  * Whether to include filler words (um, uh, etc.) in the transcription.
93
80
  */
94
- disfluencies: import_v42.z.boolean().nullish(),
81
+ disfluencies: z2.boolean().nullish(),
95
82
  /**
96
83
  * Whether to enable entity detection.
97
84
  */
98
- entityDetection: import_v42.z.boolean().nullish(),
85
+ entityDetection: z2.boolean().nullish(),
99
86
  /**
100
87
  * Whether to filter profanity from the transcription.
101
88
  */
102
- filterProfanity: import_v42.z.boolean().nullish(),
89
+ filterProfanity: z2.boolean().nullish(),
103
90
  /**
104
91
  * Whether to format text with punctuation and capitalization.
105
92
  */
106
- formatText: import_v42.z.boolean().nullish(),
93
+ formatText: z2.boolean().nullish(),
107
94
  /**
108
95
  * Whether to enable IAB categories detection.
109
96
  */
110
- iabCategories: import_v42.z.boolean().nullish(),
97
+ iabCategories: z2.boolean().nullish(),
111
98
  /**
112
99
  * Language code for the transcription.
113
100
  */
114
- languageCode: import_v42.z.union([import_v42.z.literal("en"), import_v42.z.string()]).nullish(),
101
+ languageCode: z2.union([z2.literal("en"), z2.string()]).nullish(),
115
102
  /**
116
103
  * Confidence threshold for language detection.
117
104
  */
118
- languageConfidenceThreshold: import_v42.z.number().nullish(),
105
+ languageConfidenceThreshold: z2.number().nullish(),
119
106
  /**
120
107
  * Whether to enable language detection.
121
108
  */
122
- languageDetection: import_v42.z.boolean().nullish(),
109
+ languageDetection: z2.boolean().nullish(),
123
110
  /**
124
111
  * Whether to process audio as multichannel.
125
112
  */
126
- multichannel: import_v42.z.boolean().nullish(),
113
+ multichannel: z2.boolean().nullish(),
127
114
  /**
128
115
  * Whether to add punctuation to the transcription.
129
116
  */
130
- punctuate: import_v42.z.boolean().nullish(),
117
+ punctuate: z2.boolean().nullish(),
131
118
  /**
132
119
  * Whether to redact personally identifiable information (PII).
133
120
  */
134
- redactPii: import_v42.z.boolean().nullish(),
121
+ redactPii: z2.boolean().nullish(),
135
122
  /**
136
123
  * Whether to redact PII in the audio file.
137
124
  */
138
- redactPiiAudio: import_v42.z.boolean().nullish(),
125
+ redactPiiAudio: z2.boolean().nullish(),
139
126
  /**
140
127
  * Audio format for PII redaction.
141
128
  */
142
- redactPiiAudioQuality: import_v42.z.string().nullish(),
129
+ redactPiiAudioQuality: z2.string().nullish(),
143
130
  /**
144
131
  * List of PII types to redact.
145
132
  */
146
- redactPiiPolicies: import_v42.z.array(import_v42.z.string()).nullish(),
133
+ redactPiiPolicies: z2.array(z2.string()).nullish(),
147
134
  /**
148
135
  * Substitution method for redacted PII.
149
136
  */
150
- redactPiiSub: import_v42.z.string().nullish(),
137
+ redactPiiSub: z2.string().nullish(),
151
138
  /**
152
139
  * Whether to enable sentiment analysis.
153
140
  */
154
- sentimentAnalysis: import_v42.z.boolean().nullish(),
141
+ sentimentAnalysis: z2.boolean().nullish(),
155
142
  /**
156
143
  * Whether to identify different speakers in the audio.
157
144
  */
158
- speakerLabels: import_v42.z.boolean().nullish(),
145
+ speakerLabels: z2.boolean().nullish(),
159
146
  /**
160
147
  * Number of speakers expected in the audio.
161
148
  */
162
- speakersExpected: import_v42.z.number().int().nullish(),
149
+ speakersExpected: z2.number().int().nullish(),
163
150
  /**
164
151
  * Threshold for speech detection (0-1).
165
152
  */
166
- speechThreshold: import_v42.z.number().min(0).max(1).nullish(),
153
+ speechThreshold: z2.number().min(0).max(1).nullish(),
167
154
  /**
168
155
  * Whether to generate a summary of the transcription.
169
156
  */
170
- summarization: import_v42.z.boolean().nullish(),
157
+ summarization: z2.boolean().nullish(),
171
158
  /**
172
159
  * Model to use for summarization.
173
160
  */
174
- summaryModel: import_v42.z.string().nullish(),
161
+ summaryModel: z2.string().nullish(),
175
162
  /**
176
163
  * Type of summary to generate.
177
164
  */
178
- summaryType: import_v42.z.string().nullish(),
165
+ summaryType: z2.string().nullish(),
179
166
  /**
180
167
  * Name of the authentication header for webhook requests.
181
168
  */
182
- webhookAuthHeaderName: import_v42.z.string().nullish(),
169
+ webhookAuthHeaderName: z2.string().nullish(),
183
170
  /**
184
171
  * Value of the authentication header for webhook requests.
185
172
  */
186
- webhookAuthHeaderValue: import_v42.z.string().nullish(),
173
+ webhookAuthHeaderValue: z2.string().nullish(),
187
174
  /**
188
175
  * URL to send webhook notifications to.
189
176
  */
190
- webhookUrl: import_v42.z.string().nullish(),
177
+ webhookUrl: z2.string().nullish(),
191
178
  /**
192
179
  * List of words to boost recognition for.
193
180
  */
194
- wordBoost: import_v42.z.array(import_v42.z.string()).nullish()
181
+ wordBoost: z2.array(z2.string()).nullish()
195
182
  });
196
- var AssemblyAITranscriptionModel = class {
183
+ var AssemblyAITranscriptionModel = class _AssemblyAITranscriptionModel {
197
184
  constructor(modelId, config) {
198
185
  this.modelId = modelId;
199
186
  this.config = config;
@@ -203,12 +190,21 @@ var AssemblyAITranscriptionModel = class {
203
190
  get provider() {
204
191
  return this.config.provider;
205
192
  }
193
+ static [WORKFLOW_SERIALIZE](model) {
194
+ return serializeModelOptions({
195
+ modelId: model.modelId,
196
+ config: model.config
197
+ });
198
+ }
199
+ static [WORKFLOW_DESERIALIZE](options) {
200
+ return new _AssemblyAITranscriptionModel(options.modelId, options.config);
201
+ }
206
202
  async getArgs({
207
203
  providerOptions
208
204
  }) {
209
205
  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;
210
206
  const warnings = [];
211
- const assemblyaiOptions = await (0, import_provider_utils2.parseProviderOptions)({
207
+ const assemblyaiOptions = await parseProviderOptions({
212
208
  provider: "assemblyai",
213
209
  providerOptions,
214
210
  schema: assemblyaiTranscriptionModelOptionsSchema
@@ -263,7 +259,7 @@ var AssemblyAITranscriptionModel = class {
263
259
  * @see https://www.assemblyai.com/docs/getting-started/transcribe-an-audio-file#step-33
264
260
  */
265
261
  async waitForCompletion(transcriptId, headers, abortSignal) {
266
- var _a, _b;
262
+ var _a, _b, _c, _d;
267
263
  const pollingInterval = (_a = this.config.pollingInterval) != null ? _a : this.POLLING_INTERVAL_MS;
268
264
  while (true) {
269
265
  if (abortSignal == null ? void 0 : abortSignal.aborted) {
@@ -276,8 +272,8 @@ var AssemblyAITranscriptionModel = class {
276
272
  }),
277
273
  {
278
274
  method: "GET",
279
- headers: (0, import_provider_utils2.combineHeaders)(
280
- this.config.headers(),
275
+ headers: combineHeaders(
276
+ (_c = (_b = this.config).headers) == null ? void 0 : _c.call(_b),
281
277
  headers
282
278
  ),
283
279
  signal: abortSignal
@@ -299,53 +295,53 @@ var AssemblyAITranscriptionModel = class {
299
295
  if (transcript.status === "completed") {
300
296
  return {
301
297
  transcript,
302
- responseHeaders: (0, import_provider_utils2.extractResponseHeaders)(response)
298
+ responseHeaders: extractResponseHeaders(response)
303
299
  };
304
300
  }
305
301
  if (transcript.status === "error") {
306
302
  throw new Error(
307
- `Transcription failed: ${(_b = transcript.error) != null ? _b : "Unknown error"}`
303
+ `Transcription failed: ${(_d = transcript.error) != null ? _d : "Unknown error"}`
308
304
  );
309
305
  }
310
306
  await new Promise((resolve) => setTimeout(resolve, pollingInterval));
311
307
  }
312
308
  }
313
309
  async doGenerate(options) {
314
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
310
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
315
311
  const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
316
- const { value: uploadResponse } = await (0, import_provider_utils2.postToApi)({
312
+ const { value: uploadResponse } = await postToApi({
317
313
  url: this.config.url({
318
314
  path: "/v2/upload",
319
315
  modelId: ""
320
316
  }),
321
317
  headers: {
322
318
  "Content-Type": "application/octet-stream",
323
- ...(0, import_provider_utils2.combineHeaders)(this.config.headers(), options.headers)
319
+ ...combineHeaders((_e = (_d = this.config).headers) == null ? void 0 : _e.call(_d), options.headers)
324
320
  },
325
321
  body: {
326
322
  content: options.audio,
327
323
  values: options.audio
328
324
  },
329
325
  failedResponseHandler: assemblyaiFailedResponseHandler,
330
- successfulResponseHandler: (0, import_provider_utils2.createJsonResponseHandler)(
326
+ successfulResponseHandler: createJsonResponseHandler(
331
327
  assemblyaiUploadResponseSchema
332
328
  ),
333
329
  abortSignal: options.abortSignal,
334
330
  fetch: this.config.fetch
335
331
  });
336
332
  const { body, warnings } = await this.getArgs(options);
337
- const { value: submitResponse } = await (0, import_provider_utils2.postJsonToApi)({
333
+ const { value: submitResponse } = await postJsonToApi({
338
334
  url: this.config.url({
339
335
  path: "/v2/transcript",
340
336
  modelId: this.modelId
341
337
  }),
342
- headers: (0, import_provider_utils2.combineHeaders)(this.config.headers(), options.headers),
338
+ headers: combineHeaders((_g = (_f = this.config).headers) == null ? void 0 : _g.call(_f), options.headers),
343
339
  body: {
344
340
  ...body,
345
341
  audio_url: uploadResponse.upload_url
346
342
  },
347
343
  failedResponseHandler: assemblyaiFailedResponseHandler,
348
- successfulResponseHandler: (0, import_provider_utils2.createJsonResponseHandler)(
344
+ successfulResponseHandler: createJsonResponseHandler(
349
345
  assemblyaiSubmitResponseSchema
350
346
  ),
351
347
  abortSignal: options.abortSignal,
@@ -357,14 +353,14 @@ var AssemblyAITranscriptionModel = class {
357
353
  options.abortSignal
358
354
  );
359
355
  return {
360
- text: (_d = transcript.text) != null ? _d : "",
361
- segments: (_f = (_e = transcript.words) == null ? void 0 : _e.map((word) => ({
356
+ text: (_h = transcript.text) != null ? _h : "",
357
+ segments: (_j = (_i = transcript.words) == null ? void 0 : _i.map((word) => ({
362
358
  text: word.text,
363
359
  startSecond: word.start,
364
360
  endSecond: word.end
365
- }))) != null ? _f : [],
366
- language: (_g = transcript.language_code) != null ? _g : void 0,
367
- durationInSeconds: (_k = (_j = transcript.audio_duration) != null ? _j : (_i = (_h = transcript.words) == null ? void 0 : _h.at(-1)) == null ? void 0 : _i.end) != null ? _k : void 0,
361
+ }))) != null ? _j : [],
362
+ language: (_k = transcript.language_code) != null ? _k : void 0,
363
+ durationInSeconds: (_o = (_n = transcript.audio_duration) != null ? _n : (_m = (_l = transcript.words) == null ? void 0 : _l.at(-1)) == null ? void 0 : _m.end) != null ? _o : void 0,
368
364
  warnings,
369
365
  response: {
370
366
  timestamp: currentDate,
@@ -377,37 +373,37 @@ var AssemblyAITranscriptionModel = class {
377
373
  };
378
374
  }
379
375
  };
380
- var assemblyaiUploadResponseSchema = import_v42.z.object({
381
- upload_url: import_v42.z.string()
376
+ var assemblyaiUploadResponseSchema = z2.object({
377
+ upload_url: z2.string()
382
378
  });
383
- var assemblyaiSubmitResponseSchema = import_v42.z.object({
384
- id: import_v42.z.string(),
385
- status: import_v42.z.enum(["queued", "processing", "completed", "error"])
379
+ var assemblyaiSubmitResponseSchema = z2.object({
380
+ id: z2.string(),
381
+ status: z2.enum(["queued", "processing", "completed", "error"])
386
382
  });
387
- var assemblyaiTranscriptionResponseSchema = import_v42.z.object({
388
- id: import_v42.z.string(),
389
- status: import_v42.z.enum(["queued", "processing", "completed", "error"]),
390
- text: import_v42.z.string().nullish(),
391
- language_code: import_v42.z.string().nullish(),
392
- words: import_v42.z.array(
393
- import_v42.z.object({
394
- start: import_v42.z.number(),
395
- end: import_v42.z.number(),
396
- text: import_v42.z.string()
383
+ var assemblyaiTranscriptionResponseSchema = z2.object({
384
+ id: z2.string(),
385
+ status: z2.enum(["queued", "processing", "completed", "error"]),
386
+ text: z2.string().nullish(),
387
+ language_code: z2.string().nullish(),
388
+ words: z2.array(
389
+ z2.object({
390
+ start: z2.number(),
391
+ end: z2.number(),
392
+ text: z2.string()
397
393
  })
398
394
  ).nullish(),
399
- audio_duration: import_v42.z.number().nullish(),
400
- error: import_v42.z.string().nullish()
395
+ audio_duration: z2.number().nullish(),
396
+ error: z2.string().nullish()
401
397
  });
402
398
 
403
399
  // src/version.ts
404
- var VERSION = true ? "3.0.0-beta.20" : "0.0.0-test";
400
+ var VERSION = true ? "3.0.0-beta.22" : "0.0.0-test";
405
401
 
406
402
  // src/assemblyai-provider.ts
407
403
  function createAssemblyAI(options = {}) {
408
- const getHeaders = () => (0, import_provider_utils3.withUserAgentSuffix)(
404
+ const getHeaders = () => withUserAgentSuffix(
409
405
  {
410
- authorization: (0, import_provider_utils3.loadApiKey)({
406
+ authorization: loadApiKey({
411
407
  apiKey: options.apiKey,
412
408
  environmentVariableName: "ASSEMBLYAI_API_KEY",
413
409
  description: "AssemblyAI"
@@ -431,26 +427,25 @@ function createAssemblyAI(options = {}) {
431
427
  provider.transcription = createTranscriptionModel;
432
428
  provider.transcriptionModel = createTranscriptionModel;
433
429
  provider.languageModel = () => {
434
- throw new import_provider.NoSuchModelError({
430
+ throw new NoSuchModelError({
435
431
  modelId: "unknown",
436
432
  modelType: "languageModel",
437
433
  message: "AssemblyAI does not provide language models"
438
434
  });
439
435
  };
440
436
  provider.embeddingModel = (modelId) => {
441
- throw new import_provider.NoSuchModelError({ modelId, modelType: "embeddingModel" });
437
+ throw new NoSuchModelError({ modelId, modelType: "embeddingModel" });
442
438
  };
443
439
  provider.textEmbeddingModel = provider.embeddingModel;
444
440
  provider.imageModel = (modelId) => {
445
- throw new import_provider.NoSuchModelError({ modelId, modelType: "imageModel" });
441
+ throw new NoSuchModelError({ modelId, modelType: "imageModel" });
446
442
  };
447
443
  return provider;
448
444
  }
449
445
  var assemblyai = createAssemblyAI();
450
- // Annotate the CommonJS export names for ESM import in node:
451
- 0 && (module.exports = {
446
+ export {
452
447
  VERSION,
453
448
  assemblyai,
454
449
  createAssemblyAI
455
- });
450
+ };
456
451
  //# sourceMappingURL=index.js.map