mirror of
https://github.com/open-webui/open-webui.git
synced 2026-05-03 10:49:21 -05:00
refac
This commit is contained in:
@@ -1409,9 +1409,12 @@ async def process_chat_payload(request, form_data, user, metadata, model):
|
||||
headers=headers if headers else None,
|
||||
)
|
||||
|
||||
function_name_filter_list = mcp_server_connection.get(
|
||||
"function_name_filter_list", None
|
||||
function_name_filter_list = (
|
||||
mcp_server_connection.get("config", {})
|
||||
.get("function_name_filter_list", "")
|
||||
.split(",")
|
||||
)
|
||||
|
||||
tool_specs = await mcp_clients[server_id].list_tool_specs()
|
||||
for tool_spec in tool_specs:
|
||||
|
||||
@@ -1424,9 +1427,7 @@ async def process_chat_payload(request, form_data, user, metadata, model):
|
||||
|
||||
return tool_function
|
||||
|
||||
if function_name_filter_list and isinstance(
|
||||
function_name_filter_list, list
|
||||
):
|
||||
if function_name_filter_list:
|
||||
if not is_string_allowed(
|
||||
tool_spec["name"], function_name_filter_list
|
||||
):
|
||||
|
||||
Reference in New Issue
Block a user