From 31f7082d12bad371c00470001a8c3bd8b3e8ef50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Wed, 16 Apr 2025 12:02:11 -0700 Subject: [PATCH] DeepgramTTSService: use Deepgram's asyncrest instead of asyncio.to_thread --- src/pipecat/services/deepgram/tts.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pipecat/services/deepgram/tts.py b/src/pipecat/services/deepgram/tts.py index 95e08e7af..0b32370a1 100644 --- a/src/pipecat/services/deepgram/tts.py +++ b/src/pipecat/services/deepgram/tts.py @@ -4,7 +4,6 @@ # SPDX-License-Identifier: BSD 2-Clause License # -import asyncio from typing import AsyncGenerator, Optional from loguru import logger @@ -60,8 +59,8 @@ class DeepgramTTSService(TTSService): try: await self.start_ttfb_metrics() - response = await asyncio.to_thread( - self._deepgram_client.speak.v("1").stream, {"text": text}, options + response = await self._deepgram_client.speak.asyncrest.v("1").stream_memory( + {"text": text}, options ) await self.start_tts_usage_metrics(text)