@@ -5,7 +5,7 @@ import type { ElevenLabsBlockResponse } from '@/tools/elevenlabs/types'
55export const ElevenLabsBlock : BlockConfig < ElevenLabsBlockResponse > = {
66 type : 'elevenlabs' ,
77 name : 'ElevenLabs' ,
8- description : 'Convert TTS using ElevenLabs' ,
8+ description : 'Convert text to speech with ElevenLabs' ,
99 authMode : AuthMode . ApiKey ,
1010 longDescription : 'Integrate ElevenLabs into the workflow. Can convert text to speech.' ,
1111 docsLink : 'https://docs.sim.ai/tools/elevenlabs' ,
@@ -42,6 +42,21 @@ export const ElevenLabsBlock: BlockConfig<ElevenLabsBlockResponse> = {
4242 { label : 'eleven_flash_v2_5' , id : 'eleven_flash_v2_5' } ,
4343 { label : 'eleven_v3' , id : 'eleven_v3' } ,
4444 ] ,
45+ value : ( ) => 'eleven_monolingual_v1' ,
46+ } ,
47+ {
48+ id : 'stability' ,
49+ title : 'Stability' ,
50+ type : 'short-input' ,
51+ placeholder : '0.0 to 1.0 (e.g., 0.5)' ,
52+ mode : 'advanced' ,
53+ } ,
54+ {
55+ id : 'similarityBoost' ,
56+ title : 'Similarity Boost' ,
57+ type : 'short-input' ,
58+ placeholder : '0.0 to 1.0 (e.g., 0.75)' ,
59+ mode : 'advanced' ,
4560 } ,
4661 {
4762 id : 'apiKey' ,
@@ -57,19 +72,30 @@ export const ElevenLabsBlock: BlockConfig<ElevenLabsBlockResponse> = {
5772 access : [ 'elevenlabs_tts' ] ,
5873 config : {
5974 tool : ( ) => 'elevenlabs_tts' ,
60- params : ( params ) => ( {
61- apiKey : params . apiKey ,
62- text : params . text ,
63- voiceId : params . voiceId ,
64- modelId : params . modelId ,
65- } ) ,
75+ params : ( params ) => {
76+ const parseUnitInterval = ( value : unknown ) : number | undefined => {
77+ if ( value === undefined || value === null || value === '' ) return undefined
78+ const n = Number ( value )
79+ return Number . isFinite ( n ) ? n : undefined
80+ }
81+ return {
82+ apiKey : params . apiKey ,
83+ text : params . text ,
84+ voiceId : params . voiceId ,
85+ modelId : params . modelId ,
86+ stability : parseUnitInterval ( params . stability ) ,
87+ similarityBoost : parseUnitInterval ( params . similarityBoost ) ,
88+ }
89+ } ,
6690 } ,
6791 } ,
6892
6993 inputs : {
7094 text : { type : 'string' , description : 'Text to convert' } ,
7195 voiceId : { type : 'string' , description : 'Voice identifier' } ,
7296 modelId : { type : 'string' , description : 'Model identifier' } ,
97+ stability : { type : 'number' , description : 'Voice stability 0.0-1.0' } ,
98+ similarityBoost : { type : 'number' , description : 'Similarity boost 0.0-1.0' } ,
7399 apiKey : { type : 'string' , description : 'ElevenLabs API key' } ,
74100 } ,
75101
0 commit comments