From c2c02846a8745859ea48ac8b8b8a9f746f6e659b Mon Sep 17 00:00:00 2001 From: Timothy Jaeryang Baek Date: Thu, 6 Nov 2025 16:35:19 -0500 Subject: [PATCH] fix: tool calling --- backend/open_webui/utils/middleware.py | 2 +- backend/open_webui/utils/tools.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend/open_webui/utils/middleware.py b/backend/open_webui/utils/middleware.py index 80c4c460cb..e5b84a3d79 100644 --- a/backend/open_webui/utils/middleware.py +++ b/backend/open_webui/utils/middleware.py @@ -2839,7 +2839,7 @@ async def process_chat_response( ) else: - tool_function = await get_updated_tool_function( + tool_function = get_updated_tool_function( function=tool["callable"], extra_params={ "__messages__": form_data.get( diff --git a/backend/open_webui/utils/tools.py b/backend/open_webui/utils/tools.py index c1f07445ad..1d1254f184 100644 --- a/backend/open_webui/utils/tools.py +++ b/backend/open_webui/utils/tools.py @@ -91,13 +91,13 @@ def get_async_tool_function_and_apply_extra_params( return new_function -async def get_updated_tool_function(function: Callable, extra_params: dict): +def get_updated_tool_function(function: Callable, extra_params: dict): # Get the original function and merge updated params __function__ = getattr(function, "__function__", None) __extra_params__ = getattr(function, "__extra_params__", None) if __function__ is not None and __extra_params__ is not None: - return await get_async_tool_function_and_apply_extra_params( + return get_async_tool_function_and_apply_extra_params( __function__, {**__extra_params__, **extra_params}, )