mirror of
https://github.com/open-webui/open-webui.git
synced 2026-09-11 22:52:54 +00:00
refac: explicit toggle builtin tools
This commit is contained in:
parent
58e923fe00
commit
f1a1e64d2e
1 changed files with 4 additions and 0 deletions
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue