mirror of
https://github.com/open-webui/open-webui.git
synced 2026-10-27 06:12:21 +00:00
fix: when two tools have a function with the same name, the model can call both (#32670)
This commit is contained in:
parent
f13108f63d
commit
ab6976b5bf
1 changed files with 2 additions and 0 deletions
|
|
@ -451,6 +451,7 @@ async def get_tools(request: Request, tool_ids: list[str], user: UserModel, extr
|
|||
# Prepend tool ID to function name
|
||||
function_name = f'{tool_id}_{function_name}'
|
||||
|
||||
tool_dict['spec'] = {**tool_dict['spec'], 'name': function_name}
|
||||
tools_dict[function_name] = tool_dict
|
||||
else:
|
||||
if tool_id.startswith('server:'):
|
||||
|
|
@ -551,6 +552,7 @@ async def get_tools(request: Request, tool_ids: list[str], user: UserModel, extr
|
|||
# Prepend server ID to function name
|
||||
function_name = f'{server_id}_{function_name}'
|
||||
|
||||
tool_dict['spec'] = {**tool_dict['spec'], 'name': function_name}
|
||||
tools_dict[function_name] = tool_dict
|
||||
|
||||
else:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue