refac
This commit is contained in:
@@ -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
|
# 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)
|
# Check if builtin_tools capability is enabled for this model (defaults to True if not specified)
|
||||||
builtin_tools_enabled = (
|
builtin_tools_enabled = (
|
||||||
model.get("info", {})
|
(model.get("info", {}).get("meta", {}).get("capabilities") or {})
|
||||||
.get("meta", {})
|
|
||||||
.get("capabilities", {})
|
|
||||||
.get("builtin_tools", True)
|
.get("builtin_tools", True)
|
||||||
)
|
)
|
||||||
if (
|
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)
|
# Check if file context extraction is enabled for this model (default True)
|
||||||
file_context_enabled = (
|
file_context_enabled = (
|
||||||
model.get("info", {})
|
(model.get("info", {}).get("meta", {}).get("capabilities") or {})
|
||||||
.get("meta", {})
|
|
||||||
.get("capabilities", {})
|
|
||||||
.get("file_context", True)
|
.get("file_context", True)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -398,9 +398,7 @@ def get_builtin_tools(
|
|||||||
# Helper to get model capabilities (defaults to True if not specified)
|
# Helper to get model capabilities (defaults to True if not specified)
|
||||||
def get_model_capability(name: str, default: bool = True) -> bool:
|
def get_model_capability(name: str, default: bool = True) -> bool:
|
||||||
return (
|
return (
|
||||||
model.get("info", {})
|
(model.get("info", {}).get("meta", {}).get("capabilities") or {})
|
||||||
.get("meta", {})
|
|
||||||
.get("capabilities", {})
|
|
||||||
.get(name, default)
|
.get(name, default)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user