diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c734120f..538b01f1e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -89,6 +89,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Upgraded `deepgram-sdk` to 4.1.0. + - Updated `GoogleTTSService` to use Google's streaming TTS API. The default voice also updated to `en-US-Chirp3-HD-Charon`. @@ -145,6 +147,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed a `DeegramSTTService` connection issue when the user provided their own + `LiveOptions`. + - Fixed a `DailyTransport` issue that would cause images needing resize to block the event loop. diff --git a/pyproject.toml b/pyproject.toml index 7452ca1cd..a2e50906d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -48,7 +48,7 @@ cartesia = [ "cartesia~=2.0.3", "websockets~=13.1" ] cerebras = [] deepseek = [] daily = [ "daily-python~=0.19.0" ] -deepgram = [ "deepgram-sdk~=3.8.0" ] +deepgram = [ "deepgram-sdk~=4.1.0" ] elevenlabs = [ "websockets~=13.1" ] fal = [ "fal-client~=0.5.9" ] fireworks = [] diff --git a/src/pipecat/services/deepgram/stt.py b/src/pipecat/services/deepgram/stt.py index 07cc6a9d2..a223da143 100644 --- a/src/pipecat/services/deepgram/stt.py +++ b/src/pipecat/services/deepgram/stt.py @@ -78,17 +78,19 @@ class DeepgramSTTService(STTService): vad_events=False, ) - merged_options = default_options + merged_options = default_options.to_dict() if live_options: - merged_options = LiveOptions(**{**default_options.to_dict(), **live_options.to_dict()}) + default_model = default_options.model + merged_options.update(live_options.to_dict()) + # NOTE(aleix): Fixes an in deepgram-sdk where `model` is initialized + # to the string "None" instead of the value `None`. + if "model" in merged_options and merged_options["model"] == "None": + merged_options["model"] = default_model - # deepgram connection requires language to be a string - if isinstance(merged_options.language, Language) and hasattr( - merged_options.language, "value" - ): - merged_options.language = merged_options.language.value + if "language" in merged_options and isinstance(merged_options["language"], Language): + merged_options["language"] = merged_options["language"].value - self._settings = merged_options.to_dict() + self._settings = merged_options self._addons = addons self._client = DeepgramClient(