From 8f15980c674f69d1349936b085b365b8f0a815b6 Mon Sep 17 00:00:00 2001 From: Paul Kompfner Date: Wed, 29 Oct 2025 16:23:50 -0400 Subject: [PATCH] Get rid of unnecessary new task in example file --- examples/foundational/19-openai-realtime.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/examples/foundational/19-openai-realtime.py b/examples/foundational/19-openai-realtime.py index 4604fbd02..6907ec196 100644 --- a/examples/foundational/19-openai-realtime.py +++ b/examples/foundational/19-openai-realtime.py @@ -223,15 +223,11 @@ Remember, your responses should be short. Just one or two sentences, usually. Re await task.queue_frames([LLMRunFrame()]) # Add a new tool at runtime after a delay. - async def set_tools_after_delay(): - await asyncio.sleep(15) - new_tools = ToolsSchema( - standard_tools=[weather_function, restaurant_function, get_news_function] - ) - logger.info("Registering new tool with LLMSetToolsFrame") - await task.queue_frames([LLMSetToolsFrame(tools=new_tools)]) - - asyncio.create_task(set_tools_after_delay()) + await asyncio.sleep(15) + new_tools = ToolsSchema( + standard_tools=[weather_function, restaurant_function, get_news_function] + ) + await task.queue_frames([LLMSetToolsFrame(tools=new_tools)]) @transport.event_handler("on_client_disconnected") async def on_client_disconnected(transport, client):