From 7e31b2a795bd3be3ad97339bbd01be382afb29cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Thu, 25 Jul 2024 14:47:56 -0700 Subject: [PATCH] processors(user_idle): use user speaking instead of interruption frames --- src/pipecat/processors/user_idle_processor.py | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/pipecat/processors/user_idle_processor.py b/src/pipecat/processors/user_idle_processor.py index 20e8e7be6..7deda2555 100644 --- a/src/pipecat/processors/user_idle_processor.py +++ b/src/pipecat/processors/user_idle_processor.py @@ -8,7 +8,12 @@ import asyncio from typing import Awaitable, Callable -from pipecat.frames.frames import BotSpeakingFrame, Frame, StartInterruptionFrame, StopInterruptionFrame, SystemFrame +from pipecat.frames.frames import ( + BotSpeakingFrame, + Frame, + SystemFrame, + UserStartedSpeakingFrame, + UserStoppedSpeakingFrame) from pipecat.processors.async_frame_processor import AsyncFrameProcessor from pipecat.processors.frame_processor import FrameDirection @@ -47,10 +52,10 @@ class UserIdleProcessor(AsyncFrameProcessor): await self.queue_frame(frame, direction) # We shouldn't call the idle callback if the user or the bot are speaking. - if isinstance(frame, StartInterruptionFrame): + if isinstance(frame, UserStartedSpeakingFrame): self._interrupted = True self._idle_event.set() - elif isinstance(frame, StopInterruptionFrame): + elif isinstance(frame, UserStoppedSpeakingFrame): self._interrupted = False self._idle_event.set() elif isinstance(frame, BotSpeakingFrame):