enh: built-in tools toggle in model editor

This commit is contained in:
Tim Baek
2026-01-07 06:22:17 -05:00
parent 502813c6c8
commit 60e916d6c0
3 changed files with 11 additions and 3 deletions

View File

@@ -1556,8 +1556,10 @@ async def process_chat_payload(request, form_data, user, metadata, model):
if mcp_clients:
metadata["mcp_clients"] = mcp_clients
# Always inject builtin tools for native function calling based on enabled features
if metadata.get("params", {}).get("function_calling") == "native":
# Inject builtin tools for native function calling based on enabled features and model capability
# Check if builtin_tools capability is enabled for this model (defaults to True if not specified)
builtin_tools_enabled = model.get("info", {}).get("meta", {}).get("capabilities", {}).get("builtin_tools", True)
if metadata.get("params", {}).get("function_calling") == "native" and builtin_tools_enabled:
builtin_tools = get_builtin_tools(
request,
{

View File

@@ -40,6 +40,10 @@
status_updates: {
label: $i18n.t('Status Updates'),
description: $i18n.t('Displays status updates (e.g., web search progress) in the response')
},
builtin_tools: {
label: $i18n.t('Builtin Tools'),
description: $i18n.t('Automatically inject system tools in native function calling mode (e.g., timestamps, memory, chat history, notes, etc.)')
}
};
@@ -52,6 +56,7 @@
usage?: boolean;
citations?: boolean;
status_updates?: boolean;
builtin_tools?: boolean;
} = {};
</script>

View File

@@ -99,7 +99,8 @@
code_interpreter: true,
citations: true,
status_updates: true,
usage: undefined
usage: undefined,
builtin_tools: true
};
let defaultFeatureIds = [];