From c8c13ecee265661d01f2a520ec29c4f48d6f5beb Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Wed, 5 Nov 2025 21:42:15 -0500 Subject: [PATCH] fix: DeepgramSTTService await is_connected() --- CHANGELOG.md | 3 +++ src/pipecat/services/deepgram/stt.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e69e74b45..c7d7c5d97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -72,6 +72,9 @@ reason")`. ### Fixed +- Fixed `DeepgramSTTService._disconnect()` to properly await `is_connected()` + method call, which is an async coroutine in the Deepgram SDK. + - Fixed an issue where the `SmallWebRTCRequest` dataclass in runner would scrub arbitrary request data from client due to camelCase typing. This fixes data passthrough for JS clients where `APIRequest` is used. diff --git a/src/pipecat/services/deepgram/stt.py b/src/pipecat/services/deepgram/stt.py index fb5f67029..6b1ea2f21 100644 --- a/src/pipecat/services/deepgram/stt.py +++ b/src/pipecat/services/deepgram/stt.py @@ -236,7 +236,7 @@ class DeepgramSTTService(STTService): logger.error(f"{self}: unable to connect to Deepgram") async def _disconnect(self): - if self._connection.is_connected: + if await self._connection.is_connected(): logger.debug("Disconnecting from Deepgram") # Deepgram swallows asyncio.CancelledError internally which prevents # proper cancellation propagation. This issue was found with