@ai-sdk/revai 3.0.0-beta.5 → 3.0.0-beta.51
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 +382 -4
- package/README.md +3 -1
- package/dist/index.d.ts +63 -53
- package/dist/index.js +128 -126
- package/dist/index.js.map +1 -1
- package/docs/160-revai.mdx +1 -7
- package/package.json +14 -14
- package/src/index.ts +1 -1
- package/src/revai-config.ts +2 -2
- package/src/revai-provider.ts +4 -4
- package/src/revai-transcription-model-options.ts +196 -0
- package/src/revai-transcription-model.ts +26 -203
- package/dist/index.d.mts +0 -148
- package/dist/index.mjs +0 -505
- package/dist/index.mjs.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,195 +1,187 @@
|
|
|
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
|
-
createRevai: () => createRevai,
|
|
25
|
-
revai: () => revai
|
|
26
|
-
});
|
|
27
|
-
module.exports = __toCommonJS(index_exports);
|
|
28
|
-
|
|
29
1
|
// src/revai-provider.ts
|
|
30
|
-
|
|
31
|
-
|
|
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/revai-transcription-model.ts
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
+
serializeModelOptions,
|
|
24
|
+
WORKFLOW_SERIALIZE,
|
|
25
|
+
WORKFLOW_DESERIALIZE
|
|
26
|
+
} from "@ai-sdk/provider-utils";
|
|
27
|
+
import { z as z3 } from "zod/v4";
|
|
37
28
|
|
|
38
29
|
// src/revai-error.ts
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
var revaiErrorDataSchema =
|
|
42
|
-
error:
|
|
43
|
-
message:
|
|
44
|
-
code:
|
|
30
|
+
import { z } from "zod/v4";
|
|
31
|
+
import { createJsonErrorResponseHandler } from "@ai-sdk/provider-utils";
|
|
32
|
+
var revaiErrorDataSchema = z.object({
|
|
33
|
+
error: z.object({
|
|
34
|
+
message: z.string(),
|
|
35
|
+
code: z.number()
|
|
45
36
|
})
|
|
46
37
|
});
|
|
47
|
-
var revaiFailedResponseHandler =
|
|
38
|
+
var revaiFailedResponseHandler = createJsonErrorResponseHandler({
|
|
48
39
|
errorSchema: revaiErrorDataSchema,
|
|
49
40
|
errorToMessage: (data) => data.error.message
|
|
50
41
|
});
|
|
51
42
|
|
|
52
|
-
// src/revai-transcription-model.ts
|
|
53
|
-
|
|
43
|
+
// src/revai-transcription-model-options.ts
|
|
44
|
+
import { z as z2 } from "zod/v4";
|
|
45
|
+
var revaiTranscriptionModelOptionsSchema = z2.object({
|
|
54
46
|
/**
|
|
55
47
|
* Optional metadata string to associate with the transcription job.
|
|
56
48
|
*/
|
|
57
|
-
metadata:
|
|
49
|
+
metadata: z2.string().nullish(),
|
|
58
50
|
/**
|
|
59
51
|
* Configuration for webhook notifications when job is complete.
|
|
60
52
|
*/
|
|
61
|
-
notification_config:
|
|
53
|
+
notification_config: z2.object({
|
|
62
54
|
/**
|
|
63
55
|
* URL to send the notification to.
|
|
64
56
|
*/
|
|
65
|
-
url:
|
|
57
|
+
url: z2.string(),
|
|
66
58
|
/**
|
|
67
59
|
* Optional authorization headers for the notification request.
|
|
68
60
|
*/
|
|
69
|
-
auth_headers:
|
|
70
|
-
Authorization:
|
|
61
|
+
auth_headers: z2.object({
|
|
62
|
+
Authorization: z2.string()
|
|
71
63
|
}).nullish()
|
|
72
64
|
}).nullish(),
|
|
73
65
|
/**
|
|
74
66
|
* Number of seconds after which the job will be automatically deleted.
|
|
75
67
|
*/
|
|
76
|
-
delete_after_seconds:
|
|
68
|
+
delete_after_seconds: z2.number().nullish(),
|
|
77
69
|
/**
|
|
78
70
|
* Whether to include filler words and false starts in the transcription.
|
|
79
71
|
*/
|
|
80
|
-
verbatim:
|
|
72
|
+
verbatim: z2.boolean().optional(),
|
|
81
73
|
/**
|
|
82
74
|
* Whether to prioritize the job for faster processing.
|
|
83
75
|
*/
|
|
84
|
-
rush:
|
|
76
|
+
rush: z2.boolean().nullish().default(false),
|
|
85
77
|
/**
|
|
86
78
|
* Whether to run the job in test mode.
|
|
87
79
|
*/
|
|
88
|
-
test_mode:
|
|
80
|
+
test_mode: z2.boolean().nullish().default(false),
|
|
89
81
|
/**
|
|
90
82
|
* Specific segments of the audio to transcribe.
|
|
91
83
|
*/
|
|
92
|
-
segments_to_transcribe:
|
|
93
|
-
|
|
84
|
+
segments_to_transcribe: z2.array(
|
|
85
|
+
z2.object({
|
|
94
86
|
/**
|
|
95
87
|
* Start time of the segment in seconds.
|
|
96
88
|
*/
|
|
97
|
-
start:
|
|
89
|
+
start: z2.number(),
|
|
98
90
|
/**
|
|
99
91
|
* End time of the segment in seconds.
|
|
100
92
|
*/
|
|
101
|
-
end:
|
|
93
|
+
end: z2.number()
|
|
102
94
|
})
|
|
103
95
|
).nullish(),
|
|
104
96
|
/**
|
|
105
97
|
* Names to assign to speakers in the transcription.
|
|
106
98
|
*/
|
|
107
|
-
speaker_names:
|
|
108
|
-
|
|
99
|
+
speaker_names: z2.array(
|
|
100
|
+
z2.object({
|
|
109
101
|
/**
|
|
110
102
|
* Display name for the speaker.
|
|
111
103
|
*/
|
|
112
|
-
display_name:
|
|
104
|
+
display_name: z2.string()
|
|
113
105
|
})
|
|
114
106
|
).nullish(),
|
|
115
107
|
/**
|
|
116
108
|
* Whether to skip speaker diarization.
|
|
117
109
|
*/
|
|
118
|
-
skip_diarization:
|
|
110
|
+
skip_diarization: z2.boolean().nullish().default(false),
|
|
119
111
|
/**
|
|
120
112
|
* Whether to skip post-processing steps.
|
|
121
113
|
*/
|
|
122
|
-
skip_postprocessing:
|
|
114
|
+
skip_postprocessing: z2.boolean().nullish().default(false),
|
|
123
115
|
/**
|
|
124
116
|
* Whether to skip adding punctuation to the transcription.
|
|
125
117
|
*/
|
|
126
|
-
skip_punctuation:
|
|
118
|
+
skip_punctuation: z2.boolean().nullish().default(false),
|
|
127
119
|
/**
|
|
128
120
|
* Whether to remove disfluencies (um, uh, etc.) from the transcription.
|
|
129
121
|
*/
|
|
130
|
-
remove_disfluencies:
|
|
122
|
+
remove_disfluencies: z2.boolean().nullish().default(false),
|
|
131
123
|
/**
|
|
132
124
|
* Whether to remove atmospheric sounds from the transcription.
|
|
133
125
|
*/
|
|
134
|
-
remove_atmospherics:
|
|
126
|
+
remove_atmospherics: z2.boolean().nullish().default(false),
|
|
135
127
|
/**
|
|
136
128
|
* Whether to filter profanity from the transcription.
|
|
137
129
|
*/
|
|
138
|
-
filter_profanity:
|
|
130
|
+
filter_profanity: z2.boolean().nullish().default(false),
|
|
139
131
|
/**
|
|
140
132
|
* Number of speaker channels in the audio.
|
|
141
133
|
*/
|
|
142
|
-
speaker_channels_count:
|
|
134
|
+
speaker_channels_count: z2.number().nullish(),
|
|
143
135
|
/**
|
|
144
136
|
* Expected number of speakers in the audio.
|
|
145
137
|
*/
|
|
146
|
-
speakers_count:
|
|
138
|
+
speakers_count: z2.number().nullish(),
|
|
147
139
|
/**
|
|
148
140
|
* Type of diarization to use.
|
|
149
141
|
*/
|
|
150
|
-
diarization_type:
|
|
142
|
+
diarization_type: z2.enum(["standard", "premium"]).nullish().default("standard"),
|
|
151
143
|
/**
|
|
152
144
|
* ID of a custom vocabulary to use for the transcription.
|
|
153
145
|
*/
|
|
154
|
-
custom_vocabulary_id:
|
|
146
|
+
custom_vocabulary_id: z2.string().nullish(),
|
|
155
147
|
/**
|
|
156
148
|
* Custom vocabularies to use for the transcription.
|
|
157
149
|
*/
|
|
158
|
-
custom_vocabularies:
|
|
150
|
+
custom_vocabularies: z2.array(z2.object({})).optional(),
|
|
159
151
|
/**
|
|
160
152
|
* Whether to strictly enforce custom vocabulary.
|
|
161
153
|
*/
|
|
162
|
-
strict_custom_vocabulary:
|
|
154
|
+
strict_custom_vocabulary: z2.boolean().optional(),
|
|
163
155
|
/**
|
|
164
156
|
* Configuration for generating a summary of the transcription.
|
|
165
157
|
*/
|
|
166
|
-
summarization_config:
|
|
158
|
+
summarization_config: z2.object({
|
|
167
159
|
/**
|
|
168
160
|
* Model to use for summarization.
|
|
169
161
|
*/
|
|
170
|
-
model:
|
|
162
|
+
model: z2.enum(["standard", "premium"]).nullish().default("standard"),
|
|
171
163
|
/**
|
|
172
164
|
* Format of the summary.
|
|
173
165
|
*/
|
|
174
|
-
type:
|
|
166
|
+
type: z2.enum(["paragraph", "bullets"]).nullish().default("paragraph"),
|
|
175
167
|
/**
|
|
176
168
|
* Custom prompt for the summarization.
|
|
177
169
|
*/
|
|
178
|
-
prompt:
|
|
170
|
+
prompt: z2.string().nullish()
|
|
179
171
|
}).nullish(),
|
|
180
172
|
/**
|
|
181
173
|
* Configuration for translating the transcription.
|
|
182
174
|
*/
|
|
183
|
-
translation_config:
|
|
175
|
+
translation_config: z2.object({
|
|
184
176
|
/**
|
|
185
177
|
* Target languages for translation.
|
|
186
178
|
*/
|
|
187
|
-
target_languages:
|
|
188
|
-
|
|
179
|
+
target_languages: z2.array(
|
|
180
|
+
z2.object({
|
|
189
181
|
/**
|
|
190
182
|
* Language code for translation target.
|
|
191
183
|
*/
|
|
192
|
-
language:
|
|
184
|
+
language: z2.enum([
|
|
193
185
|
"en",
|
|
194
186
|
"en-us",
|
|
195
187
|
"en-gb",
|
|
@@ -213,18 +205,20 @@ var revaiTranscriptionModelOptionsSchema = import_v42.z.object({
|
|
|
213
205
|
/**
|
|
214
206
|
* Model to use for translation.
|
|
215
207
|
*/
|
|
216
|
-
model:
|
|
208
|
+
model: z2.enum(["standard", "premium"]).nullish().default("standard")
|
|
217
209
|
}).nullish(),
|
|
218
210
|
/**
|
|
219
211
|
* Language of the audio content.
|
|
220
212
|
*/
|
|
221
|
-
language:
|
|
213
|
+
language: z2.string().nullish().default("en"),
|
|
222
214
|
/**
|
|
223
215
|
* Whether to perform forced alignment.
|
|
224
216
|
*/
|
|
225
|
-
forced_alignment:
|
|
217
|
+
forced_alignment: z2.boolean().nullish().default(false)
|
|
226
218
|
});
|
|
227
|
-
|
|
219
|
+
|
|
220
|
+
// src/revai-transcription-model.ts
|
|
221
|
+
var RevaiTranscriptionModel = class _RevaiTranscriptionModel {
|
|
228
222
|
constructor(modelId, config) {
|
|
229
223
|
this.modelId = modelId;
|
|
230
224
|
this.config = config;
|
|
@@ -233,6 +227,15 @@ var RevaiTranscriptionModel = class {
|
|
|
233
227
|
get provider() {
|
|
234
228
|
return this.config.provider;
|
|
235
229
|
}
|
|
230
|
+
static [WORKFLOW_SERIALIZE](model) {
|
|
231
|
+
return serializeModelOptions({
|
|
232
|
+
modelId: model.modelId,
|
|
233
|
+
config: model.config
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
static [WORKFLOW_DESERIALIZE](options) {
|
|
237
|
+
return new _RevaiTranscriptionModel(options.modelId, options.config);
|
|
238
|
+
}
|
|
236
239
|
async getArgs({
|
|
237
240
|
audio,
|
|
238
241
|
mediaType,
|
|
@@ -240,14 +243,14 @@ var RevaiTranscriptionModel = class {
|
|
|
240
243
|
}) {
|
|
241
244
|
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;
|
|
242
245
|
const warnings = [];
|
|
243
|
-
const revaiOptions = await
|
|
246
|
+
const revaiOptions = await parseProviderOptions({
|
|
244
247
|
provider: "revai",
|
|
245
248
|
providerOptions,
|
|
246
249
|
schema: revaiTranscriptionModelOptionsSchema
|
|
247
250
|
});
|
|
248
251
|
const formData = new FormData();
|
|
249
|
-
const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([
|
|
250
|
-
const fileExtension =
|
|
252
|
+
const blob = audio instanceof Uint8Array ? new Blob([audio]) : new Blob([convertBase64ToUint8Array(audio)]);
|
|
253
|
+
const fileExtension = mediaTypeToExtension(mediaType);
|
|
251
254
|
formData.append(
|
|
252
255
|
"media",
|
|
253
256
|
new File([blob], "audio", { type: mediaType }),
|
|
@@ -297,25 +300,25 @@ var RevaiTranscriptionModel = class {
|
|
|
297
300
|
};
|
|
298
301
|
}
|
|
299
302
|
async doGenerate(options) {
|
|
300
|
-
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
303
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
|
|
301
304
|
const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
|
|
302
305
|
const { formData, warnings } = await this.getArgs(options);
|
|
303
|
-
const { value: submissionResponse } = await
|
|
306
|
+
const { value: submissionResponse } = await postFormDataToApi({
|
|
304
307
|
url: this.config.url({
|
|
305
308
|
path: "/speechtotext/v1/jobs",
|
|
306
309
|
modelId: this.modelId
|
|
307
310
|
}),
|
|
308
|
-
headers: (
|
|
311
|
+
headers: combineHeaders((_e = (_d = this.config).headers) == null ? void 0 : _e.call(_d), options.headers),
|
|
309
312
|
formData,
|
|
310
313
|
failedResponseHandler: revaiFailedResponseHandler,
|
|
311
|
-
successfulResponseHandler:
|
|
314
|
+
successfulResponseHandler: createJsonResponseHandler(
|
|
312
315
|
revaiTranscriptionJobResponseSchema
|
|
313
316
|
),
|
|
314
317
|
abortSignal: options.abortSignal,
|
|
315
318
|
fetch: this.config.fetch
|
|
316
319
|
});
|
|
317
320
|
if (submissionResponse.status === "failed") {
|
|
318
|
-
throw new
|
|
321
|
+
throw new AISDKError({
|
|
319
322
|
message: "Failed to submit transcription job to Rev.ai",
|
|
320
323
|
name: "TranscriptionJobSubmissionFailed",
|
|
321
324
|
cause: submissionResponse
|
|
@@ -328,20 +331,20 @@ var RevaiTranscriptionModel = class {
|
|
|
328
331
|
let jobResponse = submissionResponse;
|
|
329
332
|
while (jobResponse.status !== "transcribed") {
|
|
330
333
|
if (Date.now() - startTime > timeoutMs) {
|
|
331
|
-
throw new
|
|
334
|
+
throw new AISDKError({
|
|
332
335
|
message: "Transcription job polling timed out",
|
|
333
336
|
name: "TranscriptionJobPollingTimedOut",
|
|
334
337
|
cause: submissionResponse
|
|
335
338
|
});
|
|
336
339
|
}
|
|
337
|
-
const pollingResult = await
|
|
340
|
+
const pollingResult = await getFromApi({
|
|
338
341
|
url: this.config.url({
|
|
339
342
|
path: `/speechtotext/v1/jobs/${jobId}`,
|
|
340
343
|
modelId: this.modelId
|
|
341
344
|
}),
|
|
342
|
-
headers: (
|
|
345
|
+
headers: combineHeaders((_g = (_f = this.config).headers) == null ? void 0 : _g.call(_f), options.headers),
|
|
343
346
|
failedResponseHandler: revaiFailedResponseHandler,
|
|
344
|
-
successfulResponseHandler:
|
|
347
|
+
successfulResponseHandler: createJsonResponseHandler(
|
|
345
348
|
revaiTranscriptionJobResponseSchema
|
|
346
349
|
),
|
|
347
350
|
abortSignal: options.abortSignal,
|
|
@@ -349,28 +352,28 @@ var RevaiTranscriptionModel = class {
|
|
|
349
352
|
});
|
|
350
353
|
jobResponse = pollingResult.value;
|
|
351
354
|
if (jobResponse.status === "failed") {
|
|
352
|
-
throw new
|
|
355
|
+
throw new AISDKError({
|
|
353
356
|
message: "Transcription job failed",
|
|
354
357
|
name: "TranscriptionJobFailed",
|
|
355
358
|
cause: jobResponse
|
|
356
359
|
});
|
|
357
360
|
}
|
|
358
361
|
if (jobResponse.status !== "transcribed") {
|
|
359
|
-
await
|
|
362
|
+
await delay(pollingInterval);
|
|
360
363
|
}
|
|
361
364
|
}
|
|
362
365
|
const {
|
|
363
366
|
value: transcriptionResult,
|
|
364
367
|
responseHeaders,
|
|
365
368
|
rawValue: rawResponse
|
|
366
|
-
} = await
|
|
369
|
+
} = await getFromApi({
|
|
367
370
|
url: this.config.url({
|
|
368
371
|
path: `/speechtotext/v1/jobs/${jobId}/transcript`,
|
|
369
372
|
modelId: this.modelId
|
|
370
373
|
}),
|
|
371
|
-
headers: (
|
|
374
|
+
headers: combineHeaders((_i = (_h = this.config).headers) == null ? void 0 : _i.call(_h), options.headers),
|
|
372
375
|
failedResponseHandler: revaiFailedResponseHandler,
|
|
373
|
-
successfulResponseHandler:
|
|
376
|
+
successfulResponseHandler: createJsonResponseHandler(
|
|
374
377
|
revaiTranscriptionResponseSchema
|
|
375
378
|
),
|
|
376
379
|
abortSignal: options.abortSignal,
|
|
@@ -378,11 +381,11 @@ var RevaiTranscriptionModel = class {
|
|
|
378
381
|
});
|
|
379
382
|
let durationInSeconds = 0;
|
|
380
383
|
const segments = [];
|
|
381
|
-
for (const monologue of (
|
|
384
|
+
for (const monologue of (_j = transcriptionResult.monologues) != null ? _j : []) {
|
|
382
385
|
let currentSegmentText = "";
|
|
383
386
|
let segmentStartSecond = 0;
|
|
384
387
|
let hasStartedSegment = false;
|
|
385
|
-
for (const element of (
|
|
388
|
+
for (const element of (_k = monologue == null ? void 0 : monologue.elements) != null ? _k : []) {
|
|
386
389
|
currentSegmentText += element.value;
|
|
387
390
|
if (element.type === "text") {
|
|
388
391
|
if (element.end_ts && element.end_ts > durationInSeconds) {
|
|
@@ -415,14 +418,14 @@ var RevaiTranscriptionModel = class {
|
|
|
415
418
|
}
|
|
416
419
|
}
|
|
417
420
|
return {
|
|
418
|
-
text: (
|
|
421
|
+
text: (_m = (_l = transcriptionResult.monologues) == null ? void 0 : _l.map(
|
|
419
422
|
(monologue) => {
|
|
420
423
|
var _a2;
|
|
421
424
|
return (_a2 = monologue == null ? void 0 : monologue.elements) == null ? void 0 : _a2.map((element) => element.value).join("");
|
|
422
425
|
}
|
|
423
|
-
).join(" ")) != null ?
|
|
426
|
+
).join(" ")) != null ? _m : "",
|
|
424
427
|
segments,
|
|
425
|
-
language: (
|
|
428
|
+
language: (_n = submissionResponse.language) != null ? _n : void 0,
|
|
426
429
|
durationInSeconds,
|
|
427
430
|
warnings,
|
|
428
431
|
response: {
|
|
@@ -434,20 +437,20 @@ var RevaiTranscriptionModel = class {
|
|
|
434
437
|
};
|
|
435
438
|
}
|
|
436
439
|
};
|
|
437
|
-
var revaiTranscriptionJobResponseSchema =
|
|
438
|
-
id:
|
|
439
|
-
status:
|
|
440
|
-
language:
|
|
440
|
+
var revaiTranscriptionJobResponseSchema = z3.object({
|
|
441
|
+
id: z3.string().nullish(),
|
|
442
|
+
status: z3.string().nullish(),
|
|
443
|
+
language: z3.string().nullish()
|
|
441
444
|
});
|
|
442
|
-
var revaiTranscriptionResponseSchema =
|
|
443
|
-
monologues:
|
|
444
|
-
|
|
445
|
-
elements:
|
|
446
|
-
|
|
447
|
-
type:
|
|
448
|
-
value:
|
|
449
|
-
ts:
|
|
450
|
-
end_ts:
|
|
445
|
+
var revaiTranscriptionResponseSchema = z3.object({
|
|
446
|
+
monologues: z3.array(
|
|
447
|
+
z3.object({
|
|
448
|
+
elements: z3.array(
|
|
449
|
+
z3.object({
|
|
450
|
+
type: z3.string().nullish(),
|
|
451
|
+
value: z3.string().nullish(),
|
|
452
|
+
ts: z3.number().nullish(),
|
|
453
|
+
end_ts: z3.number().nullish()
|
|
451
454
|
})
|
|
452
455
|
).nullish()
|
|
453
456
|
})
|
|
@@ -455,13 +458,13 @@ var revaiTranscriptionResponseSchema = import_v42.z.object({
|
|
|
455
458
|
});
|
|
456
459
|
|
|
457
460
|
// src/version.ts
|
|
458
|
-
var VERSION = true ? "3.0.0-beta.
|
|
461
|
+
var VERSION = true ? "3.0.0-beta.51" : "0.0.0-test";
|
|
459
462
|
|
|
460
463
|
// src/revai-provider.ts
|
|
461
464
|
function createRevai(options = {}) {
|
|
462
|
-
const getHeaders = () =>
|
|
465
|
+
const getHeaders = () => withUserAgentSuffix(
|
|
463
466
|
{
|
|
464
|
-
authorization: `Bearer ${
|
|
467
|
+
authorization: `Bearer ${loadApiKey({
|
|
465
468
|
apiKey: options.apiKey,
|
|
466
469
|
environmentVariableName: "REVAI_API_KEY",
|
|
467
470
|
description: "Rev.ai"
|
|
@@ -485,14 +488,14 @@ function createRevai(options = {}) {
|
|
|
485
488
|
provider.transcription = createTranscriptionModel;
|
|
486
489
|
provider.transcriptionModel = createTranscriptionModel;
|
|
487
490
|
provider.languageModel = () => {
|
|
488
|
-
throw new
|
|
491
|
+
throw new NoSuchModelError({
|
|
489
492
|
modelId: "unknown",
|
|
490
493
|
modelType: "languageModel",
|
|
491
494
|
message: "Rev.ai does not provide language models"
|
|
492
495
|
});
|
|
493
496
|
};
|
|
494
497
|
provider.embeddingModel = () => {
|
|
495
|
-
throw new
|
|
498
|
+
throw new NoSuchModelError({
|
|
496
499
|
modelId: "unknown",
|
|
497
500
|
modelType: "embeddingModel",
|
|
498
501
|
message: "Rev.ai does not provide text embedding models"
|
|
@@ -500,7 +503,7 @@ function createRevai(options = {}) {
|
|
|
500
503
|
};
|
|
501
504
|
provider.textEmbeddingModel = provider.embeddingModel;
|
|
502
505
|
provider.imageModel = () => {
|
|
503
|
-
throw new
|
|
506
|
+
throw new NoSuchModelError({
|
|
504
507
|
modelId: "unknown",
|
|
505
508
|
modelType: "imageModel",
|
|
506
509
|
message: "Rev.ai does not provide image models"
|
|
@@ -509,10 +512,9 @@ function createRevai(options = {}) {
|
|
|
509
512
|
return provider;
|
|
510
513
|
}
|
|
511
514
|
var revai = createRevai();
|
|
512
|
-
|
|
513
|
-
0 && (module.exports = {
|
|
515
|
+
export {
|
|
514
516
|
VERSION,
|
|
515
517
|
createRevai,
|
|
516
518
|
revai
|
|
517
|
-
}
|
|
519
|
+
};
|
|
518
520
|
//# sourceMappingURL=index.js.map
|