Skip to content

filler phrase while starting tool call#232

Merged
rootflo-hardik merged 6 commits into
developfrom
CU-86d243yj6-voice-agent-filler-phrases
Mar 2, 2026
Merged

filler phrase while starting tool call#232
rootflo-hardik merged 6 commits into
developfrom
CU-86d243yj6-voice-agent-filler-phrases

Conversation

@rootflo-hardik
Copy link
Copy Markdown
Contributor

@rootflo-hardik rootflo-hardik commented Feb 27, 2026

Summary by CodeRabbit

  • New Features

    • Multilingual filler phrases play while requests are processed to keep users engaged; supports English, Hindi, Tamil, Telugu, Malayalam, and Kannada with multiple polite variants per language.
    • Filler messages are chosen dynamically based on the active language and skip playback during language switching.
  • Chores

    • Voice control sliders now allow finer-grained adjustments for stability, speed, pitch, pace, loudness and related settings (smaller step increments).

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Feb 27, 2026

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

Adds a new multilingual constant FILLER_PHRASES and registers an LLM event handler in the Pipecat service to emit a language-aware random filler phrase (as a TTSSpeakFrame) when function calls start, skipping when language switching is detected. Also tightens numeric step granularity for voice provider controls in the client config.

Changes

Cohort / File(s) Summary
Filler Phrases Data
wavefront/server/apps/call_processing/call_processing/constants/filler_phrases.py
Adds new constant FILLER_PHRASES: a dict mapping language codes (en, hi, ta, te, ml, kn) to lists of four polite filler phrases each.
Pipecat Service Integration
wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py
Adds imports (os, random, FILLER_PHRASES) and registers on_function_calls_started on the LLM event stream; handler reads language_state, skips during detect_and_switch_language, selects a random phrase for the current language, and enqueues a TTSSpeakFrame when function calls begin.
Client Voice Config
wavefront/client/src/config/voice-providers.ts
Reduces numeric step values (e.g., from 0.05/0.1 to 0.01) across multiple voice provider parameters to increase adjustment granularity; no API shape changes.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant Pipecat as PipecatService
    participant LLM
    participant LangState as LanguageState
    participant Phrases as FILLER_PHRASES
    participant TTSQueue as TTSQueue

    Client->>Pipecat: request triggering function calls
    Pipecat->>LLM: send prompt / await function calls
    LLM-->>Pipecat: event stream (function calls started)
    Pipecat->>Pipecat: on_function_calls_started handler
    Pipecat->>LangState: read current_language
    LangState-->>Pipecat: language code
    Pipecat->>Phrases: fetch phrases[language]
    Phrases-->>Pipecat: list of phrases
    Pipecat->>Pipecat: select random phrase
    Pipecat->>TTSQueue: enqueue TTSSpeakFrame(phrase)
    TTSQueue-->>Client: play spoken filler phrase
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

"I nibble bytes and hop through queues,
I hum in tongues to choose good cues,
When functions pause and wait in line,
I whisper softly, one of mine,
A rabbit's phrase to keep the time. 🐇"

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly and specifically describes the main change: adding filler phrases before tool calls in the call processing service.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch CU-86d243yj6-voice-agent-filler-phrases

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (1)
wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py (1)

527-530: Harden phrase fallback when a language key exists but has an empty list.

Current logic falls back only for missing keys; if a configured list is empty, Line 530 can raise on random.choice.

Suggested fix
-            phrases = FILLER_PHRASES.get(
-                current_lang, FILLER_PHRASES.get('en', ['Please wait a moment'])
-            )
+            phrases = (
+                FILLER_PHRASES.get(current_lang)
+                or FILLER_PHRASES.get('en')
+                or ('Please wait a moment.',)
+            )
             phrase = random.choice(phrases)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py`
around lines 527 - 530, The code uses FILLER_PHRASES.get(current_lang, ...) then
does random.choice(phrases) which will raise if the key exists but maps to an
empty list; update the logic around FILLER_PHRASES/current_lang/phrases/phrase
so you explicitly ensure phrases is a non-empty list before calling
random.choice by checking if not phrases and then assigning
FILLER_PHRASES.get('en') or a hardcoded default like ['Please wait a moment'];
apply this fix in the block that sets phrases and phrase so it safely falls back
when the language key exists but the list is empty.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py`:
- Line 525: The on_function_calls_started callback defines unused parameters
`service` and `function_calls` causing ARG001; fix it by renaming the parameters
to indicate intentional unused (e.g., `_service` and `_function_calls`) or
prefixing them with underscores so the linter ignores them while keeping the
function signature (update the async def on_function_calls_started definition
accordingly).

---

Nitpick comments:
In
`@wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py`:
- Around line 527-530: The code uses FILLER_PHRASES.get(current_lang, ...) then
does random.choice(phrases) which will raise if the key exists but maps to an
empty list; update the logic around FILLER_PHRASES/current_lang/phrases/phrase
so you explicitly ensure phrases is a non-empty list before calling
random.choice by checking if not phrases and then assigning
FILLER_PHRASES.get('en') or a hardcoded default like ['Please wait a moment'];
apply this fix in the block that sets phrases and phrase so it safely falls back
when the language key exists but the list is empty.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 6532504 and 7881485.

📒 Files selected for processing (2)
  • wavefront/server/apps/call_processing/call_processing/constants/filler_phrases.py
  • wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py


# Register event handlers
@llm.event_handler('on_function_calls_started')
async def on_function_calls_started(service, function_calls):
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Resolve unused callback parameters to keep lint clean.

Line 525 introduces service and function_calls but does not use them (Ruff ARG001).

Suggested fix
-        async def on_function_calls_started(service, function_calls):
+        async def on_function_calls_started(_service, _function_calls):
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
async def on_function_calls_started(service, function_calls):
async def on_function_calls_started(_service, _function_calls):
🧰 Tools
🪛 Ruff (0.15.2)

[warning] 525-525: Unused function argument: service

(ARG001)


[warning] 525-525: Unused function argument: function_calls

(ARG001)

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py`
at line 525, The on_function_calls_started callback defines unused parameters
`service` and `function_calls` causing ARG001; fix it by renaming the parameters
to indicate intentional unused (e.g., `_service` and `_function_calls`) or
prefixing them with underscores so the linter ignores them while keeping the
function signature (update the async def on_function_calls_started definition
accordingly).

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py (1)

525-525: ⚠️ Potential issue | 🟡 Minor

Rename unused callback arg to clear Ruff ARG001.

service is still unused in this handler. Prefix it with _ to make intent explicit and keep lint clean.

Suggested fix
-        async def on_function_calls_started(service, function_calls):
+        async def on_function_calls_started(_service, function_calls):
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py`
at line 525, The handler on_function_calls_started currently declares an unused
parameter named service which triggers Ruff ARG001; rename that parameter to
_service (or _ ) in the async def on_function_calls_started signature to mark it
as intentionally unused and update any internal references (none expected)
accordingly so the lint error is resolved.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In
`@wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py`:
- Line 525: The handler on_function_calls_started currently declares an unused
parameter named service which triggers Ruff ARG001; rename that parameter to
_service (or _ ) in the async def on_function_calls_started signature to mark it
as intentionally unused and update any internal references (none expected)
accordingly so the lint error is resolved.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 7881485 and 92a32dd.

📒 Files selected for processing (1)
  • wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

♻️ Duplicate comments (1)
wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py (1)

526-526: ⚠️ Potential issue | 🟡 Minor

Rename the unused callback parameter at Line 526.

service is currently unused and still triggers Ruff ARG001.

Suggested fix
-        async def on_function_calls_started(service, function_calls):
+        async def on_function_calls_started(_service, function_calls):
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py`
at line 526, The callback on_function_calls_started currently declares a
parameter named service that is unused and triggers Ruff ARG001; rename the
parameter in the function signature (e.g., from service to _service or _) to
mark it as intentionally unused and update any callers or references to the
callback registration if they rely on positional args, leaving the function body
unchanged (function name: on_function_calls_started).
🧹 Nitpick comments (1)
wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py (1)

528-531: Cache the feature flag once instead of reading env on every callback.

Reading/parsing ENABLE_FILLER_PHRASES_BEFORE_TOOL_CALL per event is avoidable overhead and can cause runtime behavior drift if env changes mid-call.

Refactor sketch
+        enable_filler_phrases_before_tool_call = (
+            os.getenv('ENABLE_FILLER_PHRASES_BEFORE_TOOL_CALL', '').strip().lower()
+            == 'true'
+        )
+
         `@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'
-            ):
+            if not enable_filler_phrases_before_tool_call:
                 return
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py`
around lines 528 - 531, Cache the ENABLE_FILLER_PHRASES_BEFORE_TOOL_CALL flag
once instead of calling os.getenv(...) on every event: read and parse the env
var to a boolean at module import or in the PipecatService initializer (e.g.,
store as module-level ENABLE_FILLER_PHRASES_BEFORE_TOOL_CALL or
self.enable_filler_phrases_before_tool_call) and replace the per-callback check
that currently uses os.getenv('ENABLE_FILLER_PHRASES_BEFORE_TOOL_CALL',
'').lower() != 'true' with a check against the cached boolean; ensure the
variable name matches existing style and is used wherever that runtime check
appears.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In
`@wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py`:
- Line 526: The callback on_function_calls_started currently declares a
parameter named service that is unused and triggers Ruff ARG001; rename the
parameter in the function signature (e.g., from service to _service or _) to
mark it as intentionally unused and update any callers or references to the
callback registration if they rely on positional args, leaving the function body
unchanged (function name: on_function_calls_started).

---

Nitpick comments:
In
`@wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py`:
- Around line 528-531: Cache the ENABLE_FILLER_PHRASES_BEFORE_TOOL_CALL flag
once instead of calling os.getenv(...) on every event: read and parse the env
var to a boolean at module import or in the PipecatService initializer (e.g.,
store as module-level ENABLE_FILLER_PHRASES_BEFORE_TOOL_CALL or
self.enable_filler_phrases_before_tool_call) and replace the per-callback check
that currently uses os.getenv('ENABLE_FILLER_PHRASES_BEFORE_TOOL_CALL',
'').lower() != 'true' with a check against the cached boolean; ensure the
variable name matches existing style and is used wherever that runtime check
appears.

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 90630d7 and 30be05e.

📒 Files selected for processing (1)
  • wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py

Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
wavefront/client/src/config/voice-providers.ts (1)

73-215: Consider extracting a shared fine-step constant.

0.01 is repeated across multiple parameter entries; centralizing it would reduce drift risk during future tuning updates.

♻️ Proposed refactor
+const FINE_NUMERIC_STEP = 0.01;
+
 export const VOICE_PROVIDERS_CONFIG: VoiceProvidersConfig = {
   tts: {
@@
           stability: {
@@
-            step: 0.01,
+            step: FINE_NUMERIC_STEP,
@@
           similarity_boost: {
@@
-            step: 0.01,
+            step: FINE_NUMERIC_STEP,
@@
           style: {
@@
-            step: 0.01,
+            step: FINE_NUMERIC_STEP,
@@
           speed: {
@@
-            step: 0.01,
+            step: FINE_NUMERIC_STEP,
@@
           speed: {
@@
-            step: 0.01,
+            step: FINE_NUMERIC_STEP,
@@
           pitch: {
@@
-            step: 0.01,
+            step: FINE_NUMERIC_STEP,
@@
           pace: {
@@
-            step: 0.01,
+            step: FINE_NUMERIC_STEP,
@@
           loudness: {
@@
-            step: 0.01,
+            step: FINE_NUMERIC_STEP,
@@
           temperature: {
@@
-            step: 0.01,
+            step: FINE_NUMERIC_STEP,
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@wavefront/client/src/config/voice-providers.ts` around lines 73 - 215,
Multiple parameter definitions in voice-providers.ts repeat the magic number
0.01 for step values (e.g., similarity_boost.step, style.step, speed.step,
cartesia.parameters.speed.step, sarvam.parameters.pitch.step, temperature.step);
extract a shared constant (e.g., const FINE_STEP = 0.01) near the top of the
module and replace all occurrences of 0.01 in these parameter "step" fields with
that constant so future tuning updates change one symbol (update references in
objects named deepgram, cartesia, sarvam, and any other provider parameter
entries).
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@wavefront/client/src/config/voice-providers.ts`:
- Around line 73-215: Multiple parameter definitions in voice-providers.ts
repeat the magic number 0.01 for step values (e.g., similarity_boost.step,
style.step, speed.step, cartesia.parameters.speed.step,
sarvam.parameters.pitch.step, temperature.step); extract a shared constant
(e.g., const FINE_STEP = 0.01) near the top of the module and replace all
occurrences of 0.01 in these parameter "step" fields with that constant so
future tuning updates change one symbol (update references in objects named
deepgram, cartesia, sarvam, and any other provider parameter entries).

ℹ️ Review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 30be05e and 566a1ae.

📒 Files selected for processing (1)
  • wavefront/client/src/config/voice-providers.ts

@rootflo-hardik rootflo-hardik merged commit c22cc40 into develop Mar 2, 2026
10 checks passed
@vishnurk6247 vishnurk6247 deleted the CU-86d243yj6-voice-agent-filler-phrases branch March 3, 2026 08:11
thomastomy5 pushed a commit that referenced this pull request Apr 27, 2026
* filler phrase while starting tool call

* skip tts phrase when lang switches

* removed periods from filler phrases

* added env var ENABLE_FILLER_PHRASES_BEFORE_TOOL_CALL

* made step to 0.01 for voice provider config
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants