From 1ba3ae03c17d189b2ccc65fc3f741039fc78bd87 Mon Sep 17 00:00:00 2001 From: Eric Huang Date: Thu, 27 Feb 2025 16:09:48 -0800 Subject: [PATCH] include content, don't include tool args Summary: Test Plan: --- .../inline/agents/meta_reference/agent_instance.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/llama_stack/providers/inline/agents/meta_reference/agent_instance.py b/llama_stack/providers/inline/agents/meta_reference/agent_instance.py index 3502c21f2..5c492434f 100644 --- a/llama_stack/providers/inline/agents/meta_reference/agent_instance.py +++ b/llama_stack/providers/inline/agents/meta_reference/agent_instance.py @@ -1054,9 +1054,6 @@ async def execute_tool_call_maybe( group_name = tool_to_group.get(name, None) if group_name is None: raise ValueError(f"Tool {name} not found in any tool group") - # get the arguments generated by the model and augment with toolgroup arg overrides for the agent - tool_call_args = tool_call.arguments - tool_call_args.update(toolgroup_args.get(group_name, {})) if isinstance(name, BuiltinTool): if name == BuiltinTool.brave_search: name = WEB_SEARCH_TOOL @@ -1065,10 +1062,12 @@ async def execute_tool_call_maybe( result = await tool_runtime_api.invoke_tool( tool_name=name, - kwargs=dict( - session_id=session_id, - **tool_call_args, - ), + kwargs={ + "session_id": session_id, + # get the arguments generated by the model and augment with toolgroup arg overrides for the agent + **tool_call.arguments, + **toolgroup_args.get(group_name, {}), + }, ) return result