@ai-sdk/revai 3.0.0-beta.9 → 3.0.0-canary.34
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 +216 -0
- package/README.md +2 -0
- package/dist/index.d.ts +63 -53
- package/dist/index.js +128 -126
- package/dist/index.js.map +1 -1
- package/package.json +11 -9
- 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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,221 @@
|
|
|
1
1
|
# @ai-sdk/revai
|
|
2
2
|
|
|
3
|
+
## 3.0.0-canary.34
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [5463d0d]
|
|
8
|
+
- @ai-sdk/provider-utils@5.0.0-canary.32
|
|
9
|
+
- @ai-sdk/provider@4.0.0-canary.16
|
|
10
|
+
|
|
11
|
+
## 3.0.0-canary.33
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- 0c4c275: trigger initial canary release
|
|
16
|
+
- Updated dependencies [0c4c275]
|
|
17
|
+
- @ai-sdk/provider-utils@5.0.0-canary.31
|
|
18
|
+
- @ai-sdk/provider@4.0.0-canary.15
|
|
19
|
+
|
|
20
|
+
## 3.0.0-beta.32
|
|
21
|
+
|
|
22
|
+
### Major Changes
|
|
23
|
+
|
|
24
|
+
- 04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbols
|
|
25
|
+
|
|
26
|
+
For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
|
|
27
|
+
|
|
28
|
+
### Patch Changes
|
|
29
|
+
|
|
30
|
+
- Updated dependencies [08d2129]
|
|
31
|
+
- @ai-sdk/provider-utils@5.0.0-beta.30
|
|
32
|
+
|
|
33
|
+
## 3.0.0-beta.31
|
|
34
|
+
|
|
35
|
+
### Patch Changes
|
|
36
|
+
|
|
37
|
+
- 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
|
|
38
|
+
- Updated dependencies [9bd6512]
|
|
39
|
+
- Updated dependencies [258c093]
|
|
40
|
+
- Updated dependencies [b6783da]
|
|
41
|
+
- @ai-sdk/provider-utils@5.0.0-beta.29
|
|
42
|
+
- @ai-sdk/provider@4.0.0-beta.14
|
|
43
|
+
|
|
44
|
+
## 3.0.0-beta.30
|
|
45
|
+
|
|
46
|
+
### Patch Changes
|
|
47
|
+
|
|
48
|
+
- 9f0e36c: trigger release for all packages after provenance setup
|
|
49
|
+
- Updated dependencies [9f0e36c]
|
|
50
|
+
- @ai-sdk/provider@4.0.0-beta.13
|
|
51
|
+
- @ai-sdk/provider-utils@5.0.0-beta.28
|
|
52
|
+
|
|
53
|
+
## 3.0.0-beta.29
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- Updated dependencies [785fe16]
|
|
58
|
+
- Updated dependencies [67df0a0]
|
|
59
|
+
- Updated dependencies [befb78c]
|
|
60
|
+
- Updated dependencies [0458559]
|
|
61
|
+
- Updated dependencies [5852c0a]
|
|
62
|
+
- Updated dependencies [fc92055]
|
|
63
|
+
- @ai-sdk/provider-utils@5.0.0-beta.27
|
|
64
|
+
|
|
65
|
+
## 3.0.0-beta.28
|
|
66
|
+
|
|
67
|
+
### Patch Changes
|
|
68
|
+
|
|
69
|
+
- Updated dependencies [2e98477]
|
|
70
|
+
- @ai-sdk/provider-utils@5.0.0-beta.26
|
|
71
|
+
|
|
72
|
+
## 3.0.0-beta.27
|
|
73
|
+
|
|
74
|
+
### Patch Changes
|
|
75
|
+
|
|
76
|
+
- Updated dependencies [eea8d98]
|
|
77
|
+
- @ai-sdk/provider-utils@5.0.0-beta.25
|
|
78
|
+
|
|
79
|
+
## 3.0.0-beta.26
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- Updated dependencies [f807e45]
|
|
84
|
+
- @ai-sdk/provider-utils@5.0.0-beta.24
|
|
85
|
+
|
|
86
|
+
## 3.0.0-beta.25
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- Updated dependencies [350ea38]
|
|
91
|
+
- @ai-sdk/provider-utils@5.0.0-beta.23
|
|
92
|
+
|
|
93
|
+
## 3.0.0-beta.24
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
96
|
+
|
|
97
|
+
- Updated dependencies [083947b]
|
|
98
|
+
- @ai-sdk/provider-utils@5.0.0-beta.22
|
|
99
|
+
|
|
100
|
+
## 3.0.0-beta.23
|
|
101
|
+
|
|
102
|
+
### Patch Changes
|
|
103
|
+
|
|
104
|
+
- Updated dependencies [add1126]
|
|
105
|
+
- @ai-sdk/provider-utils@5.0.0-beta.21
|
|
106
|
+
|
|
107
|
+
## 3.0.0-beta.22
|
|
108
|
+
|
|
109
|
+
### Patch Changes
|
|
110
|
+
|
|
111
|
+
- b3976a2: Add workflow serialization support to all provider models.
|
|
112
|
+
|
|
113
|
+
**`@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.
|
|
114
|
+
|
|
115
|
+
**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.
|
|
116
|
+
|
|
117
|
+
All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
|
|
118
|
+
|
|
119
|
+
- Updated dependencies [b3976a2]
|
|
120
|
+
- Updated dependencies [ff5eba1]
|
|
121
|
+
- @ai-sdk/provider-utils@5.0.0-beta.20
|
|
122
|
+
- @ai-sdk/provider@4.0.0-beta.12
|
|
123
|
+
|
|
124
|
+
## 3.0.0-beta.21
|
|
125
|
+
|
|
126
|
+
### Major Changes
|
|
127
|
+
|
|
128
|
+
- ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
|
|
129
|
+
|
|
130
|
+
### Patch Changes
|
|
131
|
+
|
|
132
|
+
- Updated dependencies [ef992f8]
|
|
133
|
+
- @ai-sdk/provider@4.0.0-beta.11
|
|
134
|
+
- @ai-sdk/provider-utils@5.0.0-beta.19
|
|
135
|
+
|
|
136
|
+
## 3.0.0-beta.20
|
|
137
|
+
|
|
138
|
+
### Patch Changes
|
|
139
|
+
|
|
140
|
+
- Updated dependencies [90e2d8a]
|
|
141
|
+
- @ai-sdk/provider-utils@5.0.0-beta.18
|
|
142
|
+
|
|
143
|
+
## 3.0.0-beta.19
|
|
144
|
+
|
|
145
|
+
### Patch Changes
|
|
146
|
+
|
|
147
|
+
- Updated dependencies [3ae1786]
|
|
148
|
+
- @ai-sdk/provider-utils@5.0.0-beta.17
|
|
149
|
+
|
|
150
|
+
## 3.0.0-beta.18
|
|
151
|
+
|
|
152
|
+
### Patch Changes
|
|
153
|
+
|
|
154
|
+
- Updated dependencies [176466a]
|
|
155
|
+
- @ai-sdk/provider@4.0.0-beta.10
|
|
156
|
+
- @ai-sdk/provider-utils@5.0.0-beta.16
|
|
157
|
+
|
|
158
|
+
## 3.0.0-beta.17
|
|
159
|
+
|
|
160
|
+
### Patch Changes
|
|
161
|
+
|
|
162
|
+
- Updated dependencies [e311194]
|
|
163
|
+
- @ai-sdk/provider@4.0.0-beta.9
|
|
164
|
+
- @ai-sdk/provider-utils@5.0.0-beta.15
|
|
165
|
+
|
|
166
|
+
## 3.0.0-beta.16
|
|
167
|
+
|
|
168
|
+
### Patch Changes
|
|
169
|
+
|
|
170
|
+
- Updated dependencies [34bd95d]
|
|
171
|
+
- Updated dependencies [008271d]
|
|
172
|
+
- @ai-sdk/provider@4.0.0-beta.8
|
|
173
|
+
- @ai-sdk/provider-utils@5.0.0-beta.14
|
|
174
|
+
|
|
175
|
+
## 3.0.0-beta.15
|
|
176
|
+
|
|
177
|
+
### Patch Changes
|
|
178
|
+
|
|
179
|
+
- Updated dependencies [b0c2869]
|
|
180
|
+
- Updated dependencies [7e26e81]
|
|
181
|
+
- @ai-sdk/provider-utils@5.0.0-beta.13
|
|
182
|
+
|
|
183
|
+
## 3.0.0-beta.14
|
|
184
|
+
|
|
185
|
+
### Patch Changes
|
|
186
|
+
|
|
187
|
+
- Updated dependencies [46d1149]
|
|
188
|
+
- @ai-sdk/provider-utils@5.0.0-beta.12
|
|
189
|
+
|
|
190
|
+
## 3.0.0-beta.13
|
|
191
|
+
|
|
192
|
+
### Patch Changes
|
|
193
|
+
|
|
194
|
+
- Updated dependencies [6fd51c0]
|
|
195
|
+
- @ai-sdk/provider-utils@5.0.0-beta.11
|
|
196
|
+
- @ai-sdk/provider@4.0.0-beta.7
|
|
197
|
+
|
|
198
|
+
## 3.0.0-beta.12
|
|
199
|
+
|
|
200
|
+
### Patch Changes
|
|
201
|
+
|
|
202
|
+
- Updated dependencies [c29a26f]
|
|
203
|
+
- @ai-sdk/provider-utils@5.0.0-beta.10
|
|
204
|
+
- @ai-sdk/provider@4.0.0-beta.6
|
|
205
|
+
|
|
206
|
+
## 3.0.0-beta.11
|
|
207
|
+
|
|
208
|
+
### Patch Changes
|
|
209
|
+
|
|
210
|
+
- 38fc777: Add AI Gateway hint to provider READMEs
|
|
211
|
+
|
|
212
|
+
## 3.0.0-beta.10
|
|
213
|
+
|
|
214
|
+
### Patch Changes
|
|
215
|
+
|
|
216
|
+
- Updated dependencies [2e17091]
|
|
217
|
+
- @ai-sdk/provider-utils@5.0.0-beta.9
|
|
218
|
+
|
|
3
219
|
## 3.0.0-beta.9
|
|
4
220
|
|
|
5
221
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
The **[Rev.ai provider](https://ai-sdk.dev/providers/ai-sdk-providers/revai)** for the [AI SDK](https://ai-sdk.dev/docs)
|
|
4
4
|
contains language model support for the Rev.ai transcription API.
|
|
5
5
|
|
|
6
|
+
> **Deploying to Vercel?** With Vercel's AI Gateway you can access Rev.ai (and hundreds of models from other providers) — no additional packages, API keys, or extra cost. [Get started with AI Gateway](https://vercel.com/ai-gateway).
|
|
7
|
+
|
|
6
8
|
## Setup
|
|
7
9
|
|
|
8
10
|
The Rev.ai provider is available in the `@ai-sdk/revai` module. You can install it with
|
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 RevaiConfig = {
|
|
@@ -8,13 +9,73 @@ type RevaiConfig = {
|
|
|
8
9
|
modelId: string;
|
|
9
10
|
path: string;
|
|
10
11
|
}) => string;
|
|
11
|
-
headers
|
|
12
|
+
headers?: () => Record<string, string | undefined>;
|
|
12
13
|
fetch?: FetchFunction;
|
|
13
14
|
generateId?: () => string;
|
|
14
15
|
};
|
|
15
16
|
|
|
16
17
|
type RevaiTranscriptionModelId = 'machine' | 'low_cost' | 'fusion';
|
|
17
18
|
|
|
19
|
+
interface RevaiTranscriptionModelConfig extends RevaiConfig {
|
|
20
|
+
_internal?: {
|
|
21
|
+
currentDate?: () => Date;
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
declare class RevaiTranscriptionModel implements TranscriptionModelV4 {
|
|
25
|
+
readonly modelId: RevaiTranscriptionModelId;
|
|
26
|
+
private readonly config;
|
|
27
|
+
readonly specificationVersion = "v4";
|
|
28
|
+
get provider(): string;
|
|
29
|
+
static [WORKFLOW_SERIALIZE](model: RevaiTranscriptionModel): {
|
|
30
|
+
modelId: string;
|
|
31
|
+
config: _ai_sdk_provider.JSONObject;
|
|
32
|
+
};
|
|
33
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
34
|
+
modelId: RevaiTranscriptionModelId;
|
|
35
|
+
config: RevaiTranscriptionModelConfig;
|
|
36
|
+
}): RevaiTranscriptionModel;
|
|
37
|
+
constructor(modelId: RevaiTranscriptionModelId, config: RevaiTranscriptionModelConfig);
|
|
38
|
+
private getArgs;
|
|
39
|
+
doGenerate(options: Parameters<TranscriptionModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<TranscriptionModelV4['doGenerate']>>>;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
interface RevaiProvider extends ProviderV4 {
|
|
43
|
+
(modelId: 'machine', settings?: {}): {
|
|
44
|
+
transcription: RevaiTranscriptionModel;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Creates a model for transcription.
|
|
48
|
+
*/
|
|
49
|
+
transcription(modelId: RevaiTranscriptionModelId): TranscriptionModelV4;
|
|
50
|
+
/**
|
|
51
|
+
* @deprecated Use `embeddingModel` instead.
|
|
52
|
+
*/
|
|
53
|
+
textEmbeddingModel(modelId: string): never;
|
|
54
|
+
}
|
|
55
|
+
interface RevaiProviderSettings {
|
|
56
|
+
/**
|
|
57
|
+
* API key for authenticating requests.
|
|
58
|
+
*/
|
|
59
|
+
apiKey?: string;
|
|
60
|
+
/**
|
|
61
|
+
* Custom headers to include in the requests.
|
|
62
|
+
*/
|
|
63
|
+
headers?: Record<string, string>;
|
|
64
|
+
/**
|
|
65
|
+
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
66
|
+
* or to provide a custom fetch implementation for e.g. testing.
|
|
67
|
+
*/
|
|
68
|
+
fetch?: FetchFunction;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Create a Rev.ai provider instance.
|
|
72
|
+
*/
|
|
73
|
+
declare function createRevai(options?: RevaiProviderSettings): RevaiProvider;
|
|
74
|
+
/**
|
|
75
|
+
* Default Rev.ai provider instance.
|
|
76
|
+
*/
|
|
77
|
+
declare const revai: RevaiProvider;
|
|
78
|
+
|
|
18
79
|
declare const revaiTranscriptionModelOptionsSchema: z.ZodObject<{
|
|
19
80
|
metadata: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
81
|
notification_config: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
@@ -91,57 +152,6 @@ declare const revaiTranscriptionModelOptionsSchema: z.ZodObject<{
|
|
|
91
152
|
forced_alignment: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
|
|
92
153
|
}, z.core.$strip>;
|
|
93
154
|
type RevaiTranscriptionModelOptions = z.infer<typeof revaiTranscriptionModelOptionsSchema>;
|
|
94
|
-
interface RevaiTranscriptionModelConfig extends RevaiConfig {
|
|
95
|
-
_internal?: {
|
|
96
|
-
currentDate?: () => Date;
|
|
97
|
-
};
|
|
98
|
-
}
|
|
99
|
-
declare class RevaiTranscriptionModel implements TranscriptionModelV4 {
|
|
100
|
-
readonly modelId: RevaiTranscriptionModelId;
|
|
101
|
-
private readonly config;
|
|
102
|
-
readonly specificationVersion = "v4";
|
|
103
|
-
get provider(): string;
|
|
104
|
-
constructor(modelId: RevaiTranscriptionModelId, config: RevaiTranscriptionModelConfig);
|
|
105
|
-
private getArgs;
|
|
106
|
-
doGenerate(options: Parameters<TranscriptionModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<TranscriptionModelV4['doGenerate']>>>;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
interface RevaiProvider extends ProviderV4 {
|
|
110
|
-
(modelId: 'machine', settings?: {}): {
|
|
111
|
-
transcription: RevaiTranscriptionModel;
|
|
112
|
-
};
|
|
113
|
-
/**
|
|
114
|
-
* Creates a model for transcription.
|
|
115
|
-
*/
|
|
116
|
-
transcription(modelId: RevaiTranscriptionModelId): TranscriptionModelV4;
|
|
117
|
-
/**
|
|
118
|
-
* @deprecated Use `embeddingModel` instead.
|
|
119
|
-
*/
|
|
120
|
-
textEmbeddingModel(modelId: string): never;
|
|
121
|
-
}
|
|
122
|
-
interface RevaiProviderSettings {
|
|
123
|
-
/**
|
|
124
|
-
* API key for authenticating requests.
|
|
125
|
-
*/
|
|
126
|
-
apiKey?: string;
|
|
127
|
-
/**
|
|
128
|
-
* Custom headers to include in the requests.
|
|
129
|
-
*/
|
|
130
|
-
headers?: Record<string, string>;
|
|
131
|
-
/**
|
|
132
|
-
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
133
|
-
* or to provide a custom fetch implementation for e.g. testing.
|
|
134
|
-
*/
|
|
135
|
-
fetch?: FetchFunction;
|
|
136
|
-
}
|
|
137
|
-
/**
|
|
138
|
-
* Create a Rev.ai provider instance.
|
|
139
|
-
*/
|
|
140
|
-
declare function createRevai(options?: RevaiProviderSettings): RevaiProvider;
|
|
141
|
-
/**
|
|
142
|
-
* Default Rev.ai provider instance.
|
|
143
|
-
*/
|
|
144
|
-
declare const revai: RevaiProvider;
|
|
145
155
|
|
|
146
156
|
declare const VERSION: string;
|
|
147
157
|
|