From 71cf94e936e551ebbb43f6c790f14b6779f4dbff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Mon, 2 Dec 2024 09:55:17 -0800 Subject: [PATCH] transports(daily): warn if transcription enabled but no token provided --- src/pipecat/transports/services/daily.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/pipecat/transports/services/daily.py b/src/pipecat/transports/services/daily.py index 4a8bcfb14..7663bf5de 100644 --- a/src/pipecat/transports/services/daily.py +++ b/src/pipecat/transports/services/daily.py @@ -328,7 +328,7 @@ class DailyTransportClient(EventHandler): logger.info(f"Joined {self._room_url}") - if self._token and self._params.transcription_enabled: + if self._params.transcription_enabled: await self._start_transcription() await self._callbacks.on_joined(data) @@ -342,6 +342,10 @@ class DailyTransportClient(EventHandler): await self._callbacks.on_error(error_msg) async def _start_transcription(self): + if not self._token: + logger.warning(f"Transcription can't be started without a room token") + return + logger.info(f"Enabling transcription with settings {self._params.transcription_settings}") future = self._loop.create_future() @@ -436,6 +440,8 @@ class DailyTransportClient(EventHandler): await self._callbacks.on_error(error_msg) async def _stop_transcription(self): + if not self._token: + return future = self._loop.create_future() self._client.stop_transcription(completion=completion_callback(future)) error = await future