From 4bfa084f7769fb915ee5d6620bc47a9eeecaf3b9 Mon Sep 17 00:00:00 2001 From: filipi87 Date: Tue, 31 Mar 2026 17:37:39 -0300 Subject: [PATCH] Updating the openai example to be async. --- examples/function-calling/openai.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/examples/function-calling/openai.py b/examples/function-calling/openai.py index 2b59d7072..82e72dca0 100644 --- a/examples/function-calling/openai.py +++ b/examples/function-calling/openai.py @@ -88,7 +88,9 @@ async def run_bot(transport: BaseTransport, runner_args: RunnerArguments): # You can also register a function_name of None to get all functions # sent to the same callback with an additional function_name parameter. - llm.register_function("get_current_weather", fetch_weather_from_api) + llm.register_function( + "get_current_weather", fetch_weather_from_api, cancel_on_interruption=False, is_async=True + ) llm.register_function("get_restaurant_recommendation", fetch_restaurant_recommendation) @llm.event_handler("on_function_calls_started")