From cb13f4b4cb2c80ef388bc3a6b392b76a52b6a0e2 Mon Sep 17 00:00:00 2001 From: Mark Backman Date: Tue, 19 Aug 2025 21:34:24 -0400 Subject: [PATCH] Add user speaking and transcription frames to idle_timeout_frames --- CHANGELOG.md | 5 +++++ src/pipecat/pipeline/task.py | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8e13653b4..73285e07c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### 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 `Pipeline`. Pipeline source and sink processors are used to know and control what's coming in and out of a `Pipeline` processor. diff --git a/src/pipecat/pipeline/task.py b/src/pipecat/pipeline/task.py index 7ff924531..9b3586ea8 100644 --- a/src/pipecat/pipeline/task.py +++ b/src/pipecat/pipeline/task.py @@ -32,11 +32,15 @@ from pipecat.frames.frames import ( Frame, HeartbeatFrame, InputAudioRawFrame, + InterimTranscriptionFrame, LLMFullResponseEndFrame, MetricsFrame, StartFrame, StopFrame, StopTaskFrame, + TranscriptionFrame, + UserStartedSpeakingFrame, + UserStoppedSpeakingFrame, ) from pipecat.metrics.metrics import ProcessingMetricsData, TTFBMetricsData from pipecat.observers.base_observer import BaseObserver @@ -146,7 +150,11 @@ class PipelineTask(BasePipelineTask): enable_watchdog_timers: bool = False, idle_timeout_frames: Tuple[Type[Frame], ...] = ( BotSpeakingFrame, + InterimTranscriptionFrame, LLMFullResponseEndFrame, + TranscriptionFrame, + UserStartedSpeakingFrame, + UserStoppedSpeakingFrame, ), idle_timeout_secs: Optional[float] = 300, observers: Optional[List[BaseObserver]] = None,