From 1455e24ad1aafbe95e1bfbb25a1b64ace87c02fe Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Sun, 9 Feb 2025 08:29:20 -0500 Subject: [PATCH] Add keyword args, collocated warnings import with the deprecation --- src/pipecat/processors/filters/stt_mute_filter.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/pipecat/processors/filters/stt_mute_filter.py b/src/pipecat/processors/filters/stt_mute_filter.py index 713b87c5e..b19849fd7 100644 --- a/src/pipecat/processors/filters/stt_mute_filter.py +++ b/src/pipecat/processors/filters/stt_mute_filter.py @@ -11,7 +11,6 @@ such as during function calls, bot speech, or custom conditions. It helps manage the STT service should be active or inactive during a conversation. """ -import warnings from dataclasses import dataclass from enum import Enum from typing import Awaitable, Callable, Optional @@ -77,10 +76,14 @@ class STTMuteFilter(FrameProcessor): **kwargs: Additional arguments passed to parent class """ - def __init__(self, config: STTMuteConfig, stt_service: Optional[STTService] = None, **kwargs): + def __init__( + self, *, config: STTMuteConfig, stt_service: Optional[STTService] = None, **kwargs + ): super().__init__(**kwargs) self._config = config if stt_service is not None: + import warnings + warnings.warn( "The stt_service parameter is deprecated and will be removed in a future version. " "STTMuteFilter now manages mute state internally.",