From a1c07039ee4ff3880b690ef8008b5a4b3d40ac49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Fri, 10 Oct 2025 20:26:47 -0700 Subject: [PATCH] frames: added finished_event to InterruptionFrame/InterruptionTaskFrame --- src/pipecat/frames/frames.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/pipecat/frames/frames.py b/src/pipecat/frames/frames.py index 5db02c856..53b8dba0c 100644 --- a/src/pipecat/frames/frames.py +++ b/src/pipecat/frames/frames.py @@ -11,6 +11,7 @@ including data frames, system frames, and control frames for audio, video, text, and LLM processing. """ +import asyncio from dataclasses import dataclass, field from typing import ( TYPE_CHECKING, @@ -859,9 +860,13 @@ class InterruptionFrame(SystemFrame): speaking (i.e. is interrupting). This is similar to UserStartedSpeakingFrame except that it should be pushed concurrently with other frames (so the order is not guaranteed). + + Parameters: + wait_event: If not None, the event will be set when the frame + reaches the end of the pipeline. """ - pass + finished_event: Optional[asyncio.Event] = None @dataclass @@ -1422,9 +1427,13 @@ class InterruptionTaskFrame(TaskFrame): same actions as if the user interrupted except that the UserStartedSpeakingFrame and UserStoppedSpeakingFrame won't be generated. This frame should be pushed upstream. + + Parameters: + finished_event: If not None, the event will be set when the generated + InterruptionFrame reaches the end of the pipeline. """ - pass + finished_event: Optional[asyncio.Event] = None @dataclass