diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c1e1cbc0..391f60607 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 `RimeHttpTTSService` and the `07q-interruptible-rime.py` foundational example. -- Added `STTMuteProcessor`, a general-purpose processor that combines STT +- Added `STTMuteFilter`, a general-purpose processor that combines STT muting and interruption control. When active, it prevents both transcription and interruptions during bot speech. The processor supports multiple strategies: `FIRST_SPEECH` (mute only during bot's first diff --git a/examples/foundational/24-stt-mute-processor.py b/examples/foundational/24-stt-mute-filter.py similarity index 95% rename from examples/foundational/24-stt-mute-processor.py rename to examples/foundational/24-stt-mute-filter.py index 4259a9558..d57986141 100644 --- a/examples/foundational/24-stt-mute-processor.py +++ b/examples/foundational/24-stt-mute-filter.py @@ -21,7 +21,7 @@ from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner from pipecat.pipeline.task import PipelineParams, PipelineTask from pipecat.processors.aggregators.openai_llm_context import OpenAILLMContext -from pipecat.processors.filters.stt_mute import STTMuteConfig, STTMuteProcessor, STTMuteStrategy +from pipecat.processors.filters.stt_mute_filter import STTMuteConfig, STTMuteFilter, STTMuteStrategy from pipecat.services.deepgram import DeepgramSTTService, DeepgramTTSService from pipecat.services.openai import OpenAILLMService from pipecat.transports.services.daily import DailyParams, DailyTransport @@ -50,7 +50,7 @@ async def main(): stt = DeepgramSTTService(api_key=os.getenv("DEEPGRAM_API_KEY")) # Configure the mute processor to mute only during first speech - stt_mute_processor = STTMuteProcessor( + stt_mute_processor = STTMuteFilter( stt_service=stt, config=STTMuteConfig(strategy=STTMuteStrategy.FIRST_SPEECH) ) diff --git a/src/pipecat/processors/filters/stt_mute.py b/src/pipecat/processors/filters/stt_mute_filter.py similarity index 95% rename from src/pipecat/processors/filters/stt_mute.py rename to src/pipecat/processors/filters/stt_mute_filter.py index 60315094b..9ee216c7f 100644 --- a/src/pipecat/processors/filters/stt_mute.py +++ b/src/pipecat/processors/filters/stt_mute_filter.py @@ -32,14 +32,14 @@ class STTMuteStrategy(Enum): @dataclass class STTMuteConfig: - """Configuration for STTMuteProcessor""" + """Configuration for STTMuteFilter""" strategy: STTMuteStrategy # Optional callback for custom muting logic - should_mute_callback: Optional[Callable[["STTMuteProcessor"], Awaitable[bool]]] = None + should_mute_callback: Optional[Callable[["STTMuteFilter"], Awaitable[bool]]] = None -class STTMuteProcessor(FrameProcessor): +class STTMuteFilter(FrameProcessor): """A general-purpose processor that handles STT muting and interruption control. This processor combines the concepts of STT muting and interruption control,