From 81282f9c4d62746e00153b5e1080d9b20fa9316c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Tue, 11 Jun 2024 22:52:28 -0700 Subject: [PATCH] services(deepgram): keep conenction alive --- src/pipecat/services/deepgram.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pipecat/services/deepgram.py b/src/pipecat/services/deepgram.py index 1c3b890ee..6584775cb 100644 --- a/src/pipecat/services/deepgram.py +++ b/src/pipecat/services/deepgram.py @@ -25,6 +25,7 @@ from pipecat.services.ai_services import AIService, TTSService from deepgram import ( DeepgramClient, + DeepgramClientOptions, LiveTranscriptionEvents, LiveOptions, ) @@ -92,7 +93,8 @@ class DeepgramSTTService(AIService): self._live_options = live_options - self._client = DeepgramClient(api_key) + self._client = DeepgramClient( + api_key, config=DeepgramClientOptions(options={"keepalive": "true"})) self._connection = self._client.listen.asynclive.v("1") self._connection.on(LiveTranscriptionEvents.Transcript, self._on_message)