From 3a7ea25077acfafa7a7123a690d8ced71d2e242b Mon Sep 17 00:00:00 2001 From: Designedforusers Date: Sat, 2 Aug 2025 05:56:46 -0400 Subject: [PATCH] fix: Add missing transcription callbacks to TavusTransport for 0.0.77 compatibility TavusTransport was broken in Pipecat 0.0.77 due to PR #2292 adding required callbacks (on_transcription_stopped, on_transcription_error) to DailyCallbacks. This fix adds placeholder implementations of these callbacks to TavusTransportClient, allowing TavusTransport to initialize properly. These callbacks are not used by Tavus (which handles avatar video, not transcription) but are required by the DailyCallbacks validation. Fixes initialization error: - 2 validation errors for DailyCallbacks - on_transcription_stopped: Field required - on_transcription_error: Field required --- src/pipecat/transports/services/tavus.py | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/pipecat/transports/services/tavus.py b/src/pipecat/transports/services/tavus.py index 10ae001e0..4d4eec7f0 100644 --- a/src/pipecat/transports/services/tavus.py +++ b/src/pipecat/transports/services/tavus.py @@ -245,6 +245,8 @@ class TavusTransportClient: on_recording_started=partial(self._on_handle_callback, "on_recording_started"), on_recording_stopped=partial(self._on_handle_callback, "on_recording_stopped"), on_recording_error=partial(self._on_handle_callback, "on_recording_error"), + on_transcription_stopped=self._on_transcription_stopped, + on_transcription_error=self._on_transcription_error, ) self._client = DailyTransportClient( room_url, None, "Pipecat", self._params, daily_callbacks, self._bot_name @@ -274,6 +276,20 @@ class TavusTransportClient: """Handle generic callback events.""" logger.trace(f"[Callback] {event_name} called with args={args}, kwargs={kwargs}") + async def _on_transcription_stopped(self, stopped_by: str, stopped_by_error: bool): + """ + Placeholder for transcription stopped callback. + Required by DailyCallbacks in Pipecat 0.0.77+ but not used by Tavus. + """ + pass + + async def _on_transcription_error(self, message: str): + """ + Placeholder for transcription error callback. + Required by DailyCallbacks in Pipecat 0.0.77+ but not used by Tavus. + """ + pass + async def get_persona_name(self) -> str: """Get the persona name from the API.