This commit is contained in:
Timothy Jaeryang Baek
2026-01-22 15:07:14 +04:00
parent 68b2872ed6
commit 14f6747dfc
2 changed files with 3 additions and 9 deletions

View File

@@ -1808,9 +1808,7 @@ async def process_chat_payload(request, form_data, user, metadata, model):
# 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", {})
(model.get("info", {}).get("meta", {}).get("capabilities") or {})
.get("builtin_tools", True)
)
if (
@@ -1856,9 +1854,7 @@ async def process_chat_payload(request, form_data, user, metadata, model):
# Check if file context extraction is enabled for this model (default True)
file_context_enabled = (
model.get("info", {})
.get("meta", {})
.get("capabilities", {})
(model.get("info", {}).get("meta", {}).get("capabilities") or {})
.get("file_context", True)
)

View File

@@ -398,9 +398,7 @@ def get_builtin_tools(
# Helper to get model capabilities (defaults to True if not specified)
def get_model_capability(name: str, default: bool = True) -> bool:
return (
model.get("info", {})
.get("meta", {})
.get("capabilities", {})
(model.get("info", {}).get("meta", {}).get("capabilities") or {})
.get(name, default)
)