From e8b8d48f24b5af6b9cc39d915c51a20d74bea1aa Mon Sep 17 00:00:00 2001 From: Sambhav Dixit <94298612+sambhavnoobcoder@users.noreply.github.com> Date: Sun, 27 Oct 2024 18:41:23 +0530 Subject: [PATCH] add section for tools update - make the run update for tools --- swarms/structs/agent.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/swarms/structs/agent.py b/swarms/structs/agent.py index 39bf238b..33f63e8b 100644 --- a/swarms/structs/agent.py +++ b/swarms/structs/agent.py @@ -826,7 +826,19 @@ class Agent: # Check and execute tools if self.tools is not None: print(f"self.tools is not None: {response}") + tool_result = self.parse_and_execute_tools(response) self.parse_and_execute_tools(response) + if tool_result: + self.update_tool_usage( + step_meta["step_id"], + tool_result["tool"], + tool_result["args"], + tool_result["response"] + ) + + + # Update agent output history + self.agent_output.full_history = self.short_memory.return_history_as_string() # Log the step metadata logged = self.log_step_metadata(