fix: tool calling

This commit is contained in:
Timothy Jaeryang Baek 2025-11-06 16:35:19 -05:00
parent 4754108253
commit c2c02846a8
2 changed files with 3 additions and 3 deletions

View file

@ -2839,7 +2839,7 @@ async def process_chat_response(
)
else:
tool_function = await get_updated_tool_function(
tool_function = get_updated_tool_function(
function=tool["callable"],
extra_params={
"__messages__": form_data.get(

View file

@ -91,13 +91,13 @@ def get_async_tool_function_and_apply_extra_params(
return new_function
async def get_updated_tool_function(function: Callable, extra_params: dict):
def get_updated_tool_function(function: Callable, extra_params: dict):
# Get the original function and merge updated params
__function__ = getattr(function, "__function__", None)
__extra_params__ = getattr(function, "__extra_params__", None)
if __function__ is not None and __extra_params__ is not None:
return await get_async_tool_function_and_apply_extra_params(
return get_async_tool_function_and_apply_extra_params(
__function__,
{**__extra_params__, **extra_params},
)