diff --git a/wavefront/client/src/config/voice-providers.ts b/wavefront/client/src/config/voice-providers.ts index de6ee1d1..66592821 100644 --- a/wavefront/client/src/config/voice-providers.ts +++ b/wavefront/client/src/config/voice-providers.ts @@ -70,7 +70,7 @@ export const VOICE_PROVIDERS_CONFIG: VoiceProvidersConfig = { default: 0.5, min: 0, max: 1, - step: 0.05, + step: 0.01, description: 'Controls voice consistency (0-1)', }, similarity_boost: { @@ -78,7 +78,7 @@ export const VOICE_PROVIDERS_CONFIG: VoiceProvidersConfig = { default: 0.75, min: 0, max: 1, - step: 0.05, + step: 0.01, description: 'Enhances voice similarity (0-1)', }, style: { @@ -86,7 +86,7 @@ export const VOICE_PROVIDERS_CONFIG: VoiceProvidersConfig = { default: 0.0, min: 0, max: 1, - step: 0.05, + step: 0.01, description: 'Style exaggeration (0-1)', }, use_speaker_boost: { @@ -99,7 +99,7 @@ export const VOICE_PROVIDERS_CONFIG: VoiceProvidersConfig = { default: 1.0, min: 0.25, max: 4.0, - step: 0.05, + step: 0.01, description: 'Speech speed (0.25-4.0)', }, }, @@ -155,7 +155,7 @@ export const VOICE_PROVIDERS_CONFIG: VoiceProvidersConfig = { default: undefined, description: 'Speech speed multiplier', placeholder: '1.0', - step: 0.1, + step: 0.01, }, }, }, @@ -183,7 +183,7 @@ export const VOICE_PROVIDERS_CONFIG: VoiceProvidersConfig = { default: 0.0, min: -0.75, max: 0.75, - step: 0.05, + step: 0.01, description: 'Voice pitch (-0.75 to 0.75)', }, pace: { @@ -191,7 +191,7 @@ export const VOICE_PROVIDERS_CONFIG: VoiceProvidersConfig = { default: 1.0, min: 0.3, max: 3.0, - step: 0.1, + step: 0.01, description: 'Speech pace (0.3-3.0)', }, loudness: { @@ -199,7 +199,7 @@ export const VOICE_PROVIDERS_CONFIG: VoiceProvidersConfig = { default: 1.0, min: 0.1, max: 3.0, - step: 0.1, + step: 0.01, description: 'Volume (0.1-3.0)', }, enable_preprocessing: { @@ -212,7 +212,7 @@ export const VOICE_PROVIDERS_CONFIG: VoiceProvidersConfig = { default: 0.6, min: 0.01, max: 1.0, - step: 0.05, + step: 0.01, description: 'Randomness for bulbul v3 (0.01-1.0)', }, }, diff --git a/wavefront/server/apps/call_processing/call_processing/constants/filler_phrases.py b/wavefront/server/apps/call_processing/call_processing/constants/filler_phrases.py new file mode 100644 index 00000000..1d4dfe24 --- /dev/null +++ b/wavefront/server/apps/call_processing/call_processing/constants/filler_phrases.py @@ -0,0 +1,33 @@ +FILLER_PHRASES = { + 'en': [ + 'Please wait a moment', + 'Just a second', + 'Give me a moment', + 'One moment please', + ], + 'hi': ['कृपया एक पल प्रतीक्षा करें', 'बस एक सेकंड', 'मुझे एक पल दें', 'एक पल रुकिए'], + 'ta': [ + 'தயவுசெய்து ஒரு நிமிடம் காத்திருக்கவும்', + 'ஒரு நொடி', + 'எனக்கு ஒரு நிமிடம் கொடுங்கள்', + 'ஒரு நிமிடம்', + ], + 'te': [ + 'దయచేసి ఒక్క క్షణం వేచి ఉండండి', + 'ఒక్క నిమిషం', + 'నాకు ఒక్క క్షణం ఇవ్వండి', + 'ఒక్క క్షణం దయచేసి', + ], + 'ml': [ + 'ദയവായി ഒരു നിമിഷം കാത്തിരിക്കൂ', + 'ഒരു സെക്കൻഡ്', + 'എനിക്ക് ഒരു നിമിഷം തരൂ', + 'ഒരു നിമിഷം ദയവായി', + ], + 'kn': [ + 'ದಯವಿಟ್ಟು ಒಂದು ಕ್ಷಣ ಕಾಯಿರಿ', + 'ಒಂದು ಕ್ಷಣ', + 'ನನಗೆ ಒಂದು ಕ್ಷಣ ನೀಡಿ', + 'ಒಂದು ಕ್ಷಣ ದಯವಿಟ್ಟು', + ], +} diff --git a/wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py b/wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py index e8b7c0bc..069d8871 100644 --- a/wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py +++ b/wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py @@ -6,6 +6,8 @@ from typing import Dict, Any, List from copy import deepcopy +import os +import random from call_processing.log.logger import logger from call_processing.services.tool_wrapper_service import ToolWrapperFactory from call_processing.utils import get_current_ist_time_str @@ -57,6 +59,7 @@ from call_processing.constants.language_config import ( LANGUAGE_INSTRUCTIONS, ) +from call_processing.constants.filler_phrases import FILLER_PHRASES class STTLanguageSwitcher(ParallelPipeline): @@ -519,6 +522,25 @@ async def run_conversation( task_container['task'] = task # Register event handlers + @llm.event_handler('on_function_calls_started') + async def on_function_calls_started(service, function_calls): + if ( + os.getenv('ENABLE_FILLER_PHRASES_BEFORE_TOOL_CALL', '').lower() + != 'true' + ): + return + # Skip filler phrase when language is switching — the TTS service's language + # may change before the queued frame is processed, causing a language mismatch error. + call_names = [fc.function_name for fc in function_calls] + if 'detect_and_switch_language' in call_names: + return + current_lang = language_state.get('current_language', 'en') + phrases = FILLER_PHRASES.get(current_lang) + if not phrases: + return + phrase = random.choice(phrases) + await task.queue_frame(TTSSpeakFrame(phrase)) + @transport.event_handler('on_client_connected') async def on_client_connected(transport, client): logger.info(f"Client connected for agent: {agent_config['name']}")