diff --git a/src/pipecat/frames/frames.py b/src/pipecat/frames/frames.py index be3b4e4a7..0e9127130 100644 --- a/src/pipecat/frames/frames.py +++ b/src/pipecat/frames/frames.py @@ -2117,7 +2117,11 @@ class ServiceUpdateSettingsFrame(ControlFrame): ``update`` object. When both are provided, ``update`` takes precedence. Parameters: - settings: Dictionary of setting name to value mappings (legacy). + settings: Dictionary of setting name to value mappings. + + .. deprecated:: 0.0.103 + Use ``update`` with a typed settings object instead. + update: :class:`~pipecat.services.settings.ServiceSettings` object describing the delta to apply. """ diff --git a/src/pipecat/services/llm_service.py b/src/pipecat/services/llm_service.py index 860a472c9..83d60defb 100644 --- a/src/pipecat/services/llm_service.py +++ b/src/pipecat/services/llm_service.py @@ -354,6 +354,14 @@ class LLMService(UserTurnCompletionLLMServiceMixin, AIService): await self._update_settings(frame.update) elif frame.settings: # Backward-compatible path: convert legacy dict to settings object. + with warnings.catch_warnings(): + warnings.simplefilter("always") + warnings.warn( + "Passing a dict via LLMUpdateSettingsFrame(settings={...}) is deprecated " + "since 0.0.103, use LLMUpdateSettingsFrame(update=LLMSettings(...)) instead.", + DeprecationWarning, + stacklevel=2, + ) update = type(self._settings).from_mapping(frame.settings) await self._update_settings(update) elif isinstance(frame, LLMContextSummaryRequestFrame): diff --git a/src/pipecat/services/stt_service.py b/src/pipecat/services/stt_service.py index ae04ed33f..fdcefcbd5 100644 --- a/src/pipecat/services/stt_service.py +++ b/src/pipecat/services/stt_service.py @@ -336,6 +336,14 @@ class STTService(AIService): await self._update_settings(frame.update) elif frame.settings: # Backward-compatible path: convert legacy dict to settings object. + with warnings.catch_warnings(): + warnings.simplefilter("always") + warnings.warn( + "Passing a dict via STTUpdateSettingsFrame(settings={...}) is deprecated " + "since 0.0.103, use STTUpdateSettingsFrame(update=STTSettings(...)) instead.", + DeprecationWarning, + stacklevel=2, + ) update = type(self._settings).from_mapping(frame.settings) await self._update_settings(update) elif isinstance(frame, STTMuteFrame): diff --git a/src/pipecat/services/tts_service.py b/src/pipecat/services/tts_service.py index 4b4b47a50..996a780ed 100644 --- a/src/pipecat/services/tts_service.py +++ b/src/pipecat/services/tts_service.py @@ -546,6 +546,14 @@ class TTSService(AIService): await self._update_settings(frame.update) elif frame.settings: # Backward-compatible path: convert legacy dict to settings object. + with warnings.catch_warnings(): + warnings.simplefilter("always") + warnings.warn( + "Passing a dict via TTSUpdateSettingsFrame(settings={...}) is deprecated " + "since 0.0.103, use TTSUpdateSettingsFrame(update=TTSSettings(...)) instead.", + DeprecationWarning, + stacklevel=2, + ) update = type(self._settings).from_mapping(frame.settings) await self._update_settings(update) elif isinstance(frame, BotStoppedSpeakingFrame):