From b8b531b66a1b9646bbde37907f7d0534701fe498 Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Wed, 18 Feb 2026 12:37:34 -0500 Subject: [PATCH] In Cartesia TTS service, we don't need to override `_update_settings`. Parent class handling is enough, as new settings are picked up on the next `run_tts` (no need to reconnect). --- .../55n-update-settings-cartesia-tts.py | 10 +++++++--- src/pipecat/services/cartesia/tts.py | 19 ------------------- 2 files changed, 7 insertions(+), 22 deletions(-) diff --git a/examples/foundational/55n-update-settings-cartesia-tts.py b/examples/foundational/55n-update-settings-cartesia-tts.py index 38070765c..303c23a25 100644 --- a/examples/foundational/55n-update-settings-cartesia-tts.py +++ b/examples/foundational/55n-update-settings-cartesia-tts.py @@ -22,7 +22,7 @@ from pipecat.processors.aggregators.llm_response_universal import ( ) from pipecat.runner.types import RunnerArguments from pipecat.runner.utils import create_transport -from pipecat.services.cartesia.tts import CartesiaTTSService, CartesiaTTSSettings +from pipecat.services.cartesia.tts import CartesiaTTSService, CartesiaTTSSettings, GenerationConfig from pipecat.services.deepgram.stt import DeepgramSTTService from pipecat.services.openai.llm import OpenAILLMService from pipecat.transports.base_transport import BaseTransport, TransportParams @@ -103,8 +103,12 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): await task.queue_frames([LLMRunFrame()]) await asyncio.sleep(10) - logger.info("Updating Cartesia TTS settings: speed=fast") - await task.queue_frame(TTSUpdateSettingsFrame(update=CartesiaTTSSettings(speed="fast"))) + logger.info("Updating Cartesia TTS settings: speed increased to 1.5") + await task.queue_frame( + TTSUpdateSettingsFrame( + update=CartesiaTTSSettings(generation_config=GenerationConfig(speed=1.5)) + ) + ) @transport.event_handler("on_client_disconnected") async def on_client_disconnected(transport, client): diff --git a/src/pipecat/services/cartesia/tts.py b/src/pipecat/services/cartesia/tts.py index edee9e2ea..4e45f50aa 100644 --- a/src/pipecat/services/cartesia/tts.py +++ b/src/pipecat/services/cartesia/tts.py @@ -355,25 +355,6 @@ class CartesiaTTSService(AudioContextWordTTSService): """ return True - async def _update_settings(self, update: TTSSettings) -> dict[str, Any]: - """Apply a settings update. - - Settings are stored but not applied to the active connection. - """ - changed = await super()._update_settings(update) - - if not changed: - return changed - - # TODO: someday we could reconnect here to apply updated settings. - # Code might look something like the below: - # await self._disconnect() - # await self._connect() - - self._warn_unhandled_updated_settings(changed) - - return changed - def language_to_service_language(self, language: Language) -> Optional[str]: """Convert a Language enum to Cartesia language format.