Skip to content

feat(voice_agent): pipecat 0.0.103 → 0.0.106 - #248

Merged
vizsatiz merged 3 commits into
developfrom
CU-86d2ccen3-upgrade-pipecat-from-00103-to-00106
Jun 22, 2026
Merged

feat(voice_agent): pipecat 0.0.103 → 0.0.106#248
vizsatiz merged 3 commits into
developfrom
CU-86d2ccen3-upgrade-pipecat-from-00103-to-00106

Conversation

@rootflo-hardik

@rootflo-hardik rootflo-hardik commented Mar 23, 2026

Copy link
Copy Markdown
Contributor
  • Bump pipecat-ai to 0.0.106, remove dropped local-smart-turn-v3 extra
  • Replace deprecated InputParams with typed Settings classes across tts_service and stt_service
  • Replace ParallelPipeline-based multi-language routing (LanguageSwitcher/STTLanguageSwitcher) with single TTS/STT service + runtime TTSUpdateSettingsFrame/STTUpdateSettingsFrame
  • Fix spurious double tool call on language switch: mutate context system message in-place instead of using LLMMessagesUpdateFrame (which stripped in-flight tool call from history)
  • Remove deprecated TranscriptProcessor from pipeline (redundant with existing aggregator events)

Summary by CodeRabbit

  • Refactor
    • Simplified multi-language conversation flow by using a single STT/TTS setup based on the selected default language, improving consistency across languages.
    • Reworked provider configuration to use standardized settings objects per speech provider.
    • Improved runtime language switching by applying updates only when supported, skipping gracefully when not.
  • Bug Fixes
    • Updated welcome prompt handling so the spoken welcome is appended to the conversation context without disrupting prior history.
  • Chores
    • Updated the pinned speech-processing dependency to the latest version.

- Bump pipecat-ai to 0.0.106, remove dropped `local-smart-turn-v3` extra
- Replace deprecated InputParams with typed Settings classes across tts_service and stt_service
- Replace ParallelPipeline-based multi-language routing (LanguageSwitcher/STTLanguageSwitcher)
  with single TTS/STT service + runtime TTSUpdateSettingsFrame/STTUpdateSettingsFrame
- Fix spurious double tool call on language switch: mutate context system message in-place
  instead of using LLMMessagesUpdateFrame (which stripped in-flight tool call from history)
- Remove deprecated TranscriptProcessor from pipeline (redundant with existing aggregator events)
@coderabbitai

coderabbitai Bot commented Mar 23, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 3a12a08a-2f7b-4164-8613-42c374121702

📥 Commits

Reviewing files that changed from the base of the PR and between 7f44b0d and a291af5.

⛔ Files ignored due to path filters (1)
  • wavefront/server/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (1)
  • wavefront/server/apps/call_processing/pyproject.toml
✅ Files skipped from review due to trivial changes (1)
  • wavefront/server/apps/call_processing/pyproject.toml

📝 Walkthrough

Walkthrough

Refactors multi-language switching architecture: removes per-language switcher pipelines and replaces them with single TTS/STT service instances per call, each configured with provider-specific settings objects instead of option/parameter construction. Introduces conditional queuing of TTS/STT language-update frames at runtime via new factory methods. Modifies conversation context mutation to update system messages in-place instead of snapshot-replacing via queued frames. Updates pipecat-ai dependency to 0.0.106.

Changes

Multi-Language Switching Refactoring

Layer / File(s) Summary
Language Detection Tool contract and frame queuing
wavefront/server/apps/call_processing/call_processing/services/language_detection_tool.py
Updated LanguageDetectionToolFactory.create_language_detection_tool() signature: removed language_switcher/stt_language_switcher, added tts_provider, stt_provider, tts_voice_ids. Replaces immediate in-memory language state changes with conditional creation and queuing of TTSUpdateSettingsFrame/STTUpdateSettingsFrame. Mutates conversation context messages in-place by updating current_messages[0] and calling context.set_messages() instead of using LLMMessagesUpdateFrame.
TTS provider settings and language update frames
wavefront/server/apps/call_processing/call_processing/services/tts_service.py
Refactored TTS service constructors to pass *TTSSettings objects (ElevenLabs, Deepgram, Cartesia, Sarvam, Azure) instead of InputParams/params. Settings objects now receive assembled voice, model, and mapped language fields plus provider-specific parameters. Added TTSServiceFactory.create_language_update_frame(provider, lang_code, voice_id=None) returning TTSUpdateSettingsFrame or None with provider-specific handling of voice/language inclusion.
STT provider settings and language update frames
wavefront/server/apps/call_processing/call_processing/services/stt_service.py
Refactored STT service constructors for Deepgram, Sarvam, ElevenLabs, and Azure to pass *STTSettings objects. Deepgram model/interim_results treated as settings; Sarvam/ElevenLabs language codes mapped into settings; Azure language passed via AzureSTTSettings. Added STTServiceFactory.create_language_update_frame(provider, lang_code) returning STTUpdateSettingsFrame or None for unsupported/missing mappings.
Pipecat service single-service initialization and welcome-frame queueing
wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py
Removed per-language STTLanguageSwitcher and LanguageSwitcher classes and per-language ParallelPipeline routing. Updated run_conversation() multi-language branch to instantiate single TTS and STT using default_language with voice-id lookup. Adjusted language detection tool wiring to pass provider names and voice IDs instead of switcher instances. Removed TranscriptProcessor and pre-seeded assistant welcome message; updated welcome to TTSSpeakFrame(..., append_to_context=True) on client connection.
Pipecat-ai dependency update
wavefront/server/apps/call_processing/pyproject.toml
Bumped pipecat-ai from ==0.0.103 to ==0.0.106 to enable new settings-based provider configuration and language-update frame factories.

Sequence Diagram

sequenceDiagram
    autonumber
    participant Client
    participant PipecatService as Pipecat Service
    participant LangDetectionTool as Language Detection Tool
    participant TTSFactory as TTS Factory
    participant STTFactory as STT Factory
    participant FrameQueue as Task Queue

    Client->>PipecatService: Start session (default_language)
    PipecatService->>PipecatService: Create single TTS & STT services (settings-based)
    PipecatService->>LangDetectionTool: Configure with tts_provider, stt_provider, tts_voice_ids

    Note over Client,FrameQueue: User audio received
    Client->>PipecatService: Send user audio
    PipecatService->>LangDetectionTool: Detect language
    
    LangDetectionTool->>TTSFactory: create_language_update_frame(tts_provider, lang, voice_id)
    TTSFactory-->>LangDetectionTool: TTSUpdateSettingsFrame or None
    
    LangDetectionTool->>STTFactory: create_language_update_frame(stt_provider, lang)
    STTFactory-->>LangDetectionTool: STTUpdateSettingsFrame or None
    
    LangDetectionTool->>FrameQueue: Queue non-null update frames
    LangDetectionTool->>LangDetectionTool: Mutate context.messages in-place (system role)
    
    FrameQueue->>PipecatService: Apply queued settings updates to services
    PipecatService->>Client: Respond (using updated language/voice)
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

Suggested reviewers

  • vishnurk6247

Poem

🐰 No more switcher mazes, just services so true,
Settings dance gently, each frame fresh and new,
Context whispers softly, no snapshot parade,
Language flows seamless, the refactor's well-made,
Hop along, pipecat 0.0.106! 🌟

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Title check ⚠️ Warning The title references the pipecat version upgrade from 0.0.103 to 0.0.106, which is the primary change in the pyproject.toml file but does not capture the extensive refactoring across multiple service files (language detection, TTS/STT, pipecat service) that represents the bulk of the changes and effort. Update the title to reflect the major architectural changes such as 'refactor(voice_agent): migrate pipecat 0.0.106 and replace multi-language switcher with runtime settings updates' to better represent the scope of work.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 88.24% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch CU-86d2ccen3-upgrade-pipecat-from-00103-to-00106

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py (1)

23-23: ⚠️ Potential issue | 🔴 Critical

Add missing local-smart-turn-v3 extra to pipecat-ai dependency.

The local-smart-turn-v3 extra was removed from the pyproject.toml pipecat-ai dependency (currently: pipecat-ai[websocket,cartesia,google,silero,deepgram,groq,runner,azure,sarvam,tracing]==0.0.106), but the code imports and uses LocalSmartTurnAnalyzerV3 on line 23 and line 412. This import requires the extra to be present; without it, the application will fail at runtime. Either restore the extra in the dependency or remove this usage from the code.

🤖 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 23, The project imports and uses LocalSmartTurnAnalyzerV3 (from
pipecat.audio.turn.smart_turn.local_smart_turn_v3) but the pipecat-ai dependency
no longer includes the local-smart-turn-v3 extra; restore the extra in the
pyproject.toml dependency declaration (add local-smart-turn-v3 to
pipecat-ai[...] version 0.0.106) so the import in pipecat_service.py and its
usage of LocalSmartTurnAnalyzerV3 work at runtime, or alternatively
remove/replace all uses of LocalSmartTurnAnalyzerV3 in the codebase if you
intend to drop that extra.
🧹 Nitpick comments (2)
wavefront/server/apps/call_processing/call_processing/services/tts_service.py (1)

274-277: PEP 484: Use explicit None type annotation.

The voice_id parameter uses implicit Optional which is prohibited by PEP 484 and flagged by Ruff (RUF013).

♻️ Suggested fix
     `@staticmethod`
     def create_language_update_frame(
-        provider: str, lang_code: str, voice_id: str = None
+        provider: str, lang_code: str, voice_id: str | None = None
     ):
🤖 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/tts_service.py`
around lines 274 - 277, The function create_language_update_frame has an
implicitly optional parameter voice_id which violates PEP 484/RUF013; update its
signature to annotate voice_id explicitly as Optional[str] (i.e., voice_id:
Optional[str] = None) and add or update the typing import (from typing import
Optional) at the top of the module if missing so the type is resolvable.
wavefront/server/apps/call_processing/call_processing/services/language_detection_tool.py (1)

174-176: Assumption that messages[0] is always the system message may be fragile.

The code directly assigns to current_messages[0] assuming the system message is at index 0. While this is likely true in practice given how messages are initialized in pipecat_service.py, consider adding a defensive check or comment documenting this assumption.

♻️ Suggested defensive approach
                     current_messages = context.get_messages()
-                    current_messages[0] = {'role': 'system', 'content': updated_content}
+                    # System message is always at index 0 (initialized in pipecat_service.py)
+                    if current_messages and current_messages[0].get('role') == 'system':
+                        current_messages[0] = {'role': 'system', 'content': updated_content}
+                    else:
+                        logger.warning('Expected system message at index 0, skipping prompt update')
                     context.set_messages(current_messages)
🤖 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/language_detection_tool.py`
around lines 174 - 176, The current code assumes the system message is always at
index 0 by directly writing to current_messages[0]; instead, retrieve messages
via context.get_messages(), check that a message with 'role' == 'system' exists
and update that entry (or if none exists, insert/prepend a new system message
with the updated_content), then call context.set_messages(current_messages); use
the functions/variables current_messages, context.get_messages,
context.set_messages and do not blindly overwrite messages[0].
🤖 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/language_detection_tool.py`:
- Around line 129-147: The log is misleading because
create_language_update_frame can return None; update the block around
TTSServiceFactory.create_language_update_frame and
STTServiceFactory.create_language_update_frame to record whether each frame was
actually created/queued (e.g., tts_frame_queued, stt_frame_queued booleans),
call task.queue_frame only when frame exists, and change logger.info to reflect
the real outcome (both queued, only TTS queued, only STT queued, or none queued)
and add logger.warning/error when neither frame was queued; reference the
TTSServiceFactory.create_language_update_frame,
STTServiceFactory.create_language_update_frame, task.queue_frame, logger.info,
and tts_voice_ids symbols to locate and update the logic.

---

Outside diff comments:
In
`@wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py`:
- Line 23: The project imports and uses LocalSmartTurnAnalyzerV3 (from
pipecat.audio.turn.smart_turn.local_smart_turn_v3) but the pipecat-ai dependency
no longer includes the local-smart-turn-v3 extra; restore the extra in the
pyproject.toml dependency declaration (add local-smart-turn-v3 to
pipecat-ai[...] version 0.0.106) so the import in pipecat_service.py and its
usage of LocalSmartTurnAnalyzerV3 work at runtime, or alternatively
remove/replace all uses of LocalSmartTurnAnalyzerV3 in the codebase if you
intend to drop that extra.

---

Nitpick comments:
In
`@wavefront/server/apps/call_processing/call_processing/services/language_detection_tool.py`:
- Around line 174-176: The current code assumes the system message is always at
index 0 by directly writing to current_messages[0]; instead, retrieve messages
via context.get_messages(), check that a message with 'role' == 'system' exists
and update that entry (or if none exists, insert/prepend a new system message
with the updated_content), then call context.set_messages(current_messages); use
the functions/variables current_messages, context.get_messages,
context.set_messages and do not blindly overwrite messages[0].

In
`@wavefront/server/apps/call_processing/call_processing/services/tts_service.py`:
- Around line 274-277: The function create_language_update_frame has an
implicitly optional parameter voice_id which violates PEP 484/RUF013; update its
signature to annotate voice_id explicitly as Optional[str] (i.e., voice_id:
Optional[str] = None) and add or update the typing import (from typing import
Optional) at the top of the module if missing so the type is resolvable.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: f9cdf43d-cb52-45c0-a40c-2da88a28c3f3

📥 Commits

Reviewing files that changed from the base of the PR and between 0d2e44c and 283d2e1.

⛔ Files ignored due to path filters (1)
  • wavefront/server/uv.lock is excluded by !**/*.lock
📒 Files selected for processing (5)
  • wavefront/server/apps/call_processing/call_processing/services/language_detection_tool.py
  • wavefront/server/apps/call_processing/call_processing/services/pipecat_service.py
  • wavefront/server/apps/call_processing/call_processing/services/stt_service.py
  • wavefront/server/apps/call_processing/call_processing/services/tts_service.py
  • wavefront/server/apps/call_processing/pyproject.toml

vizsatiz
vizsatiz previously approved these changes Jun 21, 2026
…o-00106

# Conflicts:
#	wavefront/server/uv.lock
@vizsatiz
vizsatiz merged commit 5dfce17 into develop Jun 22, 2026
9 checks passed
@vizsatiz
vizsatiz deleted the CU-86d2ccen3-upgrade-pipecat-from-00103-to-00106 branch June 22, 2026 10:38
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