From adf414e40f0c8e47a2e143569c2cfa3d8395407e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Fri, 21 Jun 2024 16:52:28 -0700 Subject: [PATCH] services(deepgram): add url to DeepgramSTTService --- CHANGELOG.md | 3 +++ src/pipecat/services/deepgram.py | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ffd72c9f7..ff720b9e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Added +- Allow specifying a `DeepgramSTTService` url which allows using on-prem + Deepgram. + - Added new `FastAPIWebsocketTransport`. This is a new websocket transport that can be integrated with FastAPI websockets. diff --git a/src/pipecat/services/deepgram.py b/src/pipecat/services/deepgram.py index 3a76574ad..c9a87ea14 100644 --- a/src/pipecat/services/deepgram.py +++ b/src/pipecat/services/deepgram.py @@ -89,6 +89,7 @@ class DeepgramTTSService(TTSService): class DeepgramSTTService(AIService): def __init__(self, api_key: str, + url: str = "", live_options: LiveOptions = LiveOptions( encoding="linear16", language="en-US", @@ -104,7 +105,7 @@ class DeepgramSTTService(AIService): self._live_options = live_options self._client = DeepgramClient( - api_key, config=DeepgramClientOptions(options={"keepalive": "true"})) + api_key, config=DeepgramClientOptions(url=url, options={"keepalive": "true"})) self._connection = self._client.listen.asynclive.v("1") self._connection.on(LiveTranscriptionEvents.Transcript, self._on_message)