@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 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 * as _ai_sdk_provider from '@ai-sdk/provider';
2
- import { TranscriptionModelV4, Experimental_TranscriptionModelV4StreamOptions, ProviderV4, SpeechModelV4 } from '@ai-sdk/provider';
3
- import { FetchFunction, WebSocketConstructor, WORKFLOW_SERIALIZE, WORKFLOW_DESERIALIZE } from '@ai-sdk/provider-utils';
4
- import { z } from 'zod/v4';
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
- provider: string;
8
- url: (options: {
9
- modelId: string;
10
- path: string;
11
- }) => string;
12
- headers?: () => Record<string, string | undefined>;
13
- fetch?: FetchFunction;
14
- generateId?: () => string;
15
- webSocket?: WebSocketConstructor;
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
- _internal?: {
22
- currentDate?: () => Date;
23
- };
22
+ _internal?: {
23
+ currentDate?: () => Date;
24
+ };
24
25
  }
25
26
  declare class ElevenLabsTranscriptionModel implements TranscriptionModelV4 {
26
- readonly modelId: ElevenLabsTranscriptionModelId;
27
- private readonly config;
28
- readonly specificationVersion = "v4";
29
- get provider(): string;
30
- static [WORKFLOW_SERIALIZE](model: ElevenLabsTranscriptionModel): {
31
- modelId: string;
32
- config: _ai_sdk_provider.JSONObject;
33
- };
34
- static [WORKFLOW_DESERIALIZE](options: {
35
- modelId: ElevenLabsTranscriptionModelId;
36
- config: ElevenLabsTranscriptionModelConfig;
37
- }): ElevenLabsTranscriptionModel;
38
- constructor(modelId: ElevenLabsTranscriptionModelId, config: ElevenLabsTranscriptionModelConfig);
39
- private getArgs;
40
- doGenerate(options: Parameters<TranscriptionModelV4['doGenerate']>[0]): Promise<Awaited<ReturnType<TranscriptionModelV4['doGenerate']>>>;
41
- doStream(options: Experimental_TranscriptionModelV4StreamOptions): Promise<Awaited<ReturnType<NonNullable<TranscriptionModelV4['doStream']>>>>;
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
- (modelId: ElevenLabsTranscriptionModelId, settings?: {}): {
49
- transcription: ElevenLabsTranscriptionModel;
50
- };
51
- /**
52
- * Creates a model for transcription.
53
- */
54
- transcription(modelId: ElevenLabsTranscriptionModelId): TranscriptionModelV4;
55
- /**
56
- * Creates a model for speech generation.
57
- */
58
- speech(modelId: ElevenLabsSpeechModelId): SpeechModelV4;
59
- /**
60
- * @deprecated Use `embeddingModel` instead.
61
- */
62
- textEmbeddingModel(modelId: string): never;
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
- * API key for authenticating requests.
67
- */
68
- apiKey?: string;
69
- /**
70
- * Custom headers to include in the requests.
71
- */
72
- headers?: Record<string, string>;
73
- /**
74
- * Custom fetch implementation. You can use it as a middleware to intercept requests,
75
- * or to provide a custom fetch implementation for e.g. testing.
76
- */
77
- fetch?: FetchFunction;
78
- /**
79
- * Custom WebSocket implementation. Required in runtimes whose native
80
- * WebSocket constructor does not support headers for realtime transcription.
81
- */
82
- webSocket?: WebSocketConstructor;
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
- languageCode: z.ZodOptional<z.ZodString>;
95
- voiceSettings: z.ZodOptional<z.ZodObject<{
96
- stability: z.ZodOptional<z.ZodNumber>;
97
- similarityBoost: z.ZodOptional<z.ZodNumber>;
98
- style: z.ZodOptional<z.ZodNumber>;
99
- useSpeakerBoost: z.ZodOptional<z.ZodBoolean>;
100
- }, z.core.$strip>>;
101
- pronunciationDictionaryLocators: z.ZodOptional<z.ZodArray<z.ZodObject<{
102
- pronunciationDictionaryId: z.ZodString;
103
- versionId: z.ZodOptional<z.ZodString>;
104
- }, z.core.$strip>>>;
105
- seed: z.ZodOptional<z.ZodNumber>;
106
- previousText: z.ZodOptional<z.ZodString>;
107
- nextText: z.ZodOptional<z.ZodString>;
108
- previousRequestIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
109
- nextRequestIds: z.ZodOptional<z.ZodArray<z.ZodString>>;
110
- applyTextNormalization: z.ZodOptional<z.ZodEnum<{
111
- auto: "auto";
112
- on: "on";
113
- off: "off";
114
- }>>;
115
- applyLanguageTextNormalization: z.ZodOptional<z.ZodBoolean>;
116
- enableLogging: z.ZodOptional<z.ZodBoolean>;
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
- languageCode: z.ZodOptional<z.ZodNullable<z.ZodString>>;
122
- tagAudioEvents: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
123
- numSpeakers: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
124
- timestampsGranularity: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
125
- none: "none";
126
- word: "word";
127
- character: "character";
128
- }>>>>;
129
- diarize: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodBoolean>>>;
130
- fileFormat: z.ZodDefault<z.ZodOptional<z.ZodNullable<z.ZodEnum<{
131
- pcm_s16le_16: "pcm_s16le_16";
132
- other: "other";
133
- }>>>>;
134
- streaming: z.ZodOptional<z.ZodNullable<z.ZodObject<{
135
- commitStrategy: z.ZodOptional<z.ZodNullable<z.ZodEnum<{
136
- manual: "manual";
137
- vad: "vad";
138
- }>>>;
139
- enableLogging: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
140
- filterBackgroundAudio: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
141
- includeLanguageDetection: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
142
- includeTimestamps: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
143
- keyterms: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
144
- minSilenceDurationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
145
- minSpeechDurationMs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
146
- noVerbatim: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
147
- previousText: z.ZodOptional<z.ZodNullable<z.ZodString>>;
148
- secondaryLanguages: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodString>>>;
149
- vadSilenceThresholdSecs: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
150
- vadThreshold: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
151
- }, z.core.$strip>>>;
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
- declare const VERSION: string;
156
-
157
- export { type ElevenLabsProvider, type ElevenLabsProviderSettings, type ElevenLabsSpeechModelId, type ElevenLabsSpeechModelOptions, type ElevenLabsSpeechVoiceId, type ElevenLabsTranscriptionModelOptions, VERSION, createElevenLabs, elevenLabs, elevenLabs as elevenlabs };
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"}