mirror of
https://github.com/open-webui/open-webui
synced 2025-04-27 17:51:31 +00:00
fix: updatepost_response_handler nativ tools handler to use parameters from properties fixing defaults always used
This commit is contained in:
parent
d862295a05
commit
3b39807377
@ -1759,14 +1759,12 @@ async def process_chat_response(
|
|||||||
spec = tool.get("spec", {})
|
spec = tool.get("spec", {})
|
||||||
|
|
||||||
try:
|
try:
|
||||||
required_params = spec.get("parameters", {}).get(
|
allowed_params = spec.get("parameters", {}).get("properties", {}).keys()
|
||||||
"required", []
|
|
||||||
)
|
|
||||||
tool_function = tool["callable"]
|
tool_function = tool["callable"]
|
||||||
tool_function_params = {
|
tool_function_params = {
|
||||||
k: v
|
k: v
|
||||||
for k, v in tool_function_params.items()
|
for k, v in tool_function_params.items()
|
||||||
if k in required_params
|
if k in allowed_params
|
||||||
}
|
}
|
||||||
tool_result = await tool_function(
|
tool_result = await tool_function(
|
||||||
**tool_function_params
|
**tool_function_params
|
||||||
|
Loading…
Reference in New Issue
Block a user