mirror of
https://github.com/open-webui/open-webui.git
synced 2026-11-11 08:57:17 +00:00
fix(tools): apply function_names filter when loading openapi tool server specs
Signed-off-by: aoright <102943475+aoright@users.noreply.github.com>
This commit is contained in:
parent
4067e357b2
commit
70ae936265
1 changed files with 3 additions and 0 deletions
|
|
@ -363,6 +363,7 @@ async def get_tools(request: Request, tool_ids: list[str], user: UserModel, extr
|
|||
type = splits[1]
|
||||
server_id = splits[2]
|
||||
|
||||
function_names = None
|
||||
server_id_splits = server_id.split('|')
|
||||
if len(server_id_splits) == 2:
|
||||
server_id = server_id_splits[0]
|
||||
|
|
@ -404,6 +405,8 @@ async def get_tools(request: Request, tool_ids: list[str], user: UserModel, extr
|
|||
|
||||
for spec in specs:
|
||||
function_name = spec['name']
|
||||
if function_names and function_name not in function_names:
|
||||
continue
|
||||
if function_name_filter_list:
|
||||
if not is_string_allowed(function_name, function_name_filter_list):
|
||||
# Skip this function
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue