From 2dbd17da4df3b3ef794f4830b4b444c61e9ca767 Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Tue, 2 Sep 2025 12:20:40 -0400 Subject: [PATCH] Fix Cerebras function calling example --- examples/foundational/14k-function-calling-cerebras.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/examples/foundational/14k-function-calling-cerebras.py b/examples/foundational/14k-function-calling-cerebras.py index b96a979c5..bb89893b9 100644 --- a/examples/foundational/14k-function-calling-cerebras.py +++ b/examples/foundational/14k-function-calling-cerebras.py @@ -72,9 +72,13 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # sent to the same callback with an additional function_name parameter. llm.register_function("get_current_weather", fetch_weather_from_api) - @llm.event_handler("on_function_calls_started") - async def on_function_calls_started(service, function_calls): - await tts.queue_frame(TTSSpeakFrame("Let me check on that.")) + # Disabling for now, as we end up in an infinite inference loop with the + # model in this example ("let me check on that" ends up at the end of the + # context, which the model erroneously treats as a nudge to call the tool + # again). + # @llm.event_handler("on_function_calls_started") + # async def on_function_calls_started(service, function_calls): + # await tts.queue_frame(TTSSpeakFrame("Let me check on that.")) weather_function = FunctionSchema( name="get_current_weather",