Change STTMuteProcessor to STTMuteFilter
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
)
|
||||
|
||||
@@ -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,
|
||||
Reference in New Issue
Block a user