@picsart/ai-sdk 6.17.1 → 6.18.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/_vendor/workflows-types/index.d.ts +1906 -1733
- package/index.d.ts +29 -0
- package/index.js +135 -47
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -183,6 +183,16 @@ type ModelInputById = {
|
|
|
183
183
|
"eleven-audio-isolation": {
|
|
184
184
|
audioUrl: string;
|
|
185
185
|
};
|
|
186
|
+
"eleven-dialogue-v4": {
|
|
187
|
+
dialogue: Array<{
|
|
188
|
+
voiceId: string;
|
|
189
|
+
text: string;
|
|
190
|
+
}>;
|
|
191
|
+
stability?: number;
|
|
192
|
+
similarity?: number;
|
|
193
|
+
language?: string;
|
|
194
|
+
seed?: number;
|
|
195
|
+
};
|
|
186
196
|
"eleven-dubbing": {
|
|
187
197
|
audioUrl: string;
|
|
188
198
|
language: string;
|
|
@@ -244,6 +254,22 @@ type ModelInputById = {
|
|
|
244
254
|
useSpeakerBoost?: boolean;
|
|
245
255
|
withTimestamps?: boolean;
|
|
246
256
|
};
|
|
257
|
+
"eleven-v4": {
|
|
258
|
+
language?: string;
|
|
259
|
+
prompt: string;
|
|
260
|
+
voiceId?: string;
|
|
261
|
+
stability?: number;
|
|
262
|
+
similarityBoost?: number;
|
|
263
|
+
withTimestamps?: boolean;
|
|
264
|
+
};
|
|
265
|
+
"eleven-v4-turbo": {
|
|
266
|
+
language?: string;
|
|
267
|
+
prompt: string;
|
|
268
|
+
voiceId?: string;
|
|
269
|
+
stability?: number;
|
|
270
|
+
similarityBoost?: number;
|
|
271
|
+
withTimestamps?: boolean;
|
|
272
|
+
};
|
|
247
273
|
"eleven-video-to-music": {
|
|
248
274
|
videoUrls: [string, ...string[]];
|
|
249
275
|
prompt?: string;
|
|
@@ -3225,6 +3251,7 @@ declare const Models: {
|
|
|
3225
3251
|
readonly CreatifyAurora: "creatify-aurora";
|
|
3226
3252
|
readonly CreatifyBoreal: "creatify-boreal";
|
|
3227
3253
|
readonly ElevenAudioIsolation: "eleven-audio-isolation";
|
|
3254
|
+
readonly ElevenDialogueV4: "eleven-dialogue-v4";
|
|
3228
3255
|
readonly ElevenDubbing: "eleven-dubbing";
|
|
3229
3256
|
readonly ElevenMultilingualStsV2: "eleven-multilingual-sts-v2";
|
|
3230
3257
|
readonly ElevenMultilingualV2: "eleven-multilingual-v2";
|
|
@@ -3232,6 +3259,8 @@ declare const Models: {
|
|
|
3232
3259
|
readonly ElevenStsV2: "eleven-sts-v2";
|
|
3233
3260
|
readonly ElevenTextToDialogue: "eleven-text-to-dialogue";
|
|
3234
3261
|
readonly ElevenV3: "eleven-v3";
|
|
3262
|
+
readonly ElevenV4: "eleven-v4";
|
|
3263
|
+
readonly ElevenV4Turbo: "eleven-v4-turbo";
|
|
3235
3264
|
readonly ElevenVideoToMusic: "eleven-video-to-music";
|
|
3236
3265
|
readonly ElevenVoiceCreate: "eleven-voice-create";
|
|
3237
3266
|
readonly ElevenVoiceDesignV2: "eleven-voice-design-v2";
|
package/index.js
CHANGED
|
@@ -7146,7 +7146,7 @@ var buildElevenLabsVoicePreviewsPayload = (ctx) => ({
|
|
|
7146
7146
|
voice_description: ctx.prompt,
|
|
7147
7147
|
auto_generate_text: true
|
|
7148
7148
|
});
|
|
7149
|
-
var
|
|
7149
|
+
var stabilityAndSimilarityParams = {
|
|
7150
7150
|
stability: {
|
|
7151
7151
|
label: "Stability",
|
|
7152
7152
|
descriptor: { kind: "range", min: 0, max: 1, step: 0.05 }
|
|
@@ -7154,7 +7154,10 @@ var voiceSettingsParams = (withSpeakerBoost) => ({
|
|
|
7154
7154
|
similarityBoost: {
|
|
7155
7155
|
label: "Similarity",
|
|
7156
7156
|
descriptor: { kind: "range", min: 0, max: 1, step: 0.05 }
|
|
7157
|
-
}
|
|
7157
|
+
}
|
|
7158
|
+
};
|
|
7159
|
+
var voiceSettingsParams = (withSpeakerBoost) => ({
|
|
7160
|
+
...stabilityAndSimilarityParams,
|
|
7158
7161
|
// `style` is taken on GenerationContext by the image models' style *name*,
|
|
7159
7162
|
// so the vendor's 0–1 style exaggeration gets a key of its own.
|
|
7160
7163
|
styleExaggeration: {
|
|
@@ -7167,21 +7170,69 @@ var voiceSettingsParams = (withSpeakerBoost) => ({
|
|
|
7167
7170
|
},
|
|
7168
7171
|
...withSpeakerBoost ? { useSpeakerBoost: { label: "Speaker Boost", descriptor: { kind: "boolean", default: true } } } : {}
|
|
7169
7172
|
});
|
|
7170
|
-
var ttsParamConfig = (promptMaxLength,
|
|
7171
|
-
// language_code is honoured by eleven_v3
|
|
7173
|
+
var ttsParamConfig = (promptMaxLength, opts) => ({
|
|
7174
|
+
// language_code is honoured by eleven_v3 and v4 — the vendor documents it as
|
|
7172
7175
|
// "not supported for multilingual_v2 models" (silently ignored there).
|
|
7173
7176
|
// No accent param anywhere: no builder ever read it.
|
|
7174
|
-
...
|
|
7177
|
+
...opts.language ? params.language(false) : {},
|
|
7175
7178
|
...params.prompt({ maxLength: promptMaxLength }),
|
|
7176
7179
|
...params.voiceId([], DEFAULT_VOICE_ID, { catalog: VOICE_CATALOG }),
|
|
7177
|
-
...voiceSettingsParams(true),
|
|
7180
|
+
...opts.styleControls ? voiceSettingsParams(true) : stabilityAndSimilarityParams,
|
|
7178
7181
|
// Timings come back beside the audio, for captions and lip sync. Off by
|
|
7179
7182
|
// default: the vendor answers a different route that inlines the audio as
|
|
7180
7183
|
// base64, and callers who do not need timings should not pay the decode.
|
|
7181
7184
|
...p.boolean("withTimestamps", false, "Character Timings")
|
|
7182
7185
|
});
|
|
7186
|
+
var dialogueLinesParam = (maxLength) => ({
|
|
7187
|
+
dialogue: {
|
|
7188
|
+
label: "Dialogue",
|
|
7189
|
+
required: true,
|
|
7190
|
+
descriptor: {
|
|
7191
|
+
kind: "object",
|
|
7192
|
+
array: { min: 1 },
|
|
7193
|
+
fields: {
|
|
7194
|
+
// A plain id, not a catalog-bound picker: catalog loading resolves
|
|
7195
|
+
// top-level params only. Every ElevenLabs model shares one voices
|
|
7196
|
+
// task, so a caller lists them from any TTS model — e.g.
|
|
7197
|
+
// `ai.catalogs.voices('eleven-v4')` — and uses the ids here.
|
|
7198
|
+
voiceId: { label: "Voice ID", kind: "text", placeholder: DEFAULT_VOICE_ID },
|
|
7199
|
+
text: { label: "Line", kind: "text", maxLength }
|
|
7200
|
+
}
|
|
7201
|
+
}
|
|
7202
|
+
}
|
|
7203
|
+
});
|
|
7183
7204
|
var { MODELS: MODELS24 } = defineModels("elevenlabs", [
|
|
7184
7205
|
// ── TTS ───────────────────────────────────────────────────────────
|
|
7206
|
+
{
|
|
7207
|
+
id: "eleven-v4",
|
|
7208
|
+
name: "Eleven v4",
|
|
7209
|
+
modelId: "eleven_v4",
|
|
7210
|
+
addedAt: "2026-09-29",
|
|
7211
|
+
workflow: "elevenlabs/v1/text-to-speech",
|
|
7212
|
+
estimatedTime: 10,
|
|
7213
|
+
mode: "audio",
|
|
7214
|
+
inputType: "tts",
|
|
7215
|
+
badge: ["new", "popular"],
|
|
7216
|
+
description: "Most expressive voice engine \u2014 audio tags direct the delivery, 90+ languages.",
|
|
7217
|
+
features: [feat("Audio Tags", "characteristic"), feat("90+ Languages", "characteristic"), feat("Creative Control", "characteristic")],
|
|
7218
|
+
paramConfig: ttsParamConfig(1e4, { language: true, styleControls: false })
|
|
7219
|
+
},
|
|
7220
|
+
{
|
|
7221
|
+
// Same engine family tuned for latency; the vendor bills it at half the
|
|
7222
|
+
// per-character rate of eleven_v4.
|
|
7223
|
+
id: "eleven-v4-turbo",
|
|
7224
|
+
name: "Eleven v4 Turbo",
|
|
7225
|
+
modelId: "eleven_v4_turbo",
|
|
7226
|
+
addedAt: "2026-09-29",
|
|
7227
|
+
workflow: "elevenlabs/v1/text-to-speech",
|
|
7228
|
+
estimatedTime: 6,
|
|
7229
|
+
mode: "audio",
|
|
7230
|
+
inputType: "tts",
|
|
7231
|
+
badge: ["new", "fast"],
|
|
7232
|
+
description: "Eleven v4 tuned for speed \u2014 the same audio tags and languages, lower latency.",
|
|
7233
|
+
features: [feat("Audio Tags", "characteristic"), feat("90+ Languages", "characteristic"), feat("Low Latency", "characteristic")],
|
|
7234
|
+
paramConfig: ttsParamConfig(1e4, { language: true, styleControls: false })
|
|
7235
|
+
},
|
|
7185
7236
|
{
|
|
7186
7237
|
id: "eleven-v3",
|
|
7187
7238
|
name: "Eleven v3",
|
|
@@ -7192,9 +7243,9 @@ var { MODELS: MODELS24 } = defineModels("elevenlabs", [
|
|
|
7192
7243
|
mode: "audio",
|
|
7193
7244
|
inputType: "tts",
|
|
7194
7245
|
badge: ["popular"],
|
|
7195
|
-
description: "
|
|
7246
|
+
description: "Previous-generation expressive engine with expanded tone and pacing control.",
|
|
7196
7247
|
features: [feat("Experimental", "characteristic"), feat("Creative Control", "characteristic")],
|
|
7197
|
-
paramConfig: ttsParamConfig(5e3, true)
|
|
7248
|
+
paramConfig: ttsParamConfig(5e3, { language: true, styleControls: true })
|
|
7198
7249
|
},
|
|
7199
7250
|
{
|
|
7200
7251
|
id: "eleven-multilingual-v2",
|
|
@@ -7208,9 +7259,40 @@ var { MODELS: MODELS24 } = defineModels("elevenlabs", [
|
|
|
7208
7259
|
badge: ["popular", "fast"],
|
|
7209
7260
|
description: "Stable multilingual speech across 29+ languages with natural rhythm.",
|
|
7210
7261
|
features: [feat("Stable", "characteristic"), feat("Professional", "characteristic")],
|
|
7211
|
-
paramConfig: ttsParamConfig(1e4, false)
|
|
7262
|
+
paramConfig: ttsParamConfig(1e4, { language: false, styleControls: true })
|
|
7212
7263
|
},
|
|
7213
7264
|
// ── Dialogue ──────────────────────────────────────────────────────
|
|
7265
|
+
{
|
|
7266
|
+
// Same pricing key as the v3 dialogue below: the worker bills every
|
|
7267
|
+
// dialogue engine per minute under `eleven-text-to-dialogue`.
|
|
7268
|
+
id: "eleven-dialogue-v4",
|
|
7269
|
+
name: "Eleven Dialogue v4",
|
|
7270
|
+
modelId: "eleven-text-to-dialogue",
|
|
7271
|
+
addedAt: "2026-09-29",
|
|
7272
|
+
workflow: "elevenlabs/v1/text-to-dialogue",
|
|
7273
|
+
estimatedTime: 12,
|
|
7274
|
+
mode: "audio",
|
|
7275
|
+
inputType: "tts",
|
|
7276
|
+
badge: ["new"],
|
|
7277
|
+
description: "Multi-speaker conversation on the v4 engine \u2014 a voice per line, audio tags per line.",
|
|
7278
|
+
features: [feat("Multi-Speaker", "characteristic"), feat("Audio Tags", "characteristic"), feat("90+ Languages", "characteristic")],
|
|
7279
|
+
paramConfig: {
|
|
7280
|
+
...dialogueLinesParam(1e4),
|
|
7281
|
+
// v4 reads the whole 0–1 range (no presets), and the dialogue endpoint
|
|
7282
|
+
// names its similarity knob `similarity`, not `similarity_boost`.
|
|
7283
|
+
// Both default-less: unset keeps the vendor's 0.5 / 0.75.
|
|
7284
|
+
stability: {
|
|
7285
|
+
label: "Stability",
|
|
7286
|
+
descriptor: { kind: "range", min: 0, max: 1, step: 0.05 }
|
|
7287
|
+
},
|
|
7288
|
+
similarity: {
|
|
7289
|
+
label: "Similarity",
|
|
7290
|
+
descriptor: { kind: "range", min: 0, max: 1, step: 0.05 }
|
|
7291
|
+
},
|
|
7292
|
+
...params.language(false),
|
|
7293
|
+
...params.seed(4294967295)
|
|
7294
|
+
}
|
|
7295
|
+
},
|
|
7214
7296
|
{
|
|
7215
7297
|
// `modelId` is the pricing-catalog key, not the vendor id: the worker
|
|
7216
7298
|
// registers the operation as `eleven-text-to-dialogue` while the vendor
|
|
@@ -7226,33 +7308,7 @@ var { MODELS: MODELS24 } = defineModels("elevenlabs", [
|
|
|
7226
7308
|
description: "Generate a multi-speaker conversation \u2014 a voice per line \u2014 in one take.",
|
|
7227
7309
|
features: [feat("Multi-Speaker", "characteristic"), feat("Creative Control", "characteristic")],
|
|
7228
7310
|
paramConfig: {
|
|
7229
|
-
|
|
7230
|
-
// number of lines, so none is invented here.
|
|
7231
|
-
//
|
|
7232
|
-
// The 5,000-character limit is the vendor's hard cap and applies to the
|
|
7233
|
-
// dialogue AS A WHOLE, which a per-field maxLength cannot express — a
|
|
7234
|
-
// single line simply cannot exceed it either. Probed against the live
|
|
7235
|
-
// `elevenlabs/v1/text-to-dialogue` worker: 10,000 characters are refused
|
|
7236
|
-
// with "Request text length (10000) exceeds the maximum text length of
|
|
7237
|
-
// 5000 characters", while 2,600 generate fine. The docs' "keep it at or
|
|
7238
|
-
// below 2,000" is guidance, not a limit. Note the far end is slow: a
|
|
7239
|
-
// 5,000-character dialogue outruns the worker's 120s vendor timeout.
|
|
7240
|
-
dialogue: {
|
|
7241
|
-
label: "Dialogue",
|
|
7242
|
-
required: true,
|
|
7243
|
-
descriptor: {
|
|
7244
|
-
kind: "object",
|
|
7245
|
-
array: { min: 1 },
|
|
7246
|
-
fields: {
|
|
7247
|
-
// A plain id, not a catalog-bound picker: catalog loading resolves
|
|
7248
|
-
// top-level params only. Every ElevenLabs model shares one voices
|
|
7249
|
-
// task, so a caller lists them from any TTS model — e.g.
|
|
7250
|
-
// `ai.catalogs.voices('eleven-v3')` — and uses the ids here.
|
|
7251
|
-
voiceId: { label: "Voice ID", kind: "text", placeholder: DEFAULT_VOICE_ID },
|
|
7252
|
-
text: { label: "Line", kind: "text", maxLength: 5e3 }
|
|
7253
|
-
}
|
|
7254
|
-
}
|
|
7255
|
-
},
|
|
7311
|
+
...dialogueLinesParam(5e3),
|
|
7256
7312
|
// The vendor takes any 0–1 double and defaults to 0.5; eleven_v3 reads the
|
|
7257
7313
|
// three presets below, so the picker offers those instead of a slider
|
|
7258
7314
|
// whose in-between values the engine rounds anyway.
|
|
@@ -7528,16 +7584,39 @@ var buildElevenLabsSTSPayload = (modelId) => (input) => ({
|
|
|
7528
7584
|
remove_background_noise: input.removeBackgroundNoise ?? false,
|
|
7529
7585
|
...voiceSettings(input)
|
|
7530
7586
|
});
|
|
7531
|
-
var buildElevenLabsDialoguePayload = (input) =>
|
|
7532
|
-
|
|
7533
|
-
|
|
7534
|
-
|
|
7535
|
-
|
|
7536
|
-
|
|
7537
|
-
|
|
7538
|
-
|
|
7539
|
-
|
|
7540
|
-
|
|
7587
|
+
var buildElevenLabsDialoguePayload = (catalogId, modelId) => (input) => {
|
|
7588
|
+
const cap = dialogueCharacterCap(catalogId);
|
|
7589
|
+
const total = input.dialogue.reduce((sum, line) => sum + line.text.length, 0);
|
|
7590
|
+
if (total > cap) {
|
|
7591
|
+
throw new ApiError(
|
|
7592
|
+
`${catalogId}: the dialogue as a whole exceeds ${cap} characters (got ${total}).`,
|
|
7593
|
+
{ status: 400, code: "validation_error" }
|
|
7594
|
+
);
|
|
7595
|
+
}
|
|
7596
|
+
const settings = {
|
|
7597
|
+
...input.stability != null ? { stability: input.stability } : {},
|
|
7598
|
+
...input.similarity != null ? { similarity: input.similarity } : {}
|
|
7599
|
+
};
|
|
7600
|
+
return {
|
|
7601
|
+
conversation: input.dialogue.map((line) => ({
|
|
7602
|
+
voice_id: line.voiceId,
|
|
7603
|
+
text: line.text
|
|
7604
|
+
})),
|
|
7605
|
+
model_id: modelId,
|
|
7606
|
+
...Object.keys(settings).length > 0 ? { settings } : {},
|
|
7607
|
+
...input.language ? { language_code: input.language } : {},
|
|
7608
|
+
...input.seed != null ? { seed: input.seed } : {}
|
|
7609
|
+
};
|
|
7610
|
+
};
|
|
7611
|
+
function dialogueCharacterCap(catalogId) {
|
|
7612
|
+
const descriptor = MODELS24.find((m) => m.id === catalogId)?.paramConfig.dialogue?.descriptor;
|
|
7613
|
+
const text = descriptor?.kind === "object" ? descriptor.fields.text : void 0;
|
|
7614
|
+
const cap = text && "maxLength" in text ? text.maxLength : void 0;
|
|
7615
|
+
if (typeof cap !== "number") {
|
|
7616
|
+
throw new Error(`${catalogId}: dialogue entry declares no per-line maxLength to derive the cap from`);
|
|
7617
|
+
}
|
|
7618
|
+
return cap;
|
|
7619
|
+
}
|
|
7541
7620
|
var buildElevenLabsTranscribePayload = (input) => ({
|
|
7542
7621
|
audio_url: input.audioUrl,
|
|
7543
7622
|
...input.language ? { language_code: input.language } : {},
|
|
@@ -7555,11 +7634,14 @@ var buildElevenLabsVideoToMusicPayload = (input) => ({
|
|
|
7555
7634
|
});
|
|
7556
7635
|
registerPayloads(MODELS24, {
|
|
7557
7636
|
"elevenlabs-music-v2": buildElevenLabsMusicPayload,
|
|
7637
|
+
"eleven-v4": buildElevenLabsTTSPayload("eleven_v4"),
|
|
7638
|
+
"eleven-v4-turbo": buildElevenLabsTTSPayload("eleven_v4_turbo"),
|
|
7558
7639
|
"eleven-v3": buildElevenLabsTTSPayload("eleven_v3"),
|
|
7559
7640
|
"eleven-multilingual-v2": buildElevenLabsTTSPayload("eleven_multilingual_v2"),
|
|
7560
7641
|
"eleven-sts-v2": buildElevenLabsSTSPayload("eleven_english_sts_v2"),
|
|
7561
7642
|
"eleven-multilingual-sts-v2": buildElevenLabsSTSPayload("eleven_multilingual_sts_v2"),
|
|
7562
|
-
"eleven-text-to-dialogue": buildElevenLabsDialoguePayload,
|
|
7643
|
+
"eleven-text-to-dialogue": buildElevenLabsDialoguePayload("eleven-text-to-dialogue", "eleven_v3"),
|
|
7644
|
+
"eleven-dialogue-v4": buildElevenLabsDialoguePayload("eleven-dialogue-v4", "eleven_v4"),
|
|
7563
7645
|
"eleven-speech-to-text": buildElevenLabsTranscribePayload,
|
|
7564
7646
|
"eleven-video-to-music": buildElevenLabsVideoToMusicPayload
|
|
7565
7647
|
});
|
|
@@ -13239,6 +13321,7 @@ var ClaudeSonnet5 = "claude-sonnet-5";
|
|
|
13239
13321
|
var CreatifyAurora = "creatify-aurora";
|
|
13240
13322
|
var CreatifyBoreal = "creatify-boreal";
|
|
13241
13323
|
var ElevenAudioIsolation = "eleven-audio-isolation";
|
|
13324
|
+
var ElevenDialogueV4 = "eleven-dialogue-v4";
|
|
13242
13325
|
var ElevenDubbing = "eleven-dubbing";
|
|
13243
13326
|
var ElevenMultilingualStsV2 = "eleven-multilingual-sts-v2";
|
|
13244
13327
|
var ElevenMultilingualV2 = "eleven-multilingual-v2";
|
|
@@ -13246,6 +13329,8 @@ var ElevenSpeechToText = "eleven-speech-to-text";
|
|
|
13246
13329
|
var ElevenStsV2 = "eleven-sts-v2";
|
|
13247
13330
|
var ElevenTextToDialogue = "eleven-text-to-dialogue";
|
|
13248
13331
|
var ElevenV3 = "eleven-v3";
|
|
13332
|
+
var ElevenV4 = "eleven-v4";
|
|
13333
|
+
var ElevenV4Turbo = "eleven-v4-turbo";
|
|
13249
13334
|
var ElevenVideoToMusic = "eleven-video-to-music";
|
|
13250
13335
|
var ElevenVoiceCreate = "eleven-voice-create";
|
|
13251
13336
|
var ElevenVoiceDesignV2 = "eleven-voice-design-v2";
|
|
@@ -13494,6 +13579,7 @@ var Models = {
|
|
|
13494
13579
|
CreatifyAurora,
|
|
13495
13580
|
CreatifyBoreal,
|
|
13496
13581
|
ElevenAudioIsolation,
|
|
13582
|
+
ElevenDialogueV4,
|
|
13497
13583
|
ElevenDubbing,
|
|
13498
13584
|
ElevenMultilingualStsV2,
|
|
13499
13585
|
ElevenMultilingualV2,
|
|
@@ -13501,6 +13587,8 @@ var Models = {
|
|
|
13501
13587
|
ElevenStsV2,
|
|
13502
13588
|
ElevenTextToDialogue,
|
|
13503
13589
|
ElevenV3,
|
|
13590
|
+
ElevenV4,
|
|
13591
|
+
ElevenV4Turbo,
|
|
13504
13592
|
ElevenVideoToMusic,
|
|
13505
13593
|
ElevenVoiceCreate,
|
|
13506
13594
|
ElevenVoiceDesignV2,
|