Merge pull request #2474 from pipecat-ai/mb/add-frames-pipeline-idle

Add UserStarted/StoppedSpeakingFrames to idle_timeout_frames
This commit is contained in:
Mark Backman
2025-08-21 03:45:46 -07:00
committed by GitHub
2 changed files with 13 additions and 0 deletions

View File

@@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
### Added ### Added
- Added new frames to the `idle_timeout_frames` arg: `TranscriptionFrame`,
`InterimTranscriptionFrame`, `UserStartedSpeakingFrame`, and
`UserStoppedSpeakingFrame`. These additions serve as indicators of user
activity in the pipeline idle detection logic.
- Allow passing custom pipeline sink and source processors to a - Allow passing custom pipeline sink and source processors to a
`Pipeline`. Pipeline source and sink processors are used to know and control `Pipeline`. Pipeline source and sink processors are used to know and control
what's coming in and out of a `Pipeline` processor. what's coming in and out of a `Pipeline` processor.

View File

@@ -32,11 +32,15 @@ from pipecat.frames.frames import (
Frame, Frame,
HeartbeatFrame, HeartbeatFrame,
InputAudioRawFrame, InputAudioRawFrame,
InterimTranscriptionFrame,
LLMFullResponseEndFrame, LLMFullResponseEndFrame,
MetricsFrame, MetricsFrame,
StartFrame, StartFrame,
StopFrame, StopFrame,
StopTaskFrame, StopTaskFrame,
TranscriptionFrame,
UserStartedSpeakingFrame,
UserStoppedSpeakingFrame,
) )
from pipecat.metrics.metrics import ProcessingMetricsData, TTFBMetricsData from pipecat.metrics.metrics import ProcessingMetricsData, TTFBMetricsData
from pipecat.observers.base_observer import BaseObserver from pipecat.observers.base_observer import BaseObserver
@@ -146,7 +150,11 @@ class PipelineTask(BasePipelineTask):
enable_watchdog_timers: bool = False, enable_watchdog_timers: bool = False,
idle_timeout_frames: Tuple[Type[Frame], ...] = ( idle_timeout_frames: Tuple[Type[Frame], ...] = (
BotSpeakingFrame, BotSpeakingFrame,
InterimTranscriptionFrame,
LLMFullResponseEndFrame, LLMFullResponseEndFrame,
TranscriptionFrame,
UserStartedSpeakingFrame,
UserStoppedSpeakingFrame,
), ),
idle_timeout_secs: Optional[float] = 300, idle_timeout_secs: Optional[float] = 300,
observers: Optional[List[BaseObserver]] = None, observers: Optional[List[BaseObserver]] = None,