mirror of
https://github.com/open-webui/open-webui
synced 2025-04-10 15:45:45 +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", {})
|
||||
|
||||
try:
|
||||
required_params = spec.get("parameters", {}).get(
|
||||
"required", []
|
||||
)
|
||||
allowed_params = spec.get("parameters", {}).get("properties", {}).keys()
|
||||
tool_function = tool["callable"]
|
||||
tool_function_params = {
|
||||
k: v
|
||||
for k, v in tool_function_params.items()
|
||||
if k in required_params
|
||||
if k in allowed_params
|
||||
}
|
||||
tool_result = await tool_function(
|
||||
**tool_function_params
|
||||
|
Loading…
Reference in New Issue
Block a user