fix(provider.elevenlabs): Provide default ElevenLabs TTS voice fallback and add local tool/project configs

This commit is contained in:
2025-10-09 07:00:15 +00:00
parent b78168307b
commit 8666876879
5 changed files with 79 additions and 6 deletions

View File

@@ -3,6 +3,6 @@
*/
export const commitinfo = {
name: '@push.rocks/smartai',
version: '0.7.5',
version: '0.7.6',
description: 'SmartAi is a versatile TypeScript library designed to facilitate integration and interaction with various AI models, offering functionalities for chat, audio generation, document processing, and vision tasks.'
}

View File

@@ -55,11 +55,8 @@ export class ElevenLabsProvider extends MultiModalModel {
modelId?: string;
voiceSettings?: IElevenLabsVoiceSettings;
}): Promise<NodeJS.ReadableStream> {
const voiceId = optionsArg.voiceId || this.options.defaultVoiceId;
if (!voiceId) {
throw new Error('Voice ID is required for ElevenLabs TTS. Please provide voiceId in the method call or set defaultVoiceId in provider options.');
}
// Use Samara voice as default fallback
const voiceId = optionsArg.voiceId || this.options.defaultVoiceId || '19STyYD15bswVz51nqLf';
const modelId = optionsArg.modelId || this.options.defaultModelId || 'eleven_v3';