From 7881485b323da1ddfceb974a97e60802c2da374e Mon Sep 17 00:00:00 2001 From: rootflo-hardik Date: Fri, 27 Feb 2026 13:44:02 +0530 Subject: [PATCH 1/5] filler phrase while starting tool call --- .../constants/filler_phrases.py | 33 +++++++++++++++++++ .../services/pipecat_service.py | 11 +++++++ 2 files changed, 44 insertions(+) create mode 100644 wavefront/server/apps/call_processing/call_processing/constants/filler_phrases.py 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..02789657 --- /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..a32f156d 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,7 @@ from typing import Dict, Any, List from copy import deepcopy +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 +58,7 @@ from call_processing.constants.language_config import ( LANGUAGE_INSTRUCTIONS, ) +from call_processing.constants.filler_phrases import FILLER_PHRASES class STTLanguageSwitcher(ParallelPipeline): @@ -519,6 +521,15 @@ 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): + current_lang = language_state.get('current_language', 'en') + phrases = FILLER_PHRASES.get( + current_lang, FILLER_PHRASES.get('en', ['Please wait a moment']) + ) + 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']}") From 92a32dde22e8e87ed84530e8da75c714bc6b1bae Mon Sep 17 00:00:00 2001 From: rootflo-hardik Date: Sat, 28 Feb 2026 11:34:44 +0530 Subject: [PATCH 2/5] skip tts phrase when lang switches --- .../call_processing/services/pipecat_service.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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 a32f156d..be4ece5b 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 @@ -523,10 +523,15 @@ async def run_conversation( # Register event handlers @llm.event_handler('on_function_calls_started') async def on_function_calls_started(service, function_calls): + # 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, FILLER_PHRASES.get('en', ['Please wait a moment']) - ) + phrases = FILLER_PHRASES.get(current_lang) + if not phrases: + return phrase = random.choice(phrases) await task.queue_frame(TTSSpeakFrame(phrase)) From 90630d7cab88e151f4496e086efc34cdfa891de5 Mon Sep 17 00:00:00 2001 From: rootflo-hardik Date: Sat, 28 Feb 2026 11:56:04 +0530 Subject: [PATCH 3/5] removed periods from filler phrases --- .../constants/filler_phrases.py | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) 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 index 02789657..1d4dfe24 100644 --- a/wavefront/server/apps/call_processing/call_processing/constants/filler_phrases.py +++ b/wavefront/server/apps/call_processing/call_processing/constants/filler_phrases.py @@ -1,33 +1,33 @@ FILLER_PHRASES = { 'en': [ - 'Please wait a moment.', - 'Just a second.', - 'Give me a moment.', - 'One moment please.', + 'Please wait a moment', + 'Just a second', + 'Give me a moment', + 'One moment please', ], - 'hi': ['कृपया एक पल प्रतीक्षा करें।', 'बस एक सेकंड।', 'मुझे एक पल दें।', 'एक पल रुकिए।'], + 'hi': ['कृपया एक पल प्रतीक्षा करें', 'बस एक सेकंड', 'मुझे एक पल दें', 'एक पल रुकिए'], 'ta': [ - 'தயவுசெய்து ஒரு நிமிடம் காத்திருக்கவும்.', - 'ஒரு நொடி.', - 'எனக்கு ஒரு நிமிடம் கொடுங்கள்.', - 'ஒரு நிமிடம்.', + 'தயவுசெய்து ஒரு நிமிடம் காத்திருக்கவும்', + 'ஒரு நொடி', + 'எனக்கு ஒரு நிமிடம் கொடுங்கள்', + 'ஒரு நிமிடம்', ], 'te': [ - 'దయచేసి ఒక్క క్షణం వేచి ఉండండి.', - 'ఒక్క నిమిషం.', - 'నాకు ఒక్క క్షణం ఇవ్వండి.', - 'ఒక్క క్షణం దయచేసి.', + 'దయచేసి ఒక్క క్షణం వేచి ఉండండి', + 'ఒక్క నిమిషం', + 'నాకు ఒక్క క్షణం ఇవ్వండి', + 'ఒక్క క్షణం దయచేసి', ], 'ml': [ - 'ദയവായി ഒരു നിമിഷം കാത്തിരിക്കൂ.', - 'ഒരു സെക്കൻഡ്.', - 'എനിക്ക് ഒരു നിമിഷം തരൂ.', - 'ഒരു നിമിഷം ദയവായി.', + 'ദയവായി ഒരു നിമിഷം കാത്തിരിക്കൂ', + 'ഒരു സെക്കൻഡ്', + 'എനിക്ക് ഒരു നിമിഷം തരൂ', + 'ഒരു നിമിഷം ദയവായി', ], 'kn': [ - 'ದಯವಿಟ್ಟು ಒಂದು ಕ್ಷಣ ಕಾಯಿರಿ.', - 'ಒಂದು ಕ್ಷಣ.', - 'ನನಗೆ ಒಂದು ಕ್ಷಣ ನೀಡಿ.', - 'ಒಂದು ಕ್ಷಣ ದಯವಿಟ್ಟು.', + 'ದಯವಿಟ್ಟು ಒಂದು ಕ್ಷಣ ಕಾಯಿರಿ', + 'ಒಂದು ಕ್ಷಣ', + 'ನನಗೆ ಒಂದು ಕ್ಷಣ ನೀಡಿ', + 'ಒಂದು ಕ್ಷಣ ದಯವಿಟ್ಟು', ], } From 30be05e19c6bad66d79ed4eb03f04f45b29ea8e5 Mon Sep 17 00:00:00 2001 From: rootflo-hardik Date: Mon, 2 Mar 2026 11:19:33 +0530 Subject: [PATCH 4/5] added env var ENABLE_FILLER_PHRASES_BEFORE_TOOL_CALL --- .../call_processing/services/pipecat_service.py | 6 ++++++ 1 file changed, 6 insertions(+) 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 be4ece5b..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,7 @@ 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 @@ -523,6 +524,11 @@ async def run_conversation( # 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] From 566a1ae2cebd6d160c2d88f3b35133c4aba1ed7b Mon Sep 17 00:00:00 2001 From: rootflo-hardik Date: Mon, 2 Mar 2026 13:55:25 +0530 Subject: [PATCH 5/5] made step to 0.01 for voice provider config --- wavefront/client/src/config/voice-providers.ts | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) 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)', }, },