feat/enh: tool server function name filter list

This commit is contained in:
Timothy Jaeryang Baek
2025-11-25 02:31:34 -05:00
parent 488631db98
commit 743199f2d0
6 changed files with 93 additions and 36 deletions
+13
View File
@@ -34,6 +34,7 @@ from langchain_core.utils.function_calling import (
)
from open_webui.utils.misc import is_string_allowed
from open_webui.models.tools import Tools
from open_webui.models.users import UserModel
from open_webui.utils.plugin import load_tool_module_by_id
@@ -149,8 +150,20 @@ async def get_tools(
)
specs = tool_server_data.get("specs", [])
function_name_filter_list = tool_server_connection.get(
"function_name_filter_list", None
)
for spec in specs:
function_name = spec["name"]
if function_name_filter_list and isinstance(
function_name_filter_list, list
):
if not is_string_allowed(
function_name, function_name_filter_list
):
# Skip this function
continue
auth_type = tool_server_connection.get("auth_type", "bearer")