@henjicc/ai-sdk 0.6.1 → 0.7.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/CHANGELOG.md +41 -27
- package/README.md +59 -46
- package/dist/capabilities/client.js +103 -86
- package/dist/capabilities/speech-recognition/bailian/realtime/module.js +42 -7
- package/dist/capabilities/speech-recognition/bailian/realtime/protocol.js +57 -15
- package/dist/capabilities/speech-recognition/volcengine/realtime/module.js +42 -10
- package/dist/capabilities/translation/bailian/module.js +41 -13
- package/dist/capabilities/translation/bailian/sse.d.ts +1 -1
- package/dist/capabilities/translation/bailian/sse.js +82 -54
- package/dist/capabilities/types.d.ts +4 -0
- package/dist/catalog/audio/tts-common.d.ts +5 -0
- package/dist/catalog/audio/tts-common.js +17 -0
- package/dist/catalog/bailian/cosyvoice-v3.5.model.d.ts +2 -0
- package/dist/catalog/bailian/cosyvoice-v3.5.model.js +40 -0
- package/dist/catalog/bailian/minimax-speech-2.8.model.d.ts +2 -0
- package/dist/catalog/bailian/minimax-speech-2.8.model.js +38 -0
- package/dist/catalog/bailian/qwen-audio-3.1-tts-flash.model.d.ts +2 -0
- package/dist/catalog/bailian/qwen-audio-3.1-tts-flash.model.js +35 -0
- package/dist/catalog/fal/eleven-v3-tts.model.d.ts +2 -0
- package/dist/catalog/fal/eleven-v3-tts.model.js +31 -0
- package/dist/catalog/fal/minimax-speech-2.8.model.d.ts +2 -0
- package/dist/catalog/fal/minimax-speech-2.8.model.js +39 -0
- package/dist/catalog/fal/qwen3-tts-1.7b.model.d.ts +2 -0
- package/dist/catalog/fal/qwen3-tts-1.7b.model.js +33 -0
- package/dist/catalog/index.js +116 -90
- package/dist/catalog/kie/eleven-turbo-2.5-tts.model.d.ts +2 -0
- package/dist/catalog/kie/eleven-turbo-2.5-tts.model.js +29 -0
- package/dist/catalog/kie/eleven-v3-dialogue.model.d.ts +2 -0
- package/dist/catalog/kie/eleven-v3-dialogue.model.js +46 -0
- package/dist/catalog/kie/gemini-3.1-flash-tts.model.d.ts +2 -0
- package/dist/catalog/kie/gemini-3.1-flash-tts.model.js +40 -0
- package/dist/catalog/ppio/minimax-speech.model.js +1 -3
- package/dist/catalog/siliconflow/cosyvoice2-tts.model.d.ts +2 -0
- package/dist/catalog/siliconflow/cosyvoice2-tts.model.js +27 -0
- package/dist/catalog/siliconflow/moss-ttsd-0.5.model.d.ts +2 -0
- package/dist/catalog/siliconflow/moss-ttsd-0.5.model.js +28 -0
- package/dist/catalog/volcengine-speech/seed-icl-2.0.model.d.ts +2 -0
- package/dist/catalog/volcengine-speech/seed-icl-2.0.model.js +26 -0
- package/dist/catalog/volcengine-speech/seed-tts-2.0.model.d.ts +2 -0
- package/dist/catalog/volcengine-speech/seed-tts-2.0.model.js +25 -0
- package/dist/llm/chat.js +6 -1
- package/dist/llm/streaming.js +131 -91
- package/dist/packs/models/bailian/cosyvoice-v3.5.d.ts +6 -0
- package/dist/packs/models/bailian/cosyvoice-v3.5.js +7 -0
- package/dist/packs/models/bailian/minimax-speech-2.8.d.ts +6 -0
- package/dist/packs/models/bailian/minimax-speech-2.8.js +7 -0
- package/dist/packs/models/bailian/qwen-audio-3.1-tts-flash.d.ts +6 -0
- package/dist/packs/models/bailian/qwen-audio-3.1-tts-flash.js +7 -0
- package/dist/packs/models/fal/eleven-v3-tts.d.ts +6 -0
- package/dist/packs/models/fal/eleven-v3-tts.js +7 -0
- package/dist/packs/models/fal/minimax-speech-2.8.d.ts +6 -0
- package/dist/packs/models/fal/minimax-speech-2.8.js +7 -0
- package/dist/packs/models/fal/qwen3-tts-1.7b.d.ts +6 -0
- package/dist/packs/models/fal/qwen3-tts-1.7b.js +7 -0
- package/dist/packs/models/kie/eleven-turbo-2.5-tts.d.ts +6 -0
- package/dist/packs/models/kie/eleven-turbo-2.5-tts.js +7 -0
- package/dist/packs/models/kie/eleven-v3-dialogue.d.ts +6 -0
- package/dist/packs/models/kie/eleven-v3-dialogue.js +7 -0
- package/dist/packs/models/kie/gemini-3.1-flash-tts.d.ts +6 -0
- package/dist/packs/models/kie/gemini-3.1-flash-tts.js +7 -0
- package/dist/packs/models/siliconflow/cosyvoice2-tts.d.ts +6 -0
- package/dist/packs/models/siliconflow/cosyvoice2-tts.js +7 -0
- package/dist/packs/models/siliconflow/moss-ttsd-0.5.d.ts +6 -0
- package/dist/packs/models/siliconflow/moss-ttsd-0.5.js +7 -0
- package/dist/packs/models/volcengine-speech/seed-icl-2.0.d.ts +6 -0
- package/dist/packs/models/volcengine-speech/seed-icl-2.0.js +7 -0
- package/dist/packs/models/volcengine-speech/seed-tts-2.0.d.ts +6 -0
- package/dist/packs/models/volcengine-speech/seed-tts-2.0.js +7 -0
- package/dist/packs/provider-adapters/siliconflow.d.ts +3 -0
- package/dist/packs/provider-adapters/siliconflow.js +5 -0
- package/dist/packs/provider-adapters/volcengine-speech.d.ts +3 -0
- package/dist/packs/provider-adapters/volcengine-speech.js +5 -0
- package/dist/packs/provider-packs/bailian.d.ts +1 -1
- package/dist/packs/provider-packs/bailian.js +6 -3
- package/dist/packs/provider-packs/fal.d.ts +1 -1
- package/dist/packs/provider-packs/fal.js +41 -38
- package/dist/packs/provider-packs/kie.d.ts +1 -1
- package/dist/packs/provider-packs/kie.js +33 -30
- package/dist/packs/provider-packs/siliconflow.d.ts +4 -0
- package/dist/packs/provider-packs/siliconflow.js +7 -0
- package/dist/packs/provider-packs/volcengine-speech.d.ts +4 -0
- package/dist/packs/provider-packs/volcengine-speech.js +7 -0
- package/dist/protocols/sse-events.d.ts +4 -0
- package/dist/protocols/sse-events.js +31 -0
- package/dist/providers/audio-data.d.ts +2 -0
- package/dist/providers/audio-data.js +21 -0
- package/dist/providers/bailian.js +30 -2
- package/dist/providers/index.js +4 -0
- package/dist/providers/metadata.js +8 -0
- package/dist/providers/siliconflow.d.ts +3 -0
- package/dist/providers/siliconflow.js +34 -0
- package/dist/providers/volcengine-speech.d.ts +3 -0
- package/dist/providers/volcengine-speech.js +143 -0
- package/dist/types/model.d.ts +4 -4
- package/dist/types/model.js +3 -1
- package/docs/consumers.md +22 -5
- package/docs/llm-adaptation/README.md +28 -3
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206/DeepSeek.md +14 -14
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206/Kimi.md +3 -3
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//345/260/217/347/261/263MiMo.md +42 -42
- package/docs/llm-adaptation//344/276/233/345/272/224/345/225/206//346/231/272/350/260/261GLM.md +2 -0
- package/docs/model-adaptation/Fun-ASR-Realtime/Fun-ASR-Realtime_/347/231/276/347/202/274.md +22 -2
- package/docs/model-adaptation/GLM-5.3-Flash/GLM-5.3-Flash_/346/231/272/350/260/261.md +6 -6
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_APIMart.md +66 -66
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_Fal.md +55 -55
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_Grsai.md +53 -53
- package/docs/model-adaptation/GPT-Image-2.5/GPT-Image-2.5_KIE.md +55 -55
- package/docs/model-adaptation/HappyHorse-1.1/HappyHorse-1.1_KIE.md +27 -27
- package/docs/model-adaptation/IC-Light-v2/IC-Light-v2_Fal.md +14 -14
- package/docs/model-adaptation/Qwen-MT-Flash/Qwen-MT-Flash_/347/231/276/347/202/274.md +22 -1
- package/docs/model-adaptation/Qwen-MT-Lite/Qwen-MT-Lite_/347/231/276/347/202/274.md +2 -1
- package/docs/model-adaptation/Qwen-MT-Plus/Qwen-MT-Plus_/347/231/276/347/202/274.md +2 -1
- package/docs/model-adaptation/Qwen3-ASR-Flash-Realtime/Qwen3-ASR-Flash-Realtime_/347/231/276/347/202/274.md +25 -2
- package/docs/model-adaptation/README.md +14 -10
- package/docs/model-adaptation/SeedASR-2.0-Realtime/SeedASR-2.0-Realtime_/347/201/253/345/261/261/345/274/225/346/223/216.md +6 -2
- package/docs/model-adaptation/Seedream-5.0-Flash/Seedream-5.0-Flash_/347/201/253/345/261/261/345/274/225/346/223/216.md +18 -18
- package/docs/model-adaptation/TTS-/345/244/232/344/276/233/345/272/224/345/225/206-2026-09.md +55 -0
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//346/264/276/346/254/247/344/272/221.md +9 -9
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//347/201/253/345/261/261/345/274/225/346/223/216.md +11 -11
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//347/231/276/347/202/274.md +31 -31
- package/docs/model-adaptation//344/276/233/345/272/224/345/225/206//347/241/205/345/237/272/346/265/201/345/212/250.md +67 -67
- package/docs/model-adaptation//346/226/207/346/241/243/351/207/207/351/233/206/346/211/213/345/206/214.md +8 -8
- package/examples/form-renderer/package.json +1 -1
- package/examples/llm-chat/README.md +8 -8
- package/examples/llm-chat/index.ts +2 -2
- package/examples/llm-chat/package.json +1 -1
- package/examples/minimal-node/package.json +1 -1
- package/package.json +258 -258
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { JsonObject, JsonValue } from '../../types/runtime.js';
|
|
2
|
+
export declare function speechText(params: JsonObject): string;
|
|
3
|
+
export declare function speechString(value: JsonValue): string | undefined;
|
|
4
|
+
export declare function speechNumber(value: JsonValue): number | undefined;
|
|
5
|
+
export declare function speechCharacterPrice(params: JsonObject, perThousand: number): number;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export function speechText(params) {
|
|
2
|
+
const value = typeof params.text === 'string' ? params.text : params.prompt;
|
|
3
|
+
if (typeof value !== 'string' || value.trim().length === 0) {
|
|
4
|
+
throw new Error('语音合成需要非空文本');
|
|
5
|
+
}
|
|
6
|
+
return value;
|
|
7
|
+
}
|
|
8
|
+
export function speechString(value) {
|
|
9
|
+
return typeof value === 'string' && value.trim() ? value.trim() : undefined;
|
|
10
|
+
}
|
|
11
|
+
export function speechNumber(value) {
|
|
12
|
+
return typeof value === 'number' && Number.isFinite(value) ? value : undefined;
|
|
13
|
+
}
|
|
14
|
+
export function speechCharacterPrice(params, perThousand) {
|
|
15
|
+
const value = typeof params.text === 'string' ? params.text : params.prompt;
|
|
16
|
+
return typeof value === 'string' ? (Array.from(value).length * perThousand) / 1000 : 0;
|
|
17
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { defineModel } from '../defineModel.js';
|
|
2
|
+
import { speechCharacterPrice, speechNumber, speechString, speechText } from '../audio/tts-common.js';
|
|
3
|
+
export const bailianCosyVoice35Model = defineModel({
|
|
4
|
+
meta: {
|
|
5
|
+
id: 'bailian-cosyvoice-v3.5', canonicalModelId: 'cosyvoice-v3.5', provider: 'bailian', type: 'audio',
|
|
6
|
+
tags: ['text-to-audio', 'provider-bailian'],
|
|
7
|
+
},
|
|
8
|
+
inputLimits: { images: { max: 0 }, videos: { max: 0 } },
|
|
9
|
+
params: [
|
|
10
|
+
{ id: 'bailianCosyVoiceSpec', type: 'dropdown', order: 1, default: 'flash', options: [{ value: 'flash' }, { value: 'plus' }] },
|
|
11
|
+
{ id: 'bailianCosyVoiceId', type: 'text', order: 2, required: true, default: '' },
|
|
12
|
+
{ id: 'bailianCosyVoiceInstruction', type: 'text', order: 3, default: '' },
|
|
13
|
+
{ id: 'bailianCosyVoiceSpeed', type: 'number', order: 4, default: 1, min: 0.5, max: 2, step: 0.1 },
|
|
14
|
+
],
|
|
15
|
+
endpoints: '/api/v1/services/audio/tts/SpeechSynthesizer',
|
|
16
|
+
request: {
|
|
17
|
+
builder: (params) => {
|
|
18
|
+
const voice = speechString(params.bailianCosyVoiceId);
|
|
19
|
+
if (!voice)
|
|
20
|
+
throw new Error('CosyVoice 3.5 需要事先创建的声音复刻或设计音色 ID');
|
|
21
|
+
const input = {
|
|
22
|
+
text: speechText(params), voice, format: 'mp3',
|
|
23
|
+
rate: speechNumber(params.bailianCosyVoiceSpeed) ?? 1,
|
|
24
|
+
};
|
|
25
|
+
const instruction = speechString(params.bailianCosyVoiceInstruction);
|
|
26
|
+
if (instruction)
|
|
27
|
+
input.instruction = instruction;
|
|
28
|
+
return {
|
|
29
|
+
model: params.bailianCosyVoiceSpec === 'plus' ? 'cosyvoice-v3.5-plus' : 'cosyvoice-v3.5-flash',
|
|
30
|
+
input,
|
|
31
|
+
};
|
|
32
|
+
},
|
|
33
|
+
},
|
|
34
|
+
pricing: {
|
|
35
|
+
currency: '¥',
|
|
36
|
+
calculator: params => speechCharacterPrice(params, params.bailianCosyVoiceSpec === 'plus' ? 0.15 : 0.08),
|
|
37
|
+
description: 'CosyVoice 3.5 Flash ¥0.8/万字符,Plus ¥1.5/万字符;须先取得自定义音色 ID',
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
export default bailianCosyVoice35Model;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { defineModel } from '../defineModel.js';
|
|
2
|
+
import { speechCharacterPrice, speechNumber, speechString, speechText } from '../audio/tts-common.js';
|
|
3
|
+
export const bailianMinimaxSpeech28Model = defineModel({
|
|
4
|
+
meta: {
|
|
5
|
+
id: 'bailian-minimax-speech-2.8', canonicalModelId: 'minimax-speech-2.8', provider: 'bailian', type: 'audio',
|
|
6
|
+
tags: ['text-to-audio', 'provider-bailian'],
|
|
7
|
+
},
|
|
8
|
+
inputLimits: { images: { max: 0 }, videos: { max: 0 } },
|
|
9
|
+
params: [
|
|
10
|
+
{ id: 'bailianMinimaxSpeechSpec', type: 'dropdown', order: 1, default: 'hd', options: [{ value: 'hd' }, { value: 'turbo' }] },
|
|
11
|
+
{ id: 'bailianMinimaxSpeechVoice', type: 'text', order: 2, default: 'male-qn-qingse' },
|
|
12
|
+
{ id: 'bailianMinimaxSpeechSpeed', type: 'number', order: 3, default: 1, min: 0.5, max: 2, step: 0.1 },
|
|
13
|
+
{ id: 'bailianMinimaxSpeechEmotion', type: 'dropdown', order: 4, default: '', options: ['', 'happy', 'sad', 'angry', 'fearful', 'disgusted', 'surprised', 'calm'].map(value => ({ value })) },
|
|
14
|
+
],
|
|
15
|
+
endpoints: '/api/v1/services/aigc/multimodal-generation/generation',
|
|
16
|
+
request: {
|
|
17
|
+
builder: (params) => {
|
|
18
|
+
const spec = params.bailianMinimaxSpeechSpec === 'turbo' ? 'turbo' : 'hd';
|
|
19
|
+
const voiceSetting = {
|
|
20
|
+
voice_id: speechString(params.bailianMinimaxSpeechVoice) ?? 'male-qn-qingse',
|
|
21
|
+
speed: speechNumber(params.bailianMinimaxSpeechSpeed) ?? 1,
|
|
22
|
+
};
|
|
23
|
+
const emotion = speechString(params.bailianMinimaxSpeechEmotion);
|
|
24
|
+
if (emotion)
|
|
25
|
+
voiceSetting.emotion = emotion;
|
|
26
|
+
return {
|
|
27
|
+
model: `MiniMax/speech-2.8-${spec}`,
|
|
28
|
+
input: { text: speechText(params), voice_setting: voiceSetting },
|
|
29
|
+
};
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
pricing: {
|
|
33
|
+
currency: '¥',
|
|
34
|
+
calculator: params => speechCharacterPrice(params, params.bailianMinimaxSpeechSpec === 'turbo' ? 0.2 : 0.35),
|
|
35
|
+
description: '百炼 MiniMax 2.8 HD ¥3.5/万字符,Turbo ¥2/万字符',
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
export default bailianMinimaxSpeech28Model;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { defineModel } from '../defineModel.js';
|
|
2
|
+
import { speechNumber, speechString, speechText } from '../audio/tts-common.js';
|
|
3
|
+
export const bailianQwenAudio31TtsFlashModel = defineModel({
|
|
4
|
+
meta: {
|
|
5
|
+
id: 'bailian-qwen-audio-3.1-tts-flash', canonicalModelId: 'qwen-audio-3.1-tts-flash',
|
|
6
|
+
provider: 'bailian', type: 'audio',
|
|
7
|
+
tags: ['text-to-audio', 'provider-bailian'],
|
|
8
|
+
},
|
|
9
|
+
inputLimits: { images: { max: 0 }, videos: { max: 0 } },
|
|
10
|
+
params: [
|
|
11
|
+
{ id: 'bailianQwenTtsVoice', type: 'dropdown', order: 1, default: 'longanhuan_v3.1', options: ['longanhuan_v3.1', 'longanlingxin_v3.1', 'longanfengyue_v3.1', 'xunanchuan_v3.1'].map(value => ({ value })) },
|
|
12
|
+
{ id: 'bailianQwenTtsInstruction', type: 'text', order: 2, default: '' },
|
|
13
|
+
{ id: 'bailianQwenTtsSpeed', type: 'number', order: 3, default: 1, min: 0.5, max: 2, step: 0.1 },
|
|
14
|
+
],
|
|
15
|
+
endpoints: '/api/v1/services/audio/tts/SpeechSynthesizer',
|
|
16
|
+
request: {
|
|
17
|
+
builder: (params) => {
|
|
18
|
+
const input = {
|
|
19
|
+
text: speechText(params),
|
|
20
|
+
voice: speechString(params.bailianQwenTtsVoice) ?? 'longanhuan_v3.1',
|
|
21
|
+
format: 'mp3',
|
|
22
|
+
rate: speechNumber(params.bailianQwenTtsSpeed) ?? 1,
|
|
23
|
+
};
|
|
24
|
+
const instruction = speechString(params.bailianQwenTtsInstruction);
|
|
25
|
+
if (instruction)
|
|
26
|
+
input.instruction = instruction;
|
|
27
|
+
return { model: 'qwen-audio-3.1-tts-flash', input };
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
pricing: {
|
|
31
|
+
currency: '¥', calculator: () => Number.NaN,
|
|
32
|
+
description: '输入 ¥1.5/百万 Token、输出 ¥12/百万 Token;输出 Token 无法在提交前准确估算',
|
|
33
|
+
},
|
|
34
|
+
});
|
|
35
|
+
export default bailianQwenAudio31TtsFlashModel;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { defineModel } from '../defineModel.js';
|
|
2
|
+
import { speechCharacterPrice, speechNumber, speechString, speechText } from '../audio/tts-common.js';
|
|
3
|
+
export const falElevenV3TtsModel = defineModel({
|
|
4
|
+
meta: {
|
|
5
|
+
id: 'fal-eleven-v3-tts', canonicalModelId: 'eleven-v3-tts', provider: 'fal', type: 'audio',
|
|
6
|
+
tags: ['text-to-audio', 'provider-fal'],
|
|
7
|
+
polling: { interval: 3000, maxAttempts: 120, expectedAttempts: 20 },
|
|
8
|
+
},
|
|
9
|
+
inputLimits: { images: { max: 0 }, videos: { max: 0 } },
|
|
10
|
+
params: [
|
|
11
|
+
{ id: 'falElevenV3Voice', type: 'text', order: 1, default: 'Rachel' },
|
|
12
|
+
{ id: 'falElevenV3Stability', type: 'number', order: 2, default: 0.5, min: 0, max: 1, step: 0.05 },
|
|
13
|
+
{ id: 'falElevenV3Language', type: 'text', order: 3, default: '' },
|
|
14
|
+
],
|
|
15
|
+
endpoints: 'fal-ai/elevenlabs/tts/eleven-v3',
|
|
16
|
+
request: {
|
|
17
|
+
builder: (params) => {
|
|
18
|
+
const body = {
|
|
19
|
+
text: speechText(params),
|
|
20
|
+
voice: speechString(params.falElevenV3Voice) ?? 'Rachel',
|
|
21
|
+
stability: speechNumber(params.falElevenV3Stability) ?? 0.5,
|
|
22
|
+
};
|
|
23
|
+
const language = speechString(params.falElevenV3Language);
|
|
24
|
+
if (language)
|
|
25
|
+
body.language_code = language;
|
|
26
|
+
return body;
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
pricing: { currency: '$', calculator: params => speechCharacterPrice(params, 0.1), description: '$0.10/千字符' },
|
|
30
|
+
});
|
|
31
|
+
export default falElevenV3TtsModel;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { defineModel } from '../defineModel.js';
|
|
2
|
+
import { speechCharacterPrice, speechNumber, speechString, speechText } from '../audio/tts-common.js';
|
|
3
|
+
export const falMinimaxSpeech28Model = defineModel({
|
|
4
|
+
meta: {
|
|
5
|
+
id: 'fal-minimax-speech-2.8', canonicalModelId: 'minimax-speech-2.8',
|
|
6
|
+
provider: 'fal', type: 'audio',
|
|
7
|
+
tags: ['text-to-audio', 'provider-fal'],
|
|
8
|
+
polling: { interval: 3000, maxAttempts: 120, expectedAttempts: 20 },
|
|
9
|
+
},
|
|
10
|
+
inputLimits: { images: { max: 0 }, videos: { max: 0 } },
|
|
11
|
+
params: [
|
|
12
|
+
{ id: 'falMinimaxSpeechSpec', type: 'dropdown', order: 1, default: 'hd', options: [{ value: 'hd' }, { value: 'turbo' }] },
|
|
13
|
+
{ id: 'falMinimaxSpeechVoice', type: 'text', order: 2, default: 'Wise_Woman' },
|
|
14
|
+
{ id: 'falMinimaxSpeechSpeed', type: 'number', order: 3, default: 1, min: 0.5, max: 2, step: 0.1 },
|
|
15
|
+
{ id: 'falMinimaxSpeechEmotion', type: 'dropdown', order: 4, default: '', options: ['', 'happy', 'sad', 'angry', 'fearful', 'disgusted', 'surprised', 'neutral'].map(value => ({ value })) },
|
|
16
|
+
],
|
|
17
|
+
endpoints: {
|
|
18
|
+
selector: (params) => params.falMinimaxSpeechSpec === 'turbo'
|
|
19
|
+
? 'fal-ai/minimax/speech-2.8-turbo' : 'fal-ai/minimax/speech-2.8-hd',
|
|
20
|
+
},
|
|
21
|
+
request: {
|
|
22
|
+
builder: (params) => {
|
|
23
|
+
const voice = {
|
|
24
|
+
voice_id: speechString(params.falMinimaxSpeechVoice) ?? 'Wise_Woman',
|
|
25
|
+
speed: speechNumber(params.falMinimaxSpeechSpeed) ?? 1,
|
|
26
|
+
};
|
|
27
|
+
const emotion = speechString(params.falMinimaxSpeechEmotion);
|
|
28
|
+
if (emotion)
|
|
29
|
+
voice.emotion = emotion;
|
|
30
|
+
return { prompt: speechText(params), voice_setting: voice, output_format: 'url' };
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
pricing: {
|
|
34
|
+
currency: '$',
|
|
35
|
+
calculator: params => speechCharacterPrice(params, params.falMinimaxSpeechSpec === 'turbo' ? 0.06 : 0.1),
|
|
36
|
+
description: 'Fal Speech 2.8 HD $0.10/千字符,Turbo $0.06/千字符',
|
|
37
|
+
},
|
|
38
|
+
});
|
|
39
|
+
export default falMinimaxSpeech28Model;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { defineModel } from '../defineModel.js';
|
|
2
|
+
import { speechCharacterPrice, speechNumber, speechString, speechText } from '../audio/tts-common.js';
|
|
3
|
+
export const falQwen3Tts17bModel = defineModel({
|
|
4
|
+
meta: {
|
|
5
|
+
id: 'fal-qwen3-tts-1.7b', canonicalModelId: 'qwen3-tts-1.7b', provider: 'fal', type: 'audio',
|
|
6
|
+
tags: ['text-to-audio', 'provider-fal'],
|
|
7
|
+
polling: { interval: 3000, maxAttempts: 120, expectedAttempts: 20 },
|
|
8
|
+
},
|
|
9
|
+
inputLimits: { images: { max: 0 }, videos: { max: 0 } },
|
|
10
|
+
params: [
|
|
11
|
+
{ id: 'falQwen3TtsVoice', type: 'dropdown', order: 1, default: 'Vivian', options: ['Vivian', 'Serena', 'Uncle_Fu', 'Dylan', 'Eric', 'Ryan', 'Aiden', 'Ono_Anna', 'Sohee'].map(value => ({ value })) },
|
|
12
|
+
{ id: 'falQwen3TtsLanguage', type: 'dropdown', order: 2, default: 'Auto', options: ['Auto', 'English', 'Chinese', 'Spanish', 'French', 'German', 'Italian', 'Japanese', 'Korean', 'Portuguese', 'Russian'].map(value => ({ value })) },
|
|
13
|
+
{ id: 'falQwen3TtsStyle', type: 'text', order: 3, default: '' },
|
|
14
|
+
{ id: 'falQwen3TtsTemperature', type: 'number', order: 4, default: 0.9, min: 0, max: 2, step: 0.1 },
|
|
15
|
+
],
|
|
16
|
+
endpoints: 'fal-ai/qwen-3-tts/text-to-speech/1.7b',
|
|
17
|
+
request: {
|
|
18
|
+
builder: (params) => {
|
|
19
|
+
const body = {
|
|
20
|
+
text: speechText(params),
|
|
21
|
+
voice: speechString(params.falQwen3TtsVoice) ?? 'Vivian',
|
|
22
|
+
language: speechString(params.falQwen3TtsLanguage) ?? 'Auto',
|
|
23
|
+
temperature: speechNumber(params.falQwen3TtsTemperature) ?? 0.9,
|
|
24
|
+
};
|
|
25
|
+
const style = speechString(params.falQwen3TtsStyle);
|
|
26
|
+
if (style)
|
|
27
|
+
body.prompt = style;
|
|
28
|
+
return body;
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
pricing: { currency: '$', calculator: params => speechCharacterPrice(params, 0.09), description: '$0.09/千字符' },
|
|
32
|
+
});
|
|
33
|
+
export default falQwen3Tts17bModel;
|
package/dist/catalog/index.js
CHANGED
|
@@ -24,96 +24,109 @@ import catalogModel18 from './apimart/seedance-2.5.model.js';
|
|
|
24
24
|
import catalogModel19 from './apimart/seedream-5.0-lite.model.js';
|
|
25
25
|
import catalogModel20 from './apimart/seedream-5.0-pro.model.js';
|
|
26
26
|
import catalogModel21 from './apimart/z-image-turbo.model.js';
|
|
27
|
-
import catalogModel22 from './bailian/
|
|
28
|
-
import catalogModel23 from './bailian/
|
|
29
|
-
import catalogModel24 from './
|
|
30
|
-
import catalogModel25 from './
|
|
31
|
-
import catalogModel26 from './
|
|
32
|
-
import catalogModel27 from './fal/
|
|
33
|
-
import catalogModel28 from './fal/
|
|
34
|
-
import catalogModel29 from './fal/
|
|
35
|
-
import catalogModel30 from './fal/
|
|
36
|
-
import catalogModel31 from './fal/
|
|
37
|
-
import catalogModel32 from './fal/
|
|
38
|
-
import catalogModel33 from './fal/
|
|
39
|
-
import catalogModel34 from './fal/
|
|
40
|
-
import catalogModel35 from './fal/
|
|
41
|
-
import catalogModel36 from './fal/
|
|
42
|
-
import catalogModel37 from './fal/kling-
|
|
43
|
-
import catalogModel38 from './fal/kling-
|
|
44
|
-
import catalogModel39 from './fal/
|
|
45
|
-
import catalogModel40 from './fal/
|
|
46
|
-
import catalogModel41 from './fal/
|
|
47
|
-
import catalogModel42 from './fal/
|
|
48
|
-
import catalogModel43 from './fal/
|
|
49
|
-
import catalogModel44 from './fal/
|
|
50
|
-
import catalogModel45 from './fal/
|
|
51
|
-
import catalogModel46 from './fal/
|
|
52
|
-
import catalogModel47 from './fal/
|
|
53
|
-
import catalogModel48 from './fal/
|
|
54
|
-
import catalogModel49 from './fal/
|
|
55
|
-
import catalogModel50 from './fal/
|
|
56
|
-
import catalogModel51 from './fal/
|
|
57
|
-
import catalogModel52 from './fal/
|
|
58
|
-
import catalogModel53 from './fal/
|
|
59
|
-
import catalogModel54 from './fal/
|
|
60
|
-
import catalogModel55 from './fal/
|
|
61
|
-
import catalogModel56 from './fal/
|
|
62
|
-
import catalogModel57 from './fal/
|
|
63
|
-
import catalogModel58 from './fal/
|
|
64
|
-
import catalogModel59 from './fal/
|
|
65
|
-
import catalogModel60 from './fal/
|
|
66
|
-
import catalogModel61 from './fal/
|
|
67
|
-
import catalogModel62 from './
|
|
68
|
-
import catalogModel63 from './
|
|
69
|
-
import catalogModel64 from './
|
|
70
|
-
import catalogModel65 from './
|
|
71
|
-
import catalogModel66 from './
|
|
72
|
-
import catalogModel67 from './
|
|
73
|
-
import catalogModel68 from './
|
|
74
|
-
import catalogModel69 from './
|
|
75
|
-
import catalogModel70 from './
|
|
76
|
-
import catalogModel71 from './
|
|
77
|
-
import catalogModel72 from './
|
|
78
|
-
import catalogModel73 from './kie/
|
|
79
|
-
import catalogModel74 from './kie/
|
|
80
|
-
import catalogModel75 from './kie/
|
|
81
|
-
import catalogModel76 from './kie/
|
|
82
|
-
import catalogModel77 from './kie/
|
|
83
|
-
import catalogModel78 from './kie/
|
|
84
|
-
import catalogModel79 from './kie/
|
|
85
|
-
import catalogModel80 from './kie/
|
|
86
|
-
import catalogModel81 from './kie/
|
|
87
|
-
import catalogModel82 from './kie/
|
|
88
|
-
import catalogModel83 from './kie/
|
|
89
|
-
import catalogModel84 from './kie/
|
|
90
|
-
import catalogModel85 from './kie/
|
|
91
|
-
import catalogModel86 from './kie/
|
|
92
|
-
import catalogModel87 from './kie/
|
|
93
|
-
import catalogModel88 from './kie/
|
|
94
|
-
import catalogModel89 from './kie/
|
|
95
|
-
import catalogModel90 from './kie/
|
|
96
|
-
import catalogModel91 from './kie/
|
|
97
|
-
import catalogModel92 from './kie/
|
|
98
|
-
import catalogModel93 from './kie/
|
|
99
|
-
import catalogModel94 from './kie/
|
|
100
|
-
import catalogModel95 from './kie/
|
|
101
|
-
import catalogModel96 from './
|
|
102
|
-
import catalogModel97 from './
|
|
103
|
-
import catalogModel98 from './
|
|
104
|
-
import catalogModel99 from './
|
|
105
|
-
import catalogModel100 from './
|
|
106
|
-
import catalogModel101 from './
|
|
107
|
-
import catalogModel102 from './
|
|
108
|
-
import catalogModel103 from './
|
|
109
|
-
import catalogModel104 from './
|
|
110
|
-
import catalogModel105 from './
|
|
111
|
-
import catalogModel106 from './
|
|
112
|
-
import catalogModel107 from './
|
|
113
|
-
import catalogModel108 from './
|
|
114
|
-
import catalogModel109 from './
|
|
115
|
-
import catalogModel110 from './
|
|
116
|
-
import catalogModel111 from './
|
|
27
|
+
import catalogModel22 from './bailian/cosyvoice-v3.5.model.js';
|
|
28
|
+
import catalogModel23 from './bailian/minimax-speech-2.8.model.js';
|
|
29
|
+
import catalogModel24 from './bailian/qwen-audio-3.1-tts-flash.model.js';
|
|
30
|
+
import catalogModel25 from './bailian/qwen-image-3.0.model.js';
|
|
31
|
+
import catalogModel26 from './bailian/z-image-turbo.model.js';
|
|
32
|
+
import catalogModel27 from './fal/bria-creative-upscale.model.js';
|
|
33
|
+
import catalogModel28 from './fal/eleven-v3-tts.model.js';
|
|
34
|
+
import catalogModel29 from './fal/gemini-omni-flash.model.js';
|
|
35
|
+
import catalogModel30 from './fal/gpt-image-2.5.model.js';
|
|
36
|
+
import catalogModel31 from './fal/gpt-image-2.model.js';
|
|
37
|
+
import catalogModel32 from './fal/grok-imagine-2.0.model.js';
|
|
38
|
+
import catalogModel33 from './fal/hailuo-02.model.js';
|
|
39
|
+
import catalogModel34 from './fal/hailuo-2.3.model.js';
|
|
40
|
+
import catalogModel35 from './fal/ic-light-v2.model.js';
|
|
41
|
+
import catalogModel36 from './fal/ideogram-upscale.model.js';
|
|
42
|
+
import catalogModel37 from './fal/kling-3.0-omni.model.js';
|
|
43
|
+
import catalogModel38 from './fal/kling-3.0-turbo.model.js';
|
|
44
|
+
import catalogModel39 from './fal/kling-3.0.model.js';
|
|
45
|
+
import catalogModel40 from './fal/kling-image-o1.model.js';
|
|
46
|
+
import catalogModel41 from './fal/kling-video-o1.model.js';
|
|
47
|
+
import catalogModel42 from './fal/kling-video-v2.6-pro.model.js';
|
|
48
|
+
import catalogModel43 from './fal/ltx-2.model.js';
|
|
49
|
+
import catalogModel44 from './fal/minimax-h3.model.js';
|
|
50
|
+
import catalogModel45 from './fal/minimax-speech-2.8.model.js';
|
|
51
|
+
import catalogModel46 from './fal/nano-banana-2.model.js';
|
|
52
|
+
import catalogModel47 from './fal/nano-banana-pro.model.js';
|
|
53
|
+
import catalogModel48 from './fal/nano-banana.model.js';
|
|
54
|
+
import catalogModel49 from './fal/pixverse-v5.5.model.js';
|
|
55
|
+
import catalogModel50 from './fal/qwen-image-3.0.model.js';
|
|
56
|
+
import catalogModel51 from './fal/qwen3-tts-1.7b.model.js';
|
|
57
|
+
import catalogModel52 from './fal/seedance-2.0-fast.model.js';
|
|
58
|
+
import catalogModel53 from './fal/seedance-2.0-mini.model.js';
|
|
59
|
+
import catalogModel54 from './fal/seedance-2.0.model.js';
|
|
60
|
+
import catalogModel55 from './fal/seedance-2.5.model.js';
|
|
61
|
+
import catalogModel56 from './fal/seedance.model.js';
|
|
62
|
+
import catalogModel57 from './fal/seedream-5.0-lite.model.js';
|
|
63
|
+
import catalogModel58 from './fal/seedream-5.0-pro.model.js';
|
|
64
|
+
import catalogModel59 from './fal/seedream-v4.5.model.js';
|
|
65
|
+
import catalogModel60 from './fal/seedream-v4.model.js';
|
|
66
|
+
import catalogModel61 from './fal/seedvr2-image-upscale.model.js';
|
|
67
|
+
import catalogModel62 from './fal/topaz-image-upscale.model.js';
|
|
68
|
+
import catalogModel63 from './fal/topaz-transparent-upscale.model.js';
|
|
69
|
+
import catalogModel64 from './fal/veo-3.1.model.js';
|
|
70
|
+
import catalogModel65 from './fal/vidu-q2.model.js';
|
|
71
|
+
import catalogModel66 from './fal/wan-2.5-preview.model.js';
|
|
72
|
+
import catalogModel67 from './fal/z-image-turbo.model.js';
|
|
73
|
+
import catalogModel68 from './grsai/gpt-image-2.5.model.js';
|
|
74
|
+
import catalogModel69 from './grsai/gpt-image-2.model.js';
|
|
75
|
+
import catalogModel70 from './grsai/nano-banana-2-lite.model.js';
|
|
76
|
+
import catalogModel71 from './grsai/nano-banana-2.model.js';
|
|
77
|
+
import catalogModel72 from './grsai/nano-banana-pro.model.js';
|
|
78
|
+
import catalogModel73 from './kie/eleven-turbo-2.5-tts.model.js';
|
|
79
|
+
import catalogModel74 from './kie/eleven-v3-dialogue.model.js';
|
|
80
|
+
import catalogModel75 from './kie/gemini-3.1-flash-tts.model.js';
|
|
81
|
+
import catalogModel76 from './kie/gemini-omni-video.model.js';
|
|
82
|
+
import catalogModel77 from './kie/gpt-image-2.5.model.js';
|
|
83
|
+
import catalogModel78 from './kie/gpt-image-2.model.js';
|
|
84
|
+
import catalogModel79 from './kie/grok-imagine-2.0.model.js';
|
|
85
|
+
import catalogModel80 from './kie/grok-imagine-video.model.js';
|
|
86
|
+
import catalogModel81 from './kie/grok-imagine.model.js';
|
|
87
|
+
import catalogModel82 from './kie/hailuo-02.model.js';
|
|
88
|
+
import catalogModel83 from './kie/hailuo-2-3.model.js';
|
|
89
|
+
import catalogModel84 from './kie/happyhorse-1.1.model.js';
|
|
90
|
+
import catalogModel85 from './kie/kling-3.0-omni.model.js';
|
|
91
|
+
import catalogModel86 from './kie/kling-3.0-turbo.model.js';
|
|
92
|
+
import catalogModel87 from './kie/kling-3.0.model.js';
|
|
93
|
+
import catalogModel88 from './kie/kling-v2-6.model.js';
|
|
94
|
+
import catalogModel89 from './kie/minimax-h3.model.js';
|
|
95
|
+
import catalogModel90 from './kie/nano-banana-2-lite.model.js';
|
|
96
|
+
import catalogModel91 from './kie/nano-banana-2.model.js';
|
|
97
|
+
import catalogModel92 from './kie/nano-banana-pro.model.js';
|
|
98
|
+
import catalogModel93 from './kie/qwen-image-3.0.model.js';
|
|
99
|
+
import catalogModel94 from './kie/seedance-1.5-pro.model.js';
|
|
100
|
+
import catalogModel95 from './kie/seedance-2.0-fast.model.js';
|
|
101
|
+
import catalogModel96 from './kie/seedance-2.0-mini.model.js';
|
|
102
|
+
import catalogModel97 from './kie/seedance-2.0.model.js';
|
|
103
|
+
import catalogModel98 from './kie/seedance-2.5.model.js';
|
|
104
|
+
import catalogModel99 from './kie/seedance-v1.model.js';
|
|
105
|
+
import catalogModel100 from './kie/seedream-4.0.model.js';
|
|
106
|
+
import catalogModel101 from './kie/seedream-4.5.model.js';
|
|
107
|
+
import catalogModel102 from './kie/seedream-5.0-lite.model.js';
|
|
108
|
+
import catalogModel103 from './kie/seedream-5.0-pro.model.js';
|
|
109
|
+
import catalogModel104 from './kie/z-image.model.js';
|
|
110
|
+
import catalogModel105 from './modelscope/flux-1-krea-dev.model.js';
|
|
111
|
+
import catalogModel106 from './modelscope/majicmix-realistic.model.js';
|
|
112
|
+
import catalogModel107 from './modelscope/modelscope-custom.model.js';
|
|
113
|
+
import catalogModel108 from './modelscope/qwen-image-edit-2509.model.js';
|
|
114
|
+
import catalogModel109 from './modelscope/qwen-image.model.js';
|
|
115
|
+
import catalogModel110 from './modelscope/sdxl-14-ckpt.model.js';
|
|
116
|
+
import catalogModel111 from './modelscope/z-image-turbo.model.js';
|
|
117
|
+
import catalogModel112 from './ppio/kling-3.0.model.js';
|
|
118
|
+
import catalogModel113 from './ppio/minimax-hailuo-2.3.model.js';
|
|
119
|
+
import catalogModel114 from './ppio/minimax-speech.model.js';
|
|
120
|
+
import catalogModel115 from './ppio/wan-2.5-preview.model.js';
|
|
121
|
+
import catalogModel116 from './ppio/wan-2.6.model.js';
|
|
122
|
+
import catalogModel117 from './ppio/wan-2.7.model.js';
|
|
123
|
+
import catalogModel118 from './siliconflow/cosyvoice2-tts.model.js';
|
|
124
|
+
import catalogModel119 from './siliconflow/moss-ttsd-0.5.model.js';
|
|
125
|
+
import catalogModel120 from './volcengine-speech/seed-icl-2.0.model.js';
|
|
126
|
+
import catalogModel121 from './volcengine-speech/seed-tts-2.0.model.js';
|
|
127
|
+
import catalogModel122 from './volcengine/seedream-5.0-flash.model.js';
|
|
128
|
+
import catalogModel123 from './volcengine/seedream-5.0-lite.model.js';
|
|
129
|
+
import catalogModel124 from './volcengine/seedream-5.0-pro.model.js';
|
|
117
130
|
export * from './defineModel.js';
|
|
118
131
|
export * from './model-index.js';
|
|
119
132
|
export * from './validate.js';
|
|
@@ -232,5 +245,18 @@ export const catalog = [
|
|
|
232
245
|
catalogModel109,
|
|
233
246
|
catalogModel110,
|
|
234
247
|
catalogModel111,
|
|
248
|
+
catalogModel112,
|
|
249
|
+
catalogModel113,
|
|
250
|
+
catalogModel114,
|
|
251
|
+
catalogModel115,
|
|
252
|
+
catalogModel116,
|
|
253
|
+
catalogModel117,
|
|
254
|
+
catalogModel118,
|
|
255
|
+
catalogModel119,
|
|
256
|
+
catalogModel120,
|
|
257
|
+
catalogModel121,
|
|
258
|
+
catalogModel122,
|
|
259
|
+
catalogModel123,
|
|
260
|
+
catalogModel124,
|
|
235
261
|
];
|
|
236
262
|
export const catalogIndex = createModelIndex(catalog);
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { defineModel } from '../defineModel.js';
|
|
2
|
+
import { speechCharacterPrice, speechNumber, speechString, speechText } from '../audio/tts-common.js';
|
|
3
|
+
export const kieElevenTurbo25TtsModel = defineModel({
|
|
4
|
+
meta: {
|
|
5
|
+
id: 'kie-eleven-turbo-2.5-tts', canonicalModelId: 'eleven-turbo-2.5-tts', provider: 'kie', type: 'audio',
|
|
6
|
+
tags: ['text-to-audio', 'provider-kie'],
|
|
7
|
+
polling: { interval: 3000, maxAttempts: 120, expectedAttempts: 20 },
|
|
8
|
+
},
|
|
9
|
+
inputLimits: { images: { max: 0 }, videos: { max: 0 } },
|
|
10
|
+
params: [
|
|
11
|
+
{ id: 'kieElevenTurboVoice', type: 'text', order: 1, default: 'Rachel' },
|
|
12
|
+
{ id: 'kieElevenTurboStability', type: 'number', order: 2, default: 0.5, min: 0, max: 1, step: 0.05 },
|
|
13
|
+
{ id: 'kieElevenTurboSpeed', type: 'number', order: 3, default: 1, min: 0.7, max: 1.2, step: 0.05 },
|
|
14
|
+
],
|
|
15
|
+
endpoints: '/api/v1/jobs/createTask',
|
|
16
|
+
request: {
|
|
17
|
+
builder: (params) => ({
|
|
18
|
+
model: 'elevenlabs/text-to-speech-turbo-2-5',
|
|
19
|
+
input: {
|
|
20
|
+
text: speechText(params),
|
|
21
|
+
voice: speechString(params.kieElevenTurboVoice) ?? 'Rachel',
|
|
22
|
+
stability: speechNumber(params.kieElevenTurboStability) ?? 0.5,
|
|
23
|
+
speed: speechNumber(params.kieElevenTurboSpeed) ?? 1,
|
|
24
|
+
},
|
|
25
|
+
}),
|
|
26
|
+
},
|
|
27
|
+
pricing: { currency: '$', calculator: params => speechCharacterPrice(params, 0.03), description: '$0.03/千字符' },
|
|
28
|
+
});
|
|
29
|
+
export default kieElevenTurbo25TtsModel;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { defineModel } from '../defineModel.js';
|
|
2
|
+
import { speechString, speechText } from '../audio/tts-common.js';
|
|
3
|
+
function dialogueFrom(params) {
|
|
4
|
+
if (Array.isArray(params.kieElevenDialogue)) {
|
|
5
|
+
const items = params.kieElevenDialogue.filter((item) => {
|
|
6
|
+
return typeof item === 'object' && item !== null && !Array.isArray(item)
|
|
7
|
+
&& typeof item.text === 'string' && item.text.trim().length > 0
|
|
8
|
+
&& typeof item.voice === 'string' && item.voice.trim().length > 0;
|
|
9
|
+
});
|
|
10
|
+
if (items.length > 0)
|
|
11
|
+
return items;
|
|
12
|
+
}
|
|
13
|
+
return [{ text: speechText(params), voice: speechString(params.kieElevenDialogueVoice) ?? 'EkK5I93UQWFDigLMpZcX' }];
|
|
14
|
+
}
|
|
15
|
+
export const kieElevenV3DialogueModel = defineModel({
|
|
16
|
+
meta: {
|
|
17
|
+
id: 'kie-eleven-v3-dialogue', canonicalModelId: 'eleven-v3-dialogue', provider: 'kie', type: 'audio',
|
|
18
|
+
tags: ['text-to-audio', 'provider-kie'],
|
|
19
|
+
polling: { interval: 3000, maxAttempts: 120, expectedAttempts: 20 },
|
|
20
|
+
},
|
|
21
|
+
inputLimits: { images: { max: 0 }, videos: { max: 0 } },
|
|
22
|
+
params: [
|
|
23
|
+
{ id: 'kieElevenDialogueVoice', type: 'text', order: 1, default: 'EkK5I93UQWFDigLMpZcX' },
|
|
24
|
+
],
|
|
25
|
+
endpoints: '/api/v1/jobs/createTask',
|
|
26
|
+
request: {
|
|
27
|
+
builder: (params) => ({
|
|
28
|
+
model: 'elevenlabs/text-to-dialogue-v3',
|
|
29
|
+
input: { dialogue: dialogueFrom(params) },
|
|
30
|
+
}),
|
|
31
|
+
},
|
|
32
|
+
pricing: {
|
|
33
|
+
currency: '$',
|
|
34
|
+
calculator: params => {
|
|
35
|
+
const dialogue = Array.isArray(params.kieElevenDialogue)
|
|
36
|
+
? params.kieElevenDialogue.filter((item) => typeof item === 'object' && item !== null && !Array.isArray(item))
|
|
37
|
+
: [];
|
|
38
|
+
const total = dialogue.length > 0
|
|
39
|
+
? dialogue.reduce((sum, item) => sum + (typeof item.text === 'string' ? Array.from(item.text).length : 0), 0)
|
|
40
|
+
: Array.from(typeof params.text === 'string' ? params.text : typeof params.prompt === 'string' ? params.prompt : '').length;
|
|
41
|
+
return total * 0.07 / 1000;
|
|
42
|
+
},
|
|
43
|
+
description: '$0.07/千字符',
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
export default kieElevenV3DialogueModel;
|