mirror of
https://github.com/open-webui/open-webui.git
synced 2026-02-24 04:00:31 +01:00
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
|
||||
# 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)
|
||||
)
|
||||
|
||||
|
||||
@@ -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)
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user