From 9aea8e951c3e7a0d0392a7607e38efb12a74233c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Mon, 13 May 2024 17:56:19 -0700 Subject: [PATCH] aggregators/sentence: ignore interim transcriptions --- src/pipecat/processors/aggregators/sentence.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/pipecat/processors/aggregators/sentence.py b/src/pipecat/processors/aggregators/sentence.py index 266c11e69..3f323bbb5 100644 --- a/src/pipecat/processors/aggregators/sentence.py +++ b/src/pipecat/processors/aggregators/sentence.py @@ -6,9 +6,7 @@ import re -from typing import List - -from pipecat.frames.frames import EndFrame, Frame, TextFrame +from pipecat.frames.frames import EndFrame, Frame, InterimTranscriptionFrame, TextFrame from pipecat.processors.frame_processor import FrameDirection, FrameProcessor @@ -35,6 +33,10 @@ class SentenceAggregator(FrameProcessor): self._aggregation = "" async def process_frame(self, frame: Frame, direction: FrameDirection): + # We ignore interim description at this point. + if isinstance(frame, InterimTranscriptionFrame): + return + if isinstance(frame, TextFrame): m = re.search("(.*[?.!])(.*)", frame.text) if m: