Skip to content

Commit f420bfa

Browse files
committed
Update agent_base.py
1 parent aabfc94 commit f420bfa

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/backend/kernel_agents/agent_base.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,13 @@ async def invoke_tool(self, tool_name: str, arguments: Dict[str, Any]) -> str:
161161

162162
# Invoke the tool
163163
logging.info(f"Invoking tool '{tool_name}' with arguments: {arguments}")
164-
result = await tool.invoke(kernel_args)
164+
165+
# Use invoke_with_args_dict directly instead of relying on KernelArguments
166+
if hasattr(tool, 'invoke_with_args_dict') and callable(tool.invoke_with_args_dict):
167+
result = await tool.invoke_with_args_dict(arguments)
168+
else:
169+
# Fall back to standard invoke method
170+
result = await tool.invoke(kernel_args)
165171

166172
# Log telemetry if configured
167173
track_event_if_configured("AgentToolInvocation", {

0 commit comments

Comments
 (0)