From 1af123f9d0d2b563b9a7a6ed45c30324a0b9ffeb Mon Sep 17 00:00:00 2001 From: James Hush Date: Mon, 21 Apr 2025 16:23:23 +0800 Subject: [PATCH] Save --- examples/foundational/99-content-moderation.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/foundational/99-content-moderation.py b/examples/foundational/99-content-moderation.py index 210840b8f..37b4a40a2 100644 --- a/examples/foundational/99-content-moderation.py +++ b/examples/foundational/99-content-moderation.py @@ -10,7 +10,7 @@ from dotenv import load_dotenv from loguru import logger from pipecat.audio.vad.silero import SileroVADAnalyzer -from pipecat.frames.frames import EndFrame, EndTaskFrame, TextFrame, TTSSpeakFrame +from pipecat.frames.frames import EndFrame, EndTaskFrame, Frame, TextFrame, TTSSpeakFrame from pipecat.pipeline.parallel_pipeline import ParallelPipeline from pipecat.pipeline.pipeline import Pipeline from pipecat.pipeline.runner import PipelineRunner @@ -45,7 +45,7 @@ class KickParticipantProcessor(FrameProcessor): """Initialize the processor.""" super().__init__() - async def process_frame(self, frame, direction): + async def process_frame(self, frame: Frame, direction: FrameDirection): await super().process_frame(frame, direction) if isinstance(frame, TextFrame) and frame.text == "YES": @@ -57,8 +57,8 @@ class KickParticipantProcessor(FrameProcessor): # Signal that the task should end after processing this frame await self.push_frame(EndTaskFrame(), FrameDirection.UPSTREAM) - - await self.push_frame(frame, direction) + else: + await self.push_frame(frame, direction) async def run_bot(webrtc_connection: SmallWebRTCConnection): @@ -162,7 +162,7 @@ community guidelines. moderator_context_aggregator.user(), moderator_llm, kick_participant, - completeness_check, + # completeness_check, NullFilter(), ], [context_aggregator.user(), gated_context_aggregator, llm],