mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 20:35:19 +00:00
fix: tool calling
This commit is contained in:
parent
4754108253
commit
c2c02846a8
2 changed files with 3 additions and 3 deletions
|
|
@ -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(
|
||||
|
|
|
|||
|
|
@ -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},
|
||||
)
|
||||
|
|
|
|||
Loading…
Reference in a new issue