From abf34bcccfab15d329dca5c46c05539aa3cb76de Mon Sep 17 00:00:00 2001 From: Roshan Date: Wed, 29 Oct 2025 18:29:51 -0700 Subject: [PATCH] address pr comments --- CHANGELOG.md | 2 +- src/pipecat/services/cartesia/tts.py | 10 ++++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7c6928867..daeae5d61 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added `generation_config` parameter support to `CartesiaTTSService` and `CartesiaHttpTTSService` for Cartesia Sonic-3 models. Includes a new - `GenerationConfig` dataclass with `volume` (0.5-2.0), `speed` (0.6-1.5), + `GenerationConfig` class with `volume` (0.5-2.0), `speed` (0.6-1.5), and `emotion` (60+ options) parameters for fine-grained speech generation control. diff --git a/src/pipecat/services/cartesia/tts.py b/src/pipecat/services/cartesia/tts.py index 4e785a374..c2185a355 100644 --- a/src/pipecat/services/cartesia/tts.py +++ b/src/pipecat/services/cartesia/tts.py @@ -126,6 +126,7 @@ class CartesiaTTSService(AudioContextWordTTSService): .. deprecated:: 0.0.68 The `emotion` parameter is deprecated and will be removed in a future version. + generation_config: Generation configuration for Sonic-3 models. Includes volume, speed (numeric), and emotion (string) parameters. """ @@ -322,7 +323,9 @@ class CartesiaTTSService(AudioContextWordTTSService): msg["speed"] = self._settings["speed"] if self._settings["generation_config"]: - msg["generation_config"] = self._settings["generation_config"].model_dump(exclude_none=True) + msg["generation_config"] = self._settings["generation_config"].model_dump( + exclude_none=True + ) return json.dumps(msg) @@ -514,6 +517,7 @@ class CartesiaHttpTTSService(TTSService): .. deprecated:: 0.0.68 The `emotion` parameter is deprecated and will be removed in a future version. + generation_config: Generation configuration for Sonic-3 models. Includes volume, speed (numeric), and emotion (string) parameters. """ @@ -664,7 +668,9 @@ class CartesiaHttpTTSService(TTSService): payload["speed"] = self._settings["speed"] if self._settings["generation_config"]: - payload["generation_config"] = self._settings["generation_config"].model_dump(exclude_none=True) + payload["generation_config"] = self._settings["generation_config"].model_dump( + exclude_none=True + ) yield TTSStartedFrame()