This commit is contained in:
Timothy Jaeryang Baek
2026-04-08 13:34:23 -07:00
parent f9ceb7fa89
commit a775fc9b50
2 changed files with 5 additions and 13 deletions
+4 -1
View File
@@ -2680,9 +2680,12 @@ async def process_chat_payload(request, form_data, user, metadata, model):
tools_dict[name] = tool_dict
if tools_dict:
# Always store resolved tools in metadata so downstream consumers
# (e.g. pipe functions) can access all tools including MCP and builtins.
metadata['tools'] = tools_dict
if metadata.get('params', {}).get('function_calling') == 'native':
# If the function calling is native, then call the tools function calling handler
metadata['tools'] = tools_dict
form_data['tools'] = [
{'type': 'function', 'function': tool.get('spec', {})} for tool in tools_dict.values()
]