Updating the openai example to be async.
This commit is contained in:
@@ -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
|
# You can also register a function_name of None to get all functions
|
||||||
# sent to the same callback with an additional function_name parameter.
|
# 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.register_function("get_restaurant_recommendation", fetch_restaurant_recommendation)
|
||||||
|
|
||||||
@llm.event_handler("on_function_calls_started")
|
@llm.event_handler("on_function_calls_started")
|
||||||
|
|||||||
Reference in New Issue
Block a user