Skip to content

Commit 05eccf1

Browse files
author
Theodore Li
committed
Use default model when model id isn't provided
1 parent 2cccfdd commit 05eccf1

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

apps/sim/tools/tts/elevenlabs.ts

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,7 @@ export const elevenLabsTtsUnifiedTool: ToolConfig<ElevenLabsTtsUnifiedParams, Tt
2020
throw new Error('Missing text parameter, cannot determine character cost')
2121
}
2222
const characterCount = text.length
23-
const modelId = params.modelId as string | undefined
24-
if (!modelId) {
25-
throw new Error('Missing modelId parameter, cannot determine pricing tier')
26-
}
23+
const modelId = (params.modelId as string) || 'eleven_turbo_v2_5'
2724
// Flash/Turbo: $0.08/1K chars, Standard/Multilingual/v3: $0.18/1K chars
2825
// Scale tier additional character rates — https://elevenlabs.io/pricing/api
2926
const costPer1KChars = FLASH_TURBO_MODELS.has(modelId) ? 0.08 : 0.18

0 commit comments

Comments
 (0)