enh/fix: update extra params for native function calling

Co-Authored-By: Jacob Leksan <63938553+jmleksan@users.noreply.github.com>
This commit is contained in:
Timothy Jaeryang Baek
2025-11-05 23:46:30 -05:00
parent 1aa285edb9
commit f5c7152a6b
2 changed files with 28 additions and 2 deletions

View File

@@ -91,7 +91,7 @@ from open_webui.utils.misc import (
convert_logit_bias_input_to_json,
get_content_from_message,
)
from open_webui.utils.tools import get_tools
from open_webui.utils.tools import get_tools, get_updated_tool_function
from open_webui.utils.plugin import load_function_module_by_id
from open_webui.utils.filter import (
get_sorted_filter_ids,
@@ -2838,7 +2838,16 @@ async def process_chat_response(
)
else:
tool_function = tool["callable"]
tool_function = await get_updated_tool_function(
function=tool["callable"],
extra_params={
"__messages__": form_data.get(
"messages", []
),
"__files__": metadata.get("files", []),
},
)
tool_result = await tool_function(
**tool_function_params
)