@ai-sdk/elevenlabs 3.0.0-beta.8 → 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/CHANGELOG.md +208 -0
- package/README.md +2 -0
- package/dist/index.d.ts +30 -20
- package/dist/index.js +132 -112
- package/dist/index.js.map +1 -1
- package/docs/90-elevenlabs.mdx +11 -11
- package/package.json +11 -9
- package/src/elevenlabs-config.ts +2 -2
- package/src/elevenlabs-provider.ts +7 -7
- package/src/elevenlabs-speech-model-options.ts +35 -0
- package/src/elevenlabs-speech-model.ts +23 -40
- package/src/elevenlabs-transcription-model-options.ts +18 -0
- package/src/elevenlabs-transcription-model.ts +23 -22
- package/src/index.ts +8 -3
- package/dist/index.d.mts +0 -122
- package/dist/index.mjs +0 -423
- package/dist/index.mjs.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,213 @@
|
|
|
1
1
|
# @ai-sdk/elevenlabs
|
|
2
2
|
|
|
3
|
+
## 3.0.0-canary.32
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0c4c275: trigger initial canary release
|
|
8
|
+
- Updated dependencies [0c4c275]
|
|
9
|
+
- @ai-sdk/provider-utils@5.0.0-canary.31
|
|
10
|
+
- @ai-sdk/provider@4.0.0-canary.15
|
|
11
|
+
|
|
12
|
+
## 3.0.0-beta.31
|
|
13
|
+
|
|
14
|
+
### Major Changes
|
|
15
|
+
|
|
16
|
+
- 04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbols
|
|
17
|
+
|
|
18
|
+
For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- Updated dependencies [08d2129]
|
|
23
|
+
- @ai-sdk/provider-utils@5.0.0-beta.30
|
|
24
|
+
|
|
25
|
+
## 3.0.0-beta.30
|
|
26
|
+
|
|
27
|
+
### Patch Changes
|
|
28
|
+
|
|
29
|
+
- 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
|
|
30
|
+
- Updated dependencies [9bd6512]
|
|
31
|
+
- Updated dependencies [258c093]
|
|
32
|
+
- Updated dependencies [b6783da]
|
|
33
|
+
- @ai-sdk/provider-utils@5.0.0-beta.29
|
|
34
|
+
- @ai-sdk/provider@4.0.0-beta.14
|
|
35
|
+
|
|
36
|
+
## 3.0.0-beta.29
|
|
37
|
+
|
|
38
|
+
### Patch Changes
|
|
39
|
+
|
|
40
|
+
- 9f0e36c: trigger release for all packages after provenance setup
|
|
41
|
+
- Updated dependencies [9f0e36c]
|
|
42
|
+
- @ai-sdk/provider@4.0.0-beta.13
|
|
43
|
+
- @ai-sdk/provider-utils@5.0.0-beta.28
|
|
44
|
+
|
|
45
|
+
## 3.0.0-beta.28
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- Updated dependencies [785fe16]
|
|
50
|
+
- Updated dependencies [67df0a0]
|
|
51
|
+
- Updated dependencies [befb78c]
|
|
52
|
+
- Updated dependencies [0458559]
|
|
53
|
+
- Updated dependencies [5852c0a]
|
|
54
|
+
- Updated dependencies [fc92055]
|
|
55
|
+
- @ai-sdk/provider-utils@5.0.0-beta.27
|
|
56
|
+
|
|
57
|
+
## 3.0.0-beta.27
|
|
58
|
+
|
|
59
|
+
### Patch Changes
|
|
60
|
+
|
|
61
|
+
- Updated dependencies [2e98477]
|
|
62
|
+
- @ai-sdk/provider-utils@5.0.0-beta.26
|
|
63
|
+
|
|
64
|
+
## 3.0.0-beta.26
|
|
65
|
+
|
|
66
|
+
### Patch Changes
|
|
67
|
+
|
|
68
|
+
- Updated dependencies [eea8d98]
|
|
69
|
+
- @ai-sdk/provider-utils@5.0.0-beta.25
|
|
70
|
+
|
|
71
|
+
## 3.0.0-beta.25
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- Updated dependencies [f807e45]
|
|
76
|
+
- @ai-sdk/provider-utils@5.0.0-beta.24
|
|
77
|
+
|
|
78
|
+
## 3.0.0-beta.24
|
|
79
|
+
|
|
80
|
+
### Patch Changes
|
|
81
|
+
|
|
82
|
+
- Updated dependencies [350ea38]
|
|
83
|
+
- @ai-sdk/provider-utils@5.0.0-beta.23
|
|
84
|
+
|
|
85
|
+
## 3.0.0-beta.23
|
|
86
|
+
|
|
87
|
+
### Patch Changes
|
|
88
|
+
|
|
89
|
+
- Updated dependencies [083947b]
|
|
90
|
+
- @ai-sdk/provider-utils@5.0.0-beta.22
|
|
91
|
+
|
|
92
|
+
## 3.0.0-beta.22
|
|
93
|
+
|
|
94
|
+
### Patch Changes
|
|
95
|
+
|
|
96
|
+
- Updated dependencies [add1126]
|
|
97
|
+
- @ai-sdk/provider-utils@5.0.0-beta.21
|
|
98
|
+
|
|
99
|
+
## 3.0.0-beta.21
|
|
100
|
+
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- b3976a2: Add workflow serialization support to all provider models.
|
|
104
|
+
|
|
105
|
+
**`@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.
|
|
106
|
+
|
|
107
|
+
**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.
|
|
108
|
+
|
|
109
|
+
All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
|
|
110
|
+
|
|
111
|
+
- Updated dependencies [b3976a2]
|
|
112
|
+
- Updated dependencies [ff5eba1]
|
|
113
|
+
- @ai-sdk/provider-utils@5.0.0-beta.20
|
|
114
|
+
- @ai-sdk/provider@4.0.0-beta.12
|
|
115
|
+
|
|
116
|
+
## 3.0.0-beta.20
|
|
117
|
+
|
|
118
|
+
### Major Changes
|
|
119
|
+
|
|
120
|
+
- ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
|
|
121
|
+
|
|
122
|
+
### Patch Changes
|
|
123
|
+
|
|
124
|
+
- Updated dependencies [ef992f8]
|
|
125
|
+
- @ai-sdk/provider@4.0.0-beta.11
|
|
126
|
+
- @ai-sdk/provider-utils@5.0.0-beta.19
|
|
127
|
+
|
|
128
|
+
## 3.0.0-beta.19
|
|
129
|
+
|
|
130
|
+
### Patch Changes
|
|
131
|
+
|
|
132
|
+
- Updated dependencies [90e2d8a]
|
|
133
|
+
- @ai-sdk/provider-utils@5.0.0-beta.18
|
|
134
|
+
|
|
135
|
+
## 3.0.0-beta.18
|
|
136
|
+
|
|
137
|
+
### Patch Changes
|
|
138
|
+
|
|
139
|
+
- Updated dependencies [3ae1786]
|
|
140
|
+
- @ai-sdk/provider-utils@5.0.0-beta.17
|
|
141
|
+
|
|
142
|
+
## 3.0.0-beta.17
|
|
143
|
+
|
|
144
|
+
### Patch Changes
|
|
145
|
+
|
|
146
|
+
- Updated dependencies [176466a]
|
|
147
|
+
- @ai-sdk/provider@4.0.0-beta.10
|
|
148
|
+
- @ai-sdk/provider-utils@5.0.0-beta.16
|
|
149
|
+
|
|
150
|
+
## 3.0.0-beta.16
|
|
151
|
+
|
|
152
|
+
### Patch Changes
|
|
153
|
+
|
|
154
|
+
- Updated dependencies [e311194]
|
|
155
|
+
- @ai-sdk/provider@4.0.0-beta.9
|
|
156
|
+
- @ai-sdk/provider-utils@5.0.0-beta.15
|
|
157
|
+
|
|
158
|
+
## 3.0.0-beta.15
|
|
159
|
+
|
|
160
|
+
### Patch Changes
|
|
161
|
+
|
|
162
|
+
- Updated dependencies [34bd95d]
|
|
163
|
+
- Updated dependencies [008271d]
|
|
164
|
+
- @ai-sdk/provider@4.0.0-beta.8
|
|
165
|
+
- @ai-sdk/provider-utils@5.0.0-beta.14
|
|
166
|
+
|
|
167
|
+
## 3.0.0-beta.14
|
|
168
|
+
|
|
169
|
+
### Patch Changes
|
|
170
|
+
|
|
171
|
+
- Updated dependencies [b0c2869]
|
|
172
|
+
- Updated dependencies [7e26e81]
|
|
173
|
+
- @ai-sdk/provider-utils@5.0.0-beta.13
|
|
174
|
+
|
|
175
|
+
## 3.0.0-beta.13
|
|
176
|
+
|
|
177
|
+
### Patch Changes
|
|
178
|
+
|
|
179
|
+
- Updated dependencies [46d1149]
|
|
180
|
+
- @ai-sdk/provider-utils@5.0.0-beta.12
|
|
181
|
+
|
|
182
|
+
## 3.0.0-beta.12
|
|
183
|
+
|
|
184
|
+
### Patch Changes
|
|
185
|
+
|
|
186
|
+
- Updated dependencies [6fd51c0]
|
|
187
|
+
- @ai-sdk/provider-utils@5.0.0-beta.11
|
|
188
|
+
- @ai-sdk/provider@4.0.0-beta.7
|
|
189
|
+
|
|
190
|
+
## 3.0.0-beta.11
|
|
191
|
+
|
|
192
|
+
### Patch Changes
|
|
193
|
+
|
|
194
|
+
- Updated dependencies [c29a26f]
|
|
195
|
+
- @ai-sdk/provider-utils@5.0.0-beta.10
|
|
196
|
+
- @ai-sdk/provider@4.0.0-beta.6
|
|
197
|
+
|
|
198
|
+
## 3.0.0-beta.10
|
|
199
|
+
|
|
200
|
+
### Patch Changes
|
|
201
|
+
|
|
202
|
+
- 38fc777: Add AI Gateway hint to provider READMEs
|
|
203
|
+
|
|
204
|
+
## 3.0.0-beta.9
|
|
205
|
+
|
|
206
|
+
### Patch Changes
|
|
207
|
+
|
|
208
|
+
- Updated dependencies [2e17091]
|
|
209
|
+
- @ai-sdk/provider-utils@5.0.0-beta.9
|
|
210
|
+
|
|
3
211
|
## 3.0.0-beta.8
|
|
4
212
|
|
|
5
213
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -3,6 +3,8 @@
|
|
|
3
3
|
The **[ElevenLabs provider](https://ai-sdk.dev/providers/ai-sdk-providers/elevenlabs)** for the [AI SDK](https://ai-sdk.dev/docs)
|
|
4
4
|
contains language model support for the ElevenLabs chat and completion APIs and embedding model support for the ElevenLabs embeddings API.
|
|
5
5
|
|
|
6
|
+
> **Deploying to Vercel?** With Vercel's AI Gateway you can access ElevenLabs (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 ElevenLabs provider is available in the `@ai-sdk/elevenlabs` 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, SpeechModelV4 } 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 ElevenLabsConfig = {
|
|
@@ -8,29 +9,13 @@ type ElevenLabsConfig = {
|
|
|
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 ElevenLabsTranscriptionModelId = 'scribe_v1' | 'scribe_v1_experimental' | (string & {});
|
|
17
18
|
|
|
18
|
-
declare const elevenLabsTranscriptionModelOptionsSchema: z.ZodObject<{
|
|
19
|
-
languageCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
20
|
-
tagAudioEvents: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
|
|
21
|
-
numSpeakers: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
22
|
-
timestampsGranularity: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
23
|
-
none: "none";
|
|
24
|
-
word: "word";
|
|
25
|
-
character: "character";
|
|
26
|
-
}>>>>;
|
|
27
|
-
diarize: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
|
|
28
|
-
fileFormat: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
29
|
-
pcm_s16le_16: "pcm_s16le_16";
|
|
30
|
-
other: "other";
|
|
31
|
-
}>>>>;
|
|
32
|
-
}, z.core.$strip>;
|
|
33
|
-
type ElevenLabsTranscriptionModelOptions = z.infer<typeof elevenLabsTranscriptionModelOptionsSchema>;
|
|
34
19
|
interface ElevenLabsTranscriptionModelConfig extends ElevenLabsConfig {
|
|
35
20
|
_internal?: {
|
|
36
21
|
currentDate?: () => Date;
|
|
@@ -41,6 +26,14 @@ declare class ElevenLabsTranscriptionModel implements TranscriptionModelV4 {
|
|
|
41
26
|
private readonly config;
|
|
42
27
|
readonly specificationVersion = "v4";
|
|
43
28
|
get provider(): string;
|
|
29
|
+
static [WORKFLOW_SERIALIZE](model: ElevenLabsTranscriptionModel): {
|
|
30
|
+
modelId: string;
|
|
31
|
+
config: _ai_sdk_provider.JSONObject;
|
|
32
|
+
};
|
|
33
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
34
|
+
modelId: ElevenLabsTranscriptionModelId;
|
|
35
|
+
config: ElevenLabsTranscriptionModelConfig;
|
|
36
|
+
}): ElevenLabsTranscriptionModel;
|
|
44
37
|
constructor(modelId: ElevenLabsTranscriptionModelId, config: ElevenLabsTranscriptionModelConfig);
|
|
45
38
|
private getArgs;
|
|
46
39
|
doGenerate(options: Parameters<TranscriptionModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<TranscriptionModelV4['doGenerate']>>>;
|
|
@@ -88,7 +81,7 @@ declare function createElevenLabs(options?: ElevenLabsProviderSettings): ElevenL
|
|
|
88
81
|
/**
|
|
89
82
|
* Default ElevenLabs provider instance.
|
|
90
83
|
*/
|
|
91
|
-
declare const
|
|
84
|
+
declare const elevenLabs: ElevenLabsProvider;
|
|
92
85
|
|
|
93
86
|
declare const elevenLabsSpeechModelOptionsSchema: z.ZodObject<{
|
|
94
87
|
languageCode: z.ZodOptional<z.ZodString>;
|
|
@@ -117,6 +110,23 @@ declare const elevenLabsSpeechModelOptionsSchema: z.ZodObject<{
|
|
|
117
110
|
}, z.core.$strip>;
|
|
118
111
|
type ElevenLabsSpeechModelOptions = z.infer<typeof elevenLabsSpeechModelOptionsSchema>;
|
|
119
112
|
|
|
113
|
+
declare const elevenLabsTranscriptionModelOptionsSchema: z.ZodObject<{
|
|
114
|
+
languageCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
115
|
+
tagAudioEvents: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
|
|
116
|
+
numSpeakers: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
117
|
+
timestampsGranularity: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
118
|
+
none: "none";
|
|
119
|
+
word: "word";
|
|
120
|
+
character: "character";
|
|
121
|
+
}>>>>;
|
|
122
|
+
diarize: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
|
|
123
|
+
fileFormat: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
124
|
+
pcm_s16le_16: "pcm_s16le_16";
|
|
125
|
+
other: "other";
|
|
126
|
+
}>>>>;
|
|
127
|
+
}, z.core.$strip>;
|
|
128
|
+
type ElevenLabsTranscriptionModelOptions = z.infer<typeof elevenLabsTranscriptionModelOptionsSchema>;
|
|
129
|
+
|
|
120
130
|
declare const VERSION: string;
|
|
121
131
|
|
|
122
|
-
export { type ElevenLabsProvider, type ElevenLabsProviderSettings, type ElevenLabsSpeechModelId, type ElevenLabsSpeechModelOptions, type ElevenLabsSpeechVoiceId, type ElevenLabsTranscriptionModelOptions, VERSION, createElevenLabs, elevenlabs };
|
|
132
|
+
export { type ElevenLabsProvider, type ElevenLabsProviderSettings, type ElevenLabsSpeechModelId, type ElevenLabsSpeechModelOptions, type ElevenLabsSpeechVoiceId, type ElevenLabsTranscriptionModelOptions, VERSION, createElevenLabs, elevenLabs, elevenLabs as elevenlabs };
|