@ai-sdk/elevenlabs 3.0.52 → 3.0.54
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 +18 -0
- package/dist/index.d.ts +139 -132
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +685 -863
- package/dist/index.js.map +1 -1
- package/package.json +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @ai-sdk/elevenlabs
|
|
2
2
|
|
|
3
|
+
## 3.0.54
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [8c65988]
|
|
8
|
+
- Updated dependencies [527a163]
|
|
9
|
+
- @ai-sdk/provider@4.0.21
|
|
10
|
+
- @ai-sdk/provider-utils@5.0.53
|
|
11
|
+
|
|
12
|
+
## 3.0.53
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- ede5b89: chore: migrate package builds from tsup to tsdown
|
|
17
|
+
- Updated dependencies [ede5b89]
|
|
18
|
+
- @ai-sdk/provider@4.0.20
|
|
19
|
+
- @ai-sdk/provider-utils@5.0.52
|
|
20
|
+
|
|
3
21
|
## 3.0.52
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/dist/index.d.ts
CHANGED
|
@@ -1,157 +1,164 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { Experimental_TranscriptionModelV4StreamOptions, ProviderV4, SpeechModelV4, TranscriptionModelV4 } from "@ai-sdk/provider";
|
|
2
|
+
import { FetchFunction, WORKFLOW_DESERIALIZE, WORKFLOW_SERIALIZE, WebSocketConstructor } from "@ai-sdk/provider-utils";
|
|
3
|
+
import { z } from "zod/v4";
|
|
4
|
+
//#region src/elevenlabs-config.d.ts
|
|
6
5
|
type ElevenLabsConfig = {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
6
|
+
provider: string;
|
|
7
|
+
url: (options: {
|
|
8
|
+
modelId: string;
|
|
9
|
+
path: string;
|
|
10
|
+
}) => string;
|
|
11
|
+
headers?: () => Record<string, string | undefined>;
|
|
12
|
+
fetch?: FetchFunction;
|
|
13
|
+
generateId?: () => string;
|
|
14
|
+
webSocket?: WebSocketConstructor;
|
|
16
15
|
};
|
|
17
|
-
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/elevenlabs-transcription-options.d.ts
|
|
18
18
|
type ElevenLabsTranscriptionModelId = 'scribe_v1' | 'scribe_v1_experimental' | 'scribe_v2' | 'scribe_v2_realtime' | (string & {});
|
|
19
|
-
|
|
19
|
+
//#endregion
|
|
20
|
+
//#region src/elevenlabs-transcription-model.d.ts
|
|
20
21
|
interface ElevenLabsTranscriptionModelConfig extends ElevenLabsConfig {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
_internal?: {
|
|
23
|
+
currentDate?: () => Date;
|
|
24
|
+
};
|
|
24
25
|
}
|
|
25
26
|
declare class ElevenLabsTranscriptionModel implements TranscriptionModelV4 {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
27
|
+
readonly modelId: ElevenLabsTranscriptionModelId;
|
|
28
|
+
private readonly config;
|
|
29
|
+
readonly specificationVersion = "v4";
|
|
30
|
+
get provider(): string;
|
|
31
|
+
static [WORKFLOW_SERIALIZE](model: ElevenLabsTranscriptionModel): {
|
|
32
|
+
modelId: string;
|
|
33
|
+
config: import("@ai-sdk/provider").JSONObject;
|
|
34
|
+
};
|
|
35
|
+
static [WORKFLOW_DESERIALIZE](options: {
|
|
36
|
+
modelId: ElevenLabsTranscriptionModelId;
|
|
37
|
+
config: ElevenLabsTranscriptionModelConfig;
|
|
38
|
+
}): ElevenLabsTranscriptionModel;
|
|
39
|
+
constructor(modelId: ElevenLabsTranscriptionModelId, config: ElevenLabsTranscriptionModelConfig);
|
|
40
|
+
private getArgs;
|
|
41
|
+
doGenerate(options: Parameters<TranscriptionModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<TranscriptionModelV4['doGenerate']>>>;
|
|
42
|
+
doStream(options: Experimental_TranscriptionModelV4StreamOptions): Promise<Awaited<ReturnType<NonNullable<TranscriptionModelV4['doStream']>>>>;
|
|
42
43
|
}
|
|
43
|
-
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/elevenlabs-speech-options.d.ts
|
|
44
46
|
type ElevenLabsSpeechModelId = 'eleven_v3' | 'eleven_multilingual_v2' | 'eleven_flash_v2_5' | 'eleven_flash_v2' | 'eleven_turbo_v2_5' | 'eleven_turbo_v2' | 'eleven_monolingual_v1' | 'eleven_multilingual_v1' | (string & {});
|
|
45
47
|
type ElevenLabsSpeechVoiceId = string;
|
|
46
|
-
|
|
48
|
+
//#endregion
|
|
49
|
+
//#region src/elevenlabs-provider.d.ts
|
|
47
50
|
interface ElevenLabsProvider extends ProviderV4 {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
51
|
+
(modelId: ElevenLabsTranscriptionModelId, settings?: {}): {
|
|
52
|
+
transcription: ElevenLabsTranscriptionModel;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Creates a model for transcription.
|
|
56
|
+
*/
|
|
57
|
+
transcription(modelId: ElevenLabsTranscriptionModelId): TranscriptionModelV4;
|
|
58
|
+
/**
|
|
59
|
+
* Creates a model for speech generation.
|
|
60
|
+
*/
|
|
61
|
+
speech(modelId: ElevenLabsSpeechModelId): SpeechModelV4;
|
|
62
|
+
/**
|
|
63
|
+
* @deprecated Use `embeddingModel` instead.
|
|
64
|
+
*/
|
|
65
|
+
textEmbeddingModel(modelId: string): never;
|
|
63
66
|
}
|
|
64
67
|
interface ElevenLabsProviderSettings {
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
68
|
+
/**
|
|
69
|
+
* API key for authenticating requests.
|
|
70
|
+
*/
|
|
71
|
+
apiKey?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Custom headers to include in the requests.
|
|
74
|
+
*/
|
|
75
|
+
headers?: Record<string, string>;
|
|
76
|
+
/**
|
|
77
|
+
* Custom fetch implementation. You can use it as a middleware to intercept requests,
|
|
78
|
+
* or to provide a custom fetch implementation for e.g. testing.
|
|
79
|
+
*/
|
|
80
|
+
fetch?: FetchFunction;
|
|
81
|
+
/**
|
|
82
|
+
* Custom WebSocket implementation. Required in runtimes whose native
|
|
83
|
+
* WebSocket constructor does not support headers for realtime transcription.
|
|
84
|
+
*/
|
|
85
|
+
webSocket?: WebSocketConstructor;
|
|
83
86
|
}
|
|
84
87
|
/**
|
|
85
88
|
* Create an ElevenLabs provider instance.
|
|
86
89
|
*/
|
|
87
|
-
declare function createElevenLabs(options?: ElevenLabsProviderSettings): ElevenLabsProvider;
|
|
90
|
+
export declare function createElevenLabs(options?: ElevenLabsProviderSettings): ElevenLabsProvider;
|
|
88
91
|
/**
|
|
89
92
|
* Default ElevenLabs provider instance.
|
|
90
93
|
*/
|
|
91
|
-
declare const elevenLabs: ElevenLabsProvider;
|
|
92
|
-
|
|
94
|
+
export declare const elevenLabs: ElevenLabsProvider;
|
|
95
|
+
//#endregion
|
|
96
|
+
//#region src/elevenlabs-speech-model-options.d.ts
|
|
93
97
|
declare const elevenLabsSpeechModelOptionsSchema: z.ZodObject<{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
98
|
+
languageCode: z.ZodOptional<z.ZodString>;
|
|
99
|
+
voiceSettings: z.ZodOptional<z.ZodObject<{
|
|
100
|
+
stability: z.ZodOptional<z.ZodNumber>;
|
|
101
|
+
similarityBoost: z.ZodOptional<z.ZodNumber>;
|
|
102
|
+
style: z.ZodOptional<z.ZodNumber>;
|
|
103
|
+
useSpeakerBoost: z.ZodOptional<z.ZodBoolean>;
|
|
104
|
+
}, z.core.$strip>>;
|
|
105
|
+
pronunciationDictionaryLocators: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
106
|
+
pronunciationDictionaryId: z.ZodString;
|
|
107
|
+
versionId: z.ZodOptional<z.ZodString>;
|
|
108
|
+
}, z.core.$strip>>>;
|
|
109
|
+
seed: z.ZodOptional<z.ZodNumber>;
|
|
110
|
+
previousText: z.ZodOptional<z.ZodString>;
|
|
111
|
+
nextText: z.ZodOptional<z.ZodString>;
|
|
112
|
+
previousRequestIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
113
|
+
nextRequestIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
114
|
+
applyTextNormalization: z.ZodOptional<z.ZodEnum<{
|
|
115
|
+
auto: "auto";
|
|
116
|
+
on: "on";
|
|
117
|
+
off: "off";
|
|
118
|
+
}>>;
|
|
119
|
+
applyLanguageTextNormalization: z.ZodOptional<z.ZodBoolean>;
|
|
120
|
+
enableLogging: z.ZodOptional<z.ZodBoolean>;
|
|
117
121
|
}, z.core.$strip>;
|
|
118
122
|
type ElevenLabsSpeechModelOptions = z.infer<typeof elevenLabsSpeechModelOptionsSchema>;
|
|
119
|
-
|
|
123
|
+
//#endregion
|
|
124
|
+
//#region src/elevenlabs-transcription-model-options.d.ts
|
|
120
125
|
declare const elevenLabsTranscriptionModelOptionsSchema: z.ZodObject<{
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
126
|
+
languageCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
127
|
+
tagAudioEvents: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
|
|
128
|
+
numSpeakers: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
129
|
+
timestampsGranularity: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
130
|
+
none: "none";
|
|
131
|
+
word: "word";
|
|
132
|
+
character: "character";
|
|
133
|
+
}>>>>;
|
|
134
|
+
diarize: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
|
|
135
|
+
fileFormat: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
136
|
+
pcm_s16le_16: "pcm_s16le_16";
|
|
137
|
+
other: "other";
|
|
138
|
+
}>>>>;
|
|
139
|
+
streaming: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
140
|
+
commitStrategy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
|
|
141
|
+
manual: "manual";
|
|
142
|
+
vad: "vad";
|
|
143
|
+
}>>>;
|
|
144
|
+
enableLogging: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
145
|
+
filterBackgroundAudio: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
146
|
+
includeLanguageDetection: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
147
|
+
includeTimestamps: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
148
|
+
keyterms: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
149
|
+
minSilenceDurationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
150
|
+
minSpeechDurationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
151
|
+
noVerbatim: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
152
|
+
previousText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
153
|
+
secondaryLanguages: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
|
|
154
|
+
vadSilenceThresholdSecs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
155
|
+
vadThreshold: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
156
|
+
}, z.core.$strip>>>;
|
|
152
157
|
}, z.core.$strip>;
|
|
153
158
|
type ElevenLabsTranscriptionModelOptions = z.infer<typeof elevenLabsTranscriptionModelOptionsSchema>;
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
159
|
+
//#endregion
|
|
160
|
+
//#region src/version.d.ts
|
|
161
|
+
export declare const VERSION: string;
|
|
162
|
+
//#endregion
|
|
163
|
+
export { type ElevenLabsProvider, type ElevenLabsProviderSettings, type ElevenLabsSpeechModelId, type ElevenLabsSpeechModelOptions, type ElevenLabsSpeechVoiceId, type ElevenLabsTranscriptionModelOptions, elevenLabs as elevenlabs };
|
|
164
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","names":["TranscriptionModelV4StreamOptions"],"sources":["../src/elevenlabs-config.ts","../src/elevenlabs-transcription-options.ts","../src/elevenlabs-transcription-model.ts","../src/elevenlabs-speech-options.ts","../src/elevenlabs-provider.ts","../src/elevenlabs-speech-model-options.ts","../src/elevenlabs-transcription-model-options.ts","../src/version.ts"],"mappings":";;;;KAKY;EACV;EACA,MAAM;IAAW;IAAiB;;EAClC,gBAAgB;EAChB,QAAQ;EACR;EACA,YAAY;;;;KCXF;;;UC6EF,2CAA2C;EACnD;IACE,oBAAoB;;;cAIX,wCAAwC;WAsBxC,SAAS;mBACD;WAtBV;MAEL;UAII,oBAAoB,OAAO;;;;UAO3B,sBAAsB;IAC5B,SAAS;IACT,QAAQ;MACT;EAKU,YAAA,SAAS,gCACD,QAAQ;UAGb;EAuER,WACJ,SAAS,WAAW,yCACnB,QAAQ,QAAQ,WAAW;EAiDxB,SACJ,SAASA,iDACR,QACD,QAAQ,WAAW,YAAY;;;;KC1OvB;KAWA;;;UCOK,2BAA2B;GAExC,SAAS,gCACT;IAEA,eAAe;;;;;EAMjB,cAAc,SAAS,iCAAiC;;;;EAKxD,OAAO,SAAS,0BAA0B;;;;EAK1C,mBAAmB;;UAGJ;;;;EAIf;;;;EAKA,UAAU;;;;;EAMV,QAAQ;;;;;EAMR,YAAY;;;;;wBAME,iBACd,UAAS,6BACR;;;;qBA0EU,YAAU;;;cC9IV,oCAAkC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;GA2B7C,EAAA,KAAA;KAEU,+BAA+B,EAAE,aACpC;;;cC9BI,2CAAyC,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BpD,EAAA,KAAA;KAEU,sCAAsC,EAAE,aAC3C;;;qBC/BI"}
|