From 677f69971cd4d72656834e40d45f4a460113ef9b Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Tue, 23 Sep 2025 16:14:36 -0400 Subject: [PATCH] Add filters in 22b and 22c examples to prevent function call results triggering the "statement judge" LLM from running unnecessarily, and with the wrong system prompt, which would result in garbled output statements comprised of both LLMs outputs combined --- examples/foundational/22b-natural-conversation-proposal.py | 4 ++++ examples/foundational/22c-natural-conversation-mixed-llms.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/examples/foundational/22b-natural-conversation-proposal.py b/examples/foundational/22b-natural-conversation-proposal.py index 290f6624c..a520d17be 100644 --- a/examples/foundational/22b-natural-conversation-proposal.py +++ b/examples/foundational/22b-natural-conversation-proposal.py @@ -237,6 +237,9 @@ class TurnDetectionLLM(Pipeline): or isinstance(frame, FunctionCallResultFrame) ) + async def filter_all(frame): + return False + super().__init__( [ ParallelPipeline( @@ -247,6 +250,7 @@ class TurnDetectionLLM(Pipeline): statement_judge_context_filter, statement_llm, completeness_check, + FunctionFilter(filter=filter_all, direction=FrameDirection.UPSTREAM), ], [ # Block everything except frames that trigger LLM inference. diff --git a/examples/foundational/22c-natural-conversation-mixed-llms.py b/examples/foundational/22c-natural-conversation-mixed-llms.py index 83c153f80..80811c2e7 100644 --- a/examples/foundational/22c-natural-conversation-mixed-llms.py +++ b/examples/foundational/22c-natural-conversation-mixed-llms.py @@ -431,6 +431,9 @@ class TurnDetectionLLM(Pipeline): or isinstance(frame, FunctionCallResultFrame) ) + async def filter_all(frame): + return False + super().__init__( [ ParallelPipeline( @@ -446,6 +449,7 @@ class TurnDetectionLLM(Pipeline): statement_judge_context_filter, statement_llm, completeness_check, + FunctionFilter(filter=filter_all, direction=FrameDirection.UPSTREAM), ], [ # Block everything except frames that trigger LLM inference.