mirror of
https://github.com/open-webui/open-webui.git
synced 2026-02-24 04:00:31 +01:00
refac: explicit toggle builtin tools
This commit is contained in:
@@ -471,6 +471,7 @@ def get_builtin_tools(
|
||||
is_builtin_tool_enabled("web_search")
|
||||
and getattr(request.app.state.config, "ENABLE_WEB_SEARCH", False)
|
||||
and get_model_capability("web_search")
|
||||
and features.get("web_search")
|
||||
):
|
||||
builtin_functions.extend([search_web, fetch_url])
|
||||
|
||||
@@ -479,12 +480,14 @@ def get_builtin_tools(
|
||||
is_builtin_tool_enabled("image_generation")
|
||||
and getattr(request.app.state.config, "ENABLE_IMAGE_GENERATION", False)
|
||||
and get_model_capability("image_generation")
|
||||
and features.get("image_generation")
|
||||
):
|
||||
builtin_functions.append(generate_image)
|
||||
if (
|
||||
is_builtin_tool_enabled("image_generation")
|
||||
and getattr(request.app.state.config, "ENABLE_IMAGE_EDIT", False)
|
||||
and get_model_capability("image_generation")
|
||||
and features.get("image_generation")
|
||||
):
|
||||
builtin_functions.append(edit_image)
|
||||
|
||||
@@ -493,6 +496,7 @@ def get_builtin_tools(
|
||||
is_builtin_tool_enabled("code_interpreter")
|
||||
and getattr(request.app.state.config, "ENABLE_CODE_INTERPRETER", True)
|
||||
and get_model_capability("code_interpreter")
|
||||
and features.get("code_interpreter")
|
||||
):
|
||||
builtin_functions.append(execute_code)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user