diff --git a/engine/text_input.py b/engine/text_input.py index c205468..f9b5c4e 100644 --- a/engine/text_input.py +++ b/engine/text_input.py @@ -2,7 +2,13 @@ from __future__ import annotations from loguru import logger -from pipecat.frames.frames import Frame, InputTransportMessageFrame, LLMMessagesAppendFrame +from pipecat.frames.frames import ( + Frame, + InputTransportMessageFrame, + LLMMessagesAppendFrame, + UserStartedSpeakingFrame, + UserStoppedSpeakingFrame, +) from pipecat.processors.frame_processor import FrameDirection, FrameProcessor @@ -25,6 +31,8 @@ class ProductTextInputProcessor(FrameProcessor): if not text: return + await self.broadcast_frame(UserStartedSpeakingFrame) + if message.get("interrupt", True): logger.info("Text input interrupting current response") await self.broadcast_interruption() @@ -36,4 +44,4 @@ class ProductTextInputProcessor(FrameProcessor): ), FrameDirection.DOWNSTREAM, ) - + await self.broadcast_frame(UserStoppedSpeakingFrame)