@elevenlabs/elevenlabs-js 2.14.0 → 2.15.0
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/Client.js +2 -2
- package/api/resources/conversationalAi/resources/agents/client/Client.d.ts +4 -2
- package/api/resources/conversationalAi/resources/agents/client/Client.js +4 -2
- package/api/resources/conversationalAi/resources/agents/client/requests/BodySimulatesAConversationStreamV1ConvaiAgentsAgentIdSimulateConversationStreamPost.d.ts +2 -1
- package/api/resources/conversationalAi/resources/agents/client/requests/BodySimulatesAConversationV1ConvaiAgentsAgentIdSimulateConversationPost.d.ts +2 -1
- package/api/resources/textToVoice/client/Client.d.ts +16 -0
- package/api/resources/textToVoice/client/Client.js +84 -0
- package/api/resources/textToVoice/client/requests/VoiceRemixRequestModel.d.ts +36 -0
- package/api/resources/textToVoice/client/requests/VoiceRemixRequestModel.js +5 -0
- package/api/resources/textToVoice/client/requests/index.d.ts +1 -0
- package/api/resources/textToVoice/types/TextToVoiceRemixRequestOutputFormat.d.ts +28 -0
- package/api/resources/textToVoice/types/TextToVoiceRemixRequestOutputFormat.js +27 -0
- package/api/resources/textToVoice/types/index.d.ts +1 -0
- package/api/resources/textToVoice/types/index.js +1 -0
- package/api/types/AgentConfig.d.ts +2 -0
- package/api/types/AgentConfigApiModelWorkflowOverride.d.ts +2 -0
- package/api/types/WorkflowToolResponseModelInput.d.ts +0 -1
- package/api/types/WorkflowToolResponseModelOutput.d.ts +0 -1
- package/dist/Client.js +2 -2
- package/dist/api/resources/conversationalAi/resources/agents/client/Client.d.ts +4 -2
- package/dist/api/resources/conversationalAi/resources/agents/client/Client.js +4 -2
- package/dist/api/resources/conversationalAi/resources/agents/client/requests/BodySimulatesAConversationStreamV1ConvaiAgentsAgentIdSimulateConversationStreamPost.d.ts +2 -1
- package/dist/api/resources/conversationalAi/resources/agents/client/requests/BodySimulatesAConversationV1ConvaiAgentsAgentIdSimulateConversationPost.d.ts +2 -1
- package/dist/api/resources/textToVoice/client/Client.d.ts +16 -0
- package/dist/api/resources/textToVoice/client/Client.js +84 -0
- package/dist/api/resources/textToVoice/client/requests/VoiceRemixRequestModel.d.ts +36 -0
- package/dist/api/resources/textToVoice/client/requests/VoiceRemixRequestModel.js +5 -0
- package/dist/api/resources/textToVoice/client/requests/index.d.ts +1 -0
- package/dist/api/resources/textToVoice/types/TextToVoiceRemixRequestOutputFormat.d.ts +28 -0
- package/dist/api/resources/textToVoice/types/TextToVoiceRemixRequestOutputFormat.js +27 -0
- package/dist/api/resources/textToVoice/types/index.d.ts +1 -0
- package/dist/api/resources/textToVoice/types/index.js +1 -0
- package/dist/api/types/AgentConfig.d.ts +2 -0
- package/dist/api/types/AgentConfigApiModelWorkflowOverride.d.ts +2 -0
- package/dist/api/types/WorkflowToolResponseModelInput.d.ts +0 -1
- package/dist/api/types/WorkflowToolResponseModelOutput.d.ts +0 -1
- package/dist/serialization/resources/textToVoice/client/requests/VoiceRemixRequestModel.d.ts +21 -0
- package/dist/serialization/resources/textToVoice/client/requests/VoiceRemixRequestModel.js +52 -0
- package/dist/serialization/resources/textToVoice/client/requests/index.d.ts +1 -0
- package/dist/serialization/resources/textToVoice/client/requests/index.js +3 -1
- package/dist/serialization/resources/textToVoice/types/TextToVoiceRemixRequestOutputFormat.d.ts +10 -0
- package/dist/serialization/resources/textToVoice/types/TextToVoiceRemixRequestOutputFormat.js +61 -0
- package/dist/serialization/resources/textToVoice/types/index.d.ts +1 -0
- package/dist/serialization/resources/textToVoice/types/index.js +1 -0
- package/dist/serialization/types/AgentConfig.d.ts +1 -0
- package/dist/serialization/types/AgentConfig.js +1 -0
- package/dist/serialization/types/AgentConfigApiModelWorkflowOverride.d.ts +1 -0
- package/dist/serialization/types/AgentConfigApiModelWorkflowOverride.js +1 -0
- package/dist/serialization/types/WorkflowToolResponseModelInput.d.ts +0 -2
- package/dist/serialization/types/WorkflowToolResponseModelInput.js +0 -2
- package/dist/serialization/types/WorkflowToolResponseModelOutput.d.ts +0 -2
- package/dist/serialization/types/WorkflowToolResponseModelOutput.js +0 -2
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +1 -1
- package/reference.md +75 -0
- package/serialization/resources/textToVoice/client/requests/VoiceRemixRequestModel.d.ts +21 -0
- package/serialization/resources/textToVoice/client/requests/VoiceRemixRequestModel.js +52 -0
- package/serialization/resources/textToVoice/client/requests/index.d.ts +1 -0
- package/serialization/resources/textToVoice/client/requests/index.js +3 -1
- package/serialization/resources/textToVoice/types/TextToVoiceRemixRequestOutputFormat.d.ts +10 -0
- package/serialization/resources/textToVoice/types/TextToVoiceRemixRequestOutputFormat.js +61 -0
- package/serialization/resources/textToVoice/types/index.d.ts +1 -0
- package/serialization/resources/textToVoice/types/index.js +1 -0
- package/serialization/types/AgentConfig.d.ts +1 -0
- package/serialization/types/AgentConfig.js +1 -0
- package/serialization/types/AgentConfigApiModelWorkflowOverride.d.ts +1 -0
- package/serialization/types/AgentConfigApiModelWorkflowOverride.js +1 -0
- package/serialization/types/WorkflowToolResponseModelInput.d.ts +0 -2
- package/serialization/types/WorkflowToolResponseModelInput.js +0 -2
- package/serialization/types/WorkflowToolResponseModelOutput.d.ts +0 -2
- package/serialization/types/WorkflowToolResponseModelOutput.js +0 -2
- package/version.d.ts +1 -1
- package/version.js +1 -1
package/Client.js
CHANGED
|
@@ -79,8 +79,8 @@ class ElevenLabsClient {
|
|
|
79
79
|
"xi-api-key": _options === null || _options === void 0 ? void 0 : _options.apiKey,
|
|
80
80
|
"X-Fern-Language": "JavaScript",
|
|
81
81
|
"X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js",
|
|
82
|
-
"X-Fern-SDK-Version": "v2.
|
|
83
|
-
"User-Agent": "@elevenlabs/elevenlabs-js/v2.
|
|
82
|
+
"X-Fern-SDK-Version": "v2.15.0",
|
|
83
|
+
"User-Agent": "@elevenlabs/elevenlabs-js/v2.15.0",
|
|
84
84
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
85
85
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
86
86
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -138,7 +138,8 @@ export declare class Agents {
|
|
|
138
138
|
* simulationSpecification: {
|
|
139
139
|
* simulatedUserConfig: {
|
|
140
140
|
* firstMessage: "Hello, how can I help you today?",
|
|
141
|
-
* language: "en"
|
|
141
|
+
* language: "en",
|
|
142
|
+
* disableFirstMessageInterruptions: false
|
|
142
143
|
* }
|
|
143
144
|
* }
|
|
144
145
|
* })
|
|
@@ -159,7 +160,8 @@ export declare class Agents {
|
|
|
159
160
|
* simulationSpecification: {
|
|
160
161
|
* simulatedUserConfig: {
|
|
161
162
|
* firstMessage: "Hello, how can I help you today?",
|
|
162
|
-
* language: "en"
|
|
163
|
+
* language: "en",
|
|
164
|
+
* disableFirstMessageInterruptions: false
|
|
163
165
|
* }
|
|
164
166
|
* }
|
|
165
167
|
* })
|
|
@@ -531,7 +531,8 @@ class Agents {
|
|
|
531
531
|
* simulationSpecification: {
|
|
532
532
|
* simulatedUserConfig: {
|
|
533
533
|
* firstMessage: "Hello, how can I help you today?",
|
|
534
|
-
* language: "en"
|
|
534
|
+
* language: "en",
|
|
535
|
+
* disableFirstMessageInterruptions: false
|
|
535
536
|
* }
|
|
536
537
|
* }
|
|
537
538
|
* })
|
|
@@ -612,7 +613,8 @@ class Agents {
|
|
|
612
613
|
* simulationSpecification: {
|
|
613
614
|
* simulatedUserConfig: {
|
|
614
615
|
* firstMessage: "Hello, how can I help you today?",
|
|
615
|
-
* language: "en"
|
|
616
|
+
* language: "en",
|
|
617
|
+
* disableFirstMessageInterruptions: false
|
|
616
618
|
* }
|
|
617
619
|
* }
|
|
618
620
|
* })
|
|
@@ -8,7 +8,8 @@ import * as ElevenLabs from "../../../../../../index";
|
|
|
8
8
|
* simulationSpecification: {
|
|
9
9
|
* simulatedUserConfig: {
|
|
10
10
|
* firstMessage: "Hello, how can I help you today?",
|
|
11
|
-
* language: "en"
|
|
11
|
+
* language: "en",
|
|
12
|
+
* disableFirstMessageInterruptions: false
|
|
12
13
|
* }
|
|
13
14
|
* }
|
|
14
15
|
* }
|
|
@@ -8,7 +8,8 @@ import * as ElevenLabs from "../../../../../../index";
|
|
|
8
8
|
* simulationSpecification: {
|
|
9
9
|
* simulatedUserConfig: {
|
|
10
10
|
* firstMessage: "Hello, how can I help you today?",
|
|
11
|
-
* language: "en"
|
|
11
|
+
* language: "en",
|
|
12
|
+
* disableFirstMessageInterruptions: false
|
|
12
13
|
* }
|
|
13
14
|
* }
|
|
14
15
|
* }
|
|
@@ -80,4 +80,20 @@ export declare class TextToVoice {
|
|
|
80
80
|
*/
|
|
81
81
|
design(request: ElevenLabs.VoiceDesignRequestModel, requestOptions?: TextToVoice.RequestOptions): core.HttpResponsePromise<ElevenLabs.VoiceDesignPreviewResponse>;
|
|
82
82
|
private __design;
|
|
83
|
+
/**
|
|
84
|
+
* Remix an existing voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint.
|
|
85
|
+
*
|
|
86
|
+
* @param {string} voiceId - Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
|
|
87
|
+
* @param {ElevenLabs.VoiceRemixRequestModel} request
|
|
88
|
+
* @param {TextToVoice.RequestOptions} requestOptions - Request-specific configuration.
|
|
89
|
+
*
|
|
90
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* await client.textToVoice.remix("21m00Tcm4TlvDq8ikWAM", {
|
|
94
|
+
* voiceDescription: "Make the voice have a higher pitch."
|
|
95
|
+
* })
|
|
96
|
+
*/
|
|
97
|
+
remix(voiceId: string, request: ElevenLabs.VoiceRemixRequestModel, requestOptions?: TextToVoice.RequestOptions): core.HttpResponsePromise<ElevenLabs.VoiceDesignPreviewResponse>;
|
|
98
|
+
private __remix;
|
|
83
99
|
}
|
|
@@ -315,5 +315,89 @@ class TextToVoice {
|
|
|
315
315
|
}
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* Remix an existing voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint.
|
|
320
|
+
*
|
|
321
|
+
* @param {string} voiceId - Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
|
|
322
|
+
* @param {ElevenLabs.VoiceRemixRequestModel} request
|
|
323
|
+
* @param {TextToVoice.RequestOptions} requestOptions - Request-specific configuration.
|
|
324
|
+
*
|
|
325
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
326
|
+
*
|
|
327
|
+
* @example
|
|
328
|
+
* await client.textToVoice.remix("21m00Tcm4TlvDq8ikWAM", {
|
|
329
|
+
* voiceDescription: "Make the voice have a higher pitch."
|
|
330
|
+
* })
|
|
331
|
+
*/
|
|
332
|
+
remix(voiceId, request, requestOptions) {
|
|
333
|
+
return core.HttpResponsePromise.fromPromise(this.__remix(voiceId, request, requestOptions));
|
|
334
|
+
}
|
|
335
|
+
__remix(voiceId, request, requestOptions) {
|
|
336
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
337
|
+
var _a, _b, _c;
|
|
338
|
+
const { outputFormat } = request, _body = __rest(request, ["outputFormat"]);
|
|
339
|
+
const _queryParams = {};
|
|
340
|
+
if (outputFormat != null) {
|
|
341
|
+
_queryParams["output_format"] = serializers.TextToVoiceRemixRequestOutputFormat.jsonOrThrow(outputFormat, {
|
|
342
|
+
unrecognizedObjectKeys: "strip",
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
const _response = yield core.fetcher({
|
|
346
|
+
url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, `v1/text-to-voice/${encodeURIComponent(voiceId)}/remix`),
|
|
347
|
+
method: "POST",
|
|
348
|
+
headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
349
|
+
contentType: "application/json",
|
|
350
|
+
queryParameters: _queryParams,
|
|
351
|
+
requestType: "json",
|
|
352
|
+
body: serializers.VoiceRemixRequestModel.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
353
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
354
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
355
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
356
|
+
});
|
|
357
|
+
if (_response.ok) {
|
|
358
|
+
return {
|
|
359
|
+
data: serializers.VoiceDesignPreviewResponse.parseOrThrow(_response.body, {
|
|
360
|
+
unrecognizedObjectKeys: "passthrough",
|
|
361
|
+
allowUnrecognizedUnionMembers: true,
|
|
362
|
+
allowUnrecognizedEnumValues: true,
|
|
363
|
+
breadcrumbsPrefix: ["response"],
|
|
364
|
+
}),
|
|
365
|
+
rawResponse: _response.rawResponse,
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
if (_response.error.reason === "status-code") {
|
|
369
|
+
switch (_response.error.statusCode) {
|
|
370
|
+
case 422:
|
|
371
|
+
throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
372
|
+
unrecognizedObjectKeys: "passthrough",
|
|
373
|
+
allowUnrecognizedUnionMembers: true,
|
|
374
|
+
allowUnrecognizedEnumValues: true,
|
|
375
|
+
breadcrumbsPrefix: ["response"],
|
|
376
|
+
}), _response.rawResponse);
|
|
377
|
+
default:
|
|
378
|
+
throw new errors.ElevenLabsError({
|
|
379
|
+
statusCode: _response.error.statusCode,
|
|
380
|
+
body: _response.error.body,
|
|
381
|
+
rawResponse: _response.rawResponse,
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
switch (_response.error.reason) {
|
|
386
|
+
case "non-json":
|
|
387
|
+
throw new errors.ElevenLabsError({
|
|
388
|
+
statusCode: _response.error.statusCode,
|
|
389
|
+
body: _response.error.rawBody,
|
|
390
|
+
rawResponse: _response.rawResponse,
|
|
391
|
+
});
|
|
392
|
+
case "timeout":
|
|
393
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/text-to-voice/{voice_id}/remix.");
|
|
394
|
+
case "unknown":
|
|
395
|
+
throw new errors.ElevenLabsError({
|
|
396
|
+
message: _response.error.errorMessage,
|
|
397
|
+
rawResponse: _response.rawResponse,
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
}
|
|
318
402
|
}
|
|
319
403
|
exports.TextToVoice = TextToVoice;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as ElevenLabs from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* voiceDescription: "Make the voice have a higher pitch."
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface VoiceRemixRequestModel {
|
|
12
|
+
/**
|
|
13
|
+
* Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
|
|
14
|
+
*/
|
|
15
|
+
outputFormat?: ElevenLabs.TextToVoiceRemixRequestOutputFormat;
|
|
16
|
+
/** Description of the changes to make to the voice. */
|
|
17
|
+
voiceDescription: string;
|
|
18
|
+
/** Text to generate, text length has to be between 100 and 1000. */
|
|
19
|
+
text?: string;
|
|
20
|
+
/** Whether to automatically generate a text suitable for the voice description. */
|
|
21
|
+
autoGenerateText?: boolean;
|
|
22
|
+
/** Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. */
|
|
23
|
+
loudness?: number;
|
|
24
|
+
/** Random number that controls the voice generation. Same seed with same inputs produces same voice. */
|
|
25
|
+
seed?: number;
|
|
26
|
+
/** Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. */
|
|
27
|
+
guidanceScale?: number;
|
|
28
|
+
/** Determines whether the Text to Voice previews should be included in the response. If true, only the generated IDs will be returned which can then be streamed via the /v1/text-to-voice/:generated_voice_id/stream endpoint. */
|
|
29
|
+
streamPreviews?: boolean;
|
|
30
|
+
/** The remixing session id. */
|
|
31
|
+
remixingSessionId?: string;
|
|
32
|
+
/** The id of the remixing session iteration where these generations should be attached to. If not provided, a new iteration will be created. */
|
|
33
|
+
remixingSessionIterationId?: string;
|
|
34
|
+
/** Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model and providing reference audio. */
|
|
35
|
+
promptStrength?: number;
|
|
36
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { type VoiceDesignRequest } from "./VoiceDesignRequest";
|
|
2
2
|
export { type BodyCreateANewVoiceFromVoicePreviewV1TextToVoicePost } from "./BodyCreateANewVoiceFromVoicePreviewV1TextToVoicePost";
|
|
3
3
|
export { type VoiceDesignRequestModel } from "./VoiceDesignRequestModel";
|
|
4
|
+
export { type VoiceRemixRequestModel } from "./VoiceRemixRequestModel";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
|
|
6
|
+
*/
|
|
7
|
+
export type TextToVoiceRemixRequestOutputFormat = "mp3_22050_32" | "mp3_44100_32" | "mp3_44100_64" | "mp3_44100_96" | "mp3_44100_128" | "mp3_44100_192" | "pcm_8000" | "pcm_16000" | "pcm_22050" | "pcm_24000" | "pcm_44100" | "pcm_48000" | "ulaw_8000" | "alaw_8000" | "opus_48000_32" | "opus_48000_64" | "opus_48000_96" | "opus_48000_128" | "opus_48000_192";
|
|
8
|
+
export declare const TextToVoiceRemixRequestOutputFormat: {
|
|
9
|
+
readonly Mp32205032: "mp3_22050_32";
|
|
10
|
+
readonly Mp34410032: "mp3_44100_32";
|
|
11
|
+
readonly Mp34410064: "mp3_44100_64";
|
|
12
|
+
readonly Mp34410096: "mp3_44100_96";
|
|
13
|
+
readonly Mp344100128: "mp3_44100_128";
|
|
14
|
+
readonly Mp344100192: "mp3_44100_192";
|
|
15
|
+
readonly Pcm8000: "pcm_8000";
|
|
16
|
+
readonly Pcm16000: "pcm_16000";
|
|
17
|
+
readonly Pcm22050: "pcm_22050";
|
|
18
|
+
readonly Pcm24000: "pcm_24000";
|
|
19
|
+
readonly Pcm44100: "pcm_44100";
|
|
20
|
+
readonly Pcm48000: "pcm_48000";
|
|
21
|
+
readonly Ulaw8000: "ulaw_8000";
|
|
22
|
+
readonly Alaw8000: "alaw_8000";
|
|
23
|
+
readonly Opus4800032: "opus_48000_32";
|
|
24
|
+
readonly Opus4800064: "opus_48000_64";
|
|
25
|
+
readonly Opus4800096: "opus_48000_96";
|
|
26
|
+
readonly Opus48000128: "opus_48000_128";
|
|
27
|
+
readonly Opus48000192: "opus_48000_192";
|
|
28
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.TextToVoiceRemixRequestOutputFormat = void 0;
|
|
7
|
+
exports.TextToVoiceRemixRequestOutputFormat = {
|
|
8
|
+
Mp32205032: "mp3_22050_32",
|
|
9
|
+
Mp34410032: "mp3_44100_32",
|
|
10
|
+
Mp34410064: "mp3_44100_64",
|
|
11
|
+
Mp34410096: "mp3_44100_96",
|
|
12
|
+
Mp344100128: "mp3_44100_128",
|
|
13
|
+
Mp344100192: "mp3_44100_192",
|
|
14
|
+
Pcm8000: "pcm_8000",
|
|
15
|
+
Pcm16000: "pcm_16000",
|
|
16
|
+
Pcm22050: "pcm_22050",
|
|
17
|
+
Pcm24000: "pcm_24000",
|
|
18
|
+
Pcm44100: "pcm_44100",
|
|
19
|
+
Pcm48000: "pcm_48000",
|
|
20
|
+
Ulaw8000: "ulaw_8000",
|
|
21
|
+
Alaw8000: "alaw_8000",
|
|
22
|
+
Opus4800032: "opus_48000_32",
|
|
23
|
+
Opus4800064: "opus_48000_64",
|
|
24
|
+
Opus4800096: "opus_48000_96",
|
|
25
|
+
Opus48000128: "opus_48000_128",
|
|
26
|
+
Opus48000192: "opus_48000_192",
|
|
27
|
+
};
|
|
@@ -17,3 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./TextToVoiceCreatePreviewsRequestOutputFormat"), exports);
|
|
18
18
|
__exportStar(require("./TextToVoiceDesignRequestOutputFormat"), exports);
|
|
19
19
|
__exportStar(require("./VoiceDesignRequestModelModelId"), exports);
|
|
20
|
+
__exportStar(require("./TextToVoiceRemixRequestOutputFormat"), exports);
|
|
@@ -9,6 +9,8 @@ export interface AgentConfig {
|
|
|
9
9
|
language?: string;
|
|
10
10
|
/** Configuration for dynamic variables */
|
|
11
11
|
dynamicVariables?: ElevenLabs.DynamicVariablesConfig;
|
|
12
|
+
/** If true, the user will not be able to interrupt the agent while the first message is being delivered. */
|
|
13
|
+
disableFirstMessageInterruptions?: boolean;
|
|
12
14
|
/** The prompt for the agent */
|
|
13
15
|
prompt?: ElevenLabs.PromptAgentApiModelOutput;
|
|
14
16
|
}
|
|
@@ -9,6 +9,8 @@ export interface AgentConfigApiModelWorkflowOverride {
|
|
|
9
9
|
language?: string;
|
|
10
10
|
/** Configuration for dynamic variables */
|
|
11
11
|
dynamicVariables?: ElevenLabs.DynamicVariablesConfigWorkflowOverride;
|
|
12
|
+
/** If true, the user will not be able to interrupt the agent while the first message is being delivered. */
|
|
13
|
+
disableFirstMessageInterruptions?: boolean;
|
|
12
14
|
/** The prompt for the agent */
|
|
13
15
|
prompt?: ElevenLabs.PromptAgentApiModelWorkflowOverride;
|
|
14
16
|
}
|
|
@@ -6,6 +6,5 @@ import * as ElevenLabs from "../index";
|
|
|
6
6
|
* A common model for workflow tool responses.
|
|
7
7
|
*/
|
|
8
8
|
export interface WorkflowToolResponseModelInput {
|
|
9
|
-
finalTransfer?: ElevenLabs.TransferToAgentToolResultSuccessModel;
|
|
10
9
|
steps?: ElevenLabs.WorkflowToolResponseModelInputStepsItem[];
|
|
11
10
|
}
|
|
@@ -6,6 +6,5 @@ import * as ElevenLabs from "../index";
|
|
|
6
6
|
* A common model for workflow tool responses.
|
|
7
7
|
*/
|
|
8
8
|
export interface WorkflowToolResponseModelOutput {
|
|
9
|
-
finalTransfer?: ElevenLabs.TransferToAgentToolResultSuccessModel;
|
|
10
9
|
steps?: ElevenLabs.WorkflowToolResponseModelOutputStepsItem[];
|
|
11
10
|
}
|
package/dist/Client.js
CHANGED
|
@@ -79,8 +79,8 @@ class ElevenLabsClient {
|
|
|
79
79
|
"xi-api-key": _options === null || _options === void 0 ? void 0 : _options.apiKey,
|
|
80
80
|
"X-Fern-Language": "JavaScript",
|
|
81
81
|
"X-Fern-SDK-Name": "@elevenlabs/elevenlabs-js",
|
|
82
|
-
"X-Fern-SDK-Version": "v2.
|
|
83
|
-
"User-Agent": "@elevenlabs/elevenlabs-js/v2.
|
|
82
|
+
"X-Fern-SDK-Version": "v2.15.0",
|
|
83
|
+
"User-Agent": "@elevenlabs/elevenlabs-js/v2.15.0",
|
|
84
84
|
"X-Fern-Runtime": core.RUNTIME.type,
|
|
85
85
|
"X-Fern-Runtime-Version": core.RUNTIME.version,
|
|
86
86
|
}, _options === null || _options === void 0 ? void 0 : _options.headers) });
|
|
@@ -138,7 +138,8 @@ export declare class Agents {
|
|
|
138
138
|
* simulationSpecification: {
|
|
139
139
|
* simulatedUserConfig: {
|
|
140
140
|
* firstMessage: "Hello, how can I help you today?",
|
|
141
|
-
* language: "en"
|
|
141
|
+
* language: "en",
|
|
142
|
+
* disableFirstMessageInterruptions: false
|
|
142
143
|
* }
|
|
143
144
|
* }
|
|
144
145
|
* })
|
|
@@ -159,7 +160,8 @@ export declare class Agents {
|
|
|
159
160
|
* simulationSpecification: {
|
|
160
161
|
* simulatedUserConfig: {
|
|
161
162
|
* firstMessage: "Hello, how can I help you today?",
|
|
162
|
-
* language: "en"
|
|
163
|
+
* language: "en",
|
|
164
|
+
* disableFirstMessageInterruptions: false
|
|
163
165
|
* }
|
|
164
166
|
* }
|
|
165
167
|
* })
|
|
@@ -531,7 +531,8 @@ class Agents {
|
|
|
531
531
|
* simulationSpecification: {
|
|
532
532
|
* simulatedUserConfig: {
|
|
533
533
|
* firstMessage: "Hello, how can I help you today?",
|
|
534
|
-
* language: "en"
|
|
534
|
+
* language: "en",
|
|
535
|
+
* disableFirstMessageInterruptions: false
|
|
535
536
|
* }
|
|
536
537
|
* }
|
|
537
538
|
* })
|
|
@@ -612,7 +613,8 @@ class Agents {
|
|
|
612
613
|
* simulationSpecification: {
|
|
613
614
|
* simulatedUserConfig: {
|
|
614
615
|
* firstMessage: "Hello, how can I help you today?",
|
|
615
|
-
* language: "en"
|
|
616
|
+
* language: "en",
|
|
617
|
+
* disableFirstMessageInterruptions: false
|
|
616
618
|
* }
|
|
617
619
|
* }
|
|
618
620
|
* })
|
|
@@ -8,7 +8,8 @@ import * as ElevenLabs from "../../../../../../index";
|
|
|
8
8
|
* simulationSpecification: {
|
|
9
9
|
* simulatedUserConfig: {
|
|
10
10
|
* firstMessage: "Hello, how can I help you today?",
|
|
11
|
-
* language: "en"
|
|
11
|
+
* language: "en",
|
|
12
|
+
* disableFirstMessageInterruptions: false
|
|
12
13
|
* }
|
|
13
14
|
* }
|
|
14
15
|
* }
|
|
@@ -8,7 +8,8 @@ import * as ElevenLabs from "../../../../../../index";
|
|
|
8
8
|
* simulationSpecification: {
|
|
9
9
|
* simulatedUserConfig: {
|
|
10
10
|
* firstMessage: "Hello, how can I help you today?",
|
|
11
|
-
* language: "en"
|
|
11
|
+
* language: "en",
|
|
12
|
+
* disableFirstMessageInterruptions: false
|
|
12
13
|
* }
|
|
13
14
|
* }
|
|
14
15
|
* }
|
|
@@ -80,4 +80,20 @@ export declare class TextToVoice {
|
|
|
80
80
|
*/
|
|
81
81
|
design(request: ElevenLabs.VoiceDesignRequestModel, requestOptions?: TextToVoice.RequestOptions): core.HttpResponsePromise<ElevenLabs.VoiceDesignPreviewResponse>;
|
|
82
82
|
private __design;
|
|
83
|
+
/**
|
|
84
|
+
* Remix an existing voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint.
|
|
85
|
+
*
|
|
86
|
+
* @param {string} voiceId - Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
|
|
87
|
+
* @param {ElevenLabs.VoiceRemixRequestModel} request
|
|
88
|
+
* @param {TextToVoice.RequestOptions} requestOptions - Request-specific configuration.
|
|
89
|
+
*
|
|
90
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
91
|
+
*
|
|
92
|
+
* @example
|
|
93
|
+
* await client.textToVoice.remix("21m00Tcm4TlvDq8ikWAM", {
|
|
94
|
+
* voiceDescription: "Make the voice have a higher pitch."
|
|
95
|
+
* })
|
|
96
|
+
*/
|
|
97
|
+
remix(voiceId: string, request: ElevenLabs.VoiceRemixRequestModel, requestOptions?: TextToVoice.RequestOptions): core.HttpResponsePromise<ElevenLabs.VoiceDesignPreviewResponse>;
|
|
98
|
+
private __remix;
|
|
83
99
|
}
|
|
@@ -315,5 +315,89 @@ class TextToVoice {
|
|
|
315
315
|
}
|
|
316
316
|
});
|
|
317
317
|
}
|
|
318
|
+
/**
|
|
319
|
+
* Remix an existing voice via a prompt. This method returns a list of voice previews. Each preview has a generated_voice_id and a sample of the voice as base64 encoded mp3 audio. To create a voice use the generated_voice_id of the preferred preview with the /v1/text-to-voice endpoint.
|
|
320
|
+
*
|
|
321
|
+
* @param {string} voiceId - Voice ID to be used, you can use https://api.elevenlabs.io/v1/voices to list all the available voices.
|
|
322
|
+
* @param {ElevenLabs.VoiceRemixRequestModel} request
|
|
323
|
+
* @param {TextToVoice.RequestOptions} requestOptions - Request-specific configuration.
|
|
324
|
+
*
|
|
325
|
+
* @throws {@link ElevenLabs.UnprocessableEntityError}
|
|
326
|
+
*
|
|
327
|
+
* @example
|
|
328
|
+
* await client.textToVoice.remix("21m00Tcm4TlvDq8ikWAM", {
|
|
329
|
+
* voiceDescription: "Make the voice have a higher pitch."
|
|
330
|
+
* })
|
|
331
|
+
*/
|
|
332
|
+
remix(voiceId, request, requestOptions) {
|
|
333
|
+
return core.HttpResponsePromise.fromPromise(this.__remix(voiceId, request, requestOptions));
|
|
334
|
+
}
|
|
335
|
+
__remix(voiceId, request, requestOptions) {
|
|
336
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
337
|
+
var _a, _b, _c;
|
|
338
|
+
const { outputFormat } = request, _body = __rest(request, ["outputFormat"]);
|
|
339
|
+
const _queryParams = {};
|
|
340
|
+
if (outputFormat != null) {
|
|
341
|
+
_queryParams["output_format"] = serializers.TextToVoiceRemixRequestOutputFormat.jsonOrThrow(outputFormat, {
|
|
342
|
+
unrecognizedObjectKeys: "strip",
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
const _response = yield core.fetcher({
|
|
346
|
+
url: core.url.join((_b = (_a = (yield core.Supplier.get(this._options.baseUrl))) !== null && _a !== void 0 ? _a : (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.ElevenLabsEnvironment.Production, `v1/text-to-voice/${encodeURIComponent(voiceId)}/remix`),
|
|
347
|
+
method: "POST",
|
|
348
|
+
headers: (0, headers_1.mergeHeaders)((_c = this._options) === null || _c === void 0 ? void 0 : _c.headers, (0, headers_1.mergeOnlyDefinedHeaders)({ "xi-api-key": requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.apiKey }), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
349
|
+
contentType: "application/json",
|
|
350
|
+
queryParameters: _queryParams,
|
|
351
|
+
requestType: "json",
|
|
352
|
+
body: serializers.VoiceRemixRequestModel.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
353
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 240000,
|
|
354
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
355
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
356
|
+
});
|
|
357
|
+
if (_response.ok) {
|
|
358
|
+
return {
|
|
359
|
+
data: serializers.VoiceDesignPreviewResponse.parseOrThrow(_response.body, {
|
|
360
|
+
unrecognizedObjectKeys: "passthrough",
|
|
361
|
+
allowUnrecognizedUnionMembers: true,
|
|
362
|
+
allowUnrecognizedEnumValues: true,
|
|
363
|
+
breadcrumbsPrefix: ["response"],
|
|
364
|
+
}),
|
|
365
|
+
rawResponse: _response.rawResponse,
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
if (_response.error.reason === "status-code") {
|
|
369
|
+
switch (_response.error.statusCode) {
|
|
370
|
+
case 422:
|
|
371
|
+
throw new ElevenLabs.UnprocessableEntityError(serializers.HttpValidationError.parseOrThrow(_response.error.body, {
|
|
372
|
+
unrecognizedObjectKeys: "passthrough",
|
|
373
|
+
allowUnrecognizedUnionMembers: true,
|
|
374
|
+
allowUnrecognizedEnumValues: true,
|
|
375
|
+
breadcrumbsPrefix: ["response"],
|
|
376
|
+
}), _response.rawResponse);
|
|
377
|
+
default:
|
|
378
|
+
throw new errors.ElevenLabsError({
|
|
379
|
+
statusCode: _response.error.statusCode,
|
|
380
|
+
body: _response.error.body,
|
|
381
|
+
rawResponse: _response.rawResponse,
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
switch (_response.error.reason) {
|
|
386
|
+
case "non-json":
|
|
387
|
+
throw new errors.ElevenLabsError({
|
|
388
|
+
statusCode: _response.error.statusCode,
|
|
389
|
+
body: _response.error.rawBody,
|
|
390
|
+
rawResponse: _response.rawResponse,
|
|
391
|
+
});
|
|
392
|
+
case "timeout":
|
|
393
|
+
throw new errors.ElevenLabsTimeoutError("Timeout exceeded when calling POST /v1/text-to-voice/{voice_id}/remix.");
|
|
394
|
+
case "unknown":
|
|
395
|
+
throw new errors.ElevenLabsError({
|
|
396
|
+
message: _response.error.errorMessage,
|
|
397
|
+
rawResponse: _response.rawResponse,
|
|
398
|
+
});
|
|
399
|
+
}
|
|
400
|
+
});
|
|
401
|
+
}
|
|
318
402
|
}
|
|
319
403
|
exports.TextToVoice = TextToVoice;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as ElevenLabs from "../../../../index";
|
|
5
|
+
/**
|
|
6
|
+
* @example
|
|
7
|
+
* {
|
|
8
|
+
* voiceDescription: "Make the voice have a higher pitch."
|
|
9
|
+
* }
|
|
10
|
+
*/
|
|
11
|
+
export interface VoiceRemixRequestModel {
|
|
12
|
+
/**
|
|
13
|
+
* Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
|
|
14
|
+
*/
|
|
15
|
+
outputFormat?: ElevenLabs.TextToVoiceRemixRequestOutputFormat;
|
|
16
|
+
/** Description of the changes to make to the voice. */
|
|
17
|
+
voiceDescription: string;
|
|
18
|
+
/** Text to generate, text length has to be between 100 and 1000. */
|
|
19
|
+
text?: string;
|
|
20
|
+
/** Whether to automatically generate a text suitable for the voice description. */
|
|
21
|
+
autoGenerateText?: boolean;
|
|
22
|
+
/** Controls the volume level of the generated voice. -1 is quietest, 1 is loudest, 0 corresponds to roughly -24 LUFS. */
|
|
23
|
+
loudness?: number;
|
|
24
|
+
/** Random number that controls the voice generation. Same seed with same inputs produces same voice. */
|
|
25
|
+
seed?: number;
|
|
26
|
+
/** Controls how closely the AI follows the prompt. Lower numbers give the AI more freedom to be creative, while higher numbers force it to stick more to the prompt. High numbers can cause voice to sound artificial or robotic. We recommend to use longer, more detailed prompts at lower Guidance Scale. */
|
|
27
|
+
guidanceScale?: number;
|
|
28
|
+
/** Determines whether the Text to Voice previews should be included in the response. If true, only the generated IDs will be returned which can then be streamed via the /v1/text-to-voice/:generated_voice_id/stream endpoint. */
|
|
29
|
+
streamPreviews?: boolean;
|
|
30
|
+
/** The remixing session id. */
|
|
31
|
+
remixingSessionId?: string;
|
|
32
|
+
/** The id of the remixing session iteration where these generations should be attached to. If not provided, a new iteration will be created. */
|
|
33
|
+
remixingSessionIterationId?: string;
|
|
34
|
+
/** Controls the balance of prompt versus reference audio when generating voice samples. 0 means almost no prompt influence, 1 means almost no reference audio influence. Only supported when using the eleven_ttv_v3 model and providing reference audio. */
|
|
35
|
+
promptStrength?: number;
|
|
36
|
+
}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export { type VoiceDesignRequest } from "./VoiceDesignRequest";
|
|
2
2
|
export { type BodyCreateANewVoiceFromVoicePreviewV1TextToVoicePost } from "./BodyCreateANewVoiceFromVoicePreviewV1TextToVoicePost";
|
|
3
3
|
export { type VoiceDesignRequestModel } from "./VoiceDesignRequestModel";
|
|
4
|
+
export { type VoiceRemixRequestModel } from "./VoiceRemixRequestModel";
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Output format of the generated audio. Formatted as codec_sample_rate_bitrate. So an mp3 with 22.05kHz sample rate at 32kbs is represented as mp3_22050_32. MP3 with 192kbps bitrate requires you to be subscribed to Creator tier or above. PCM with 44.1kHz sample rate requires you to be subscribed to Pro tier or above. Note that the μ-law format (sometimes written mu-law, often approximated as u-law) is commonly used for Twilio audio inputs.
|
|
6
|
+
*/
|
|
7
|
+
export type TextToVoiceRemixRequestOutputFormat = "mp3_22050_32" | "mp3_44100_32" | "mp3_44100_64" | "mp3_44100_96" | "mp3_44100_128" | "mp3_44100_192" | "pcm_8000" | "pcm_16000" | "pcm_22050" | "pcm_24000" | "pcm_44100" | "pcm_48000" | "ulaw_8000" | "alaw_8000" | "opus_48000_32" | "opus_48000_64" | "opus_48000_96" | "opus_48000_128" | "opus_48000_192";
|
|
8
|
+
export declare const TextToVoiceRemixRequestOutputFormat: {
|
|
9
|
+
readonly Mp32205032: "mp3_22050_32";
|
|
10
|
+
readonly Mp34410032: "mp3_44100_32";
|
|
11
|
+
readonly Mp34410064: "mp3_44100_64";
|
|
12
|
+
readonly Mp34410096: "mp3_44100_96";
|
|
13
|
+
readonly Mp344100128: "mp3_44100_128";
|
|
14
|
+
readonly Mp344100192: "mp3_44100_192";
|
|
15
|
+
readonly Pcm8000: "pcm_8000";
|
|
16
|
+
readonly Pcm16000: "pcm_16000";
|
|
17
|
+
readonly Pcm22050: "pcm_22050";
|
|
18
|
+
readonly Pcm24000: "pcm_24000";
|
|
19
|
+
readonly Pcm44100: "pcm_44100";
|
|
20
|
+
readonly Pcm48000: "pcm_48000";
|
|
21
|
+
readonly Ulaw8000: "ulaw_8000";
|
|
22
|
+
readonly Alaw8000: "alaw_8000";
|
|
23
|
+
readonly Opus4800032: "opus_48000_32";
|
|
24
|
+
readonly Opus4800064: "opus_48000_64";
|
|
25
|
+
readonly Opus4800096: "opus_48000_96";
|
|
26
|
+
readonly Opus48000128: "opus_48000_128";
|
|
27
|
+
readonly Opus48000192: "opus_48000_192";
|
|
28
|
+
};
|