This commit is contained in:
Timothy Jaeryang Baek
2026-08-13 21:02:17 -06:00
parent ec36972c2b
commit 083e351441
10 changed files with 384 additions and 74 deletions
+3 -3
View File
@@ -542,9 +542,9 @@ async def get_builtin_tools(
# Helper to check if a builtin tool category is enabled via meta.builtinTools
# Defaults to True if not specified (backward compatible)
def is_builtin_tool_enabled(category: str) -> bool:
def is_builtin_tool_enabled(category: str, default: bool = True) -> bool:
builtin_tools = model.get('info', {}).get('meta', {}).get('builtinTools', {})
return builtin_tools.get(category, True)
return builtin_tools.get(category, default)
# Helper to check user-level feature permission (admins always pass)
user = extra_params.get('__user__', {})
@@ -584,7 +584,7 @@ async def get_builtin_tools(
if is_builtin_tool_enabled('time'):
builtin_functions.extend([get_current_timestamp, calculate_timestamp])
if is_builtin_tool_enabled('user_input'):
if is_builtin_tool_enabled('user_input', True):
builtin_functions.append(ask_user)
metadata = extra_params.get('__metadata__') or {}