Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
bonk1t committed Dec 19, 2024
1 parent dbb5ba8 commit e3f5e31
Showing 1 changed file with 13 additions and 4 deletions.
17 changes: 13 additions & 4 deletions agency_swarm/threads/thread.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,11 @@ def get_completion(
if tc.function.arguments
else {}
)
action = AgentAction(tool=tc.function.name, tool_input=args)
action = AgentAction(
tool=tc.function.name,
tool_input=args,
log=f"Using tool {tc.function.name} with arguments: {args}",
)
if self.callback_handler:
self.callback_handler.on_agent_action(
action=action,
Expand Down Expand Up @@ -313,7 +317,8 @@ def handle_output(tool_call, output):
parent_run_id=parent_run_id,
)
finish = AgentFinish(
return_values={"response": output}
return_values={"response": output},
log=output,
)
self.callback_handler.on_agent_finish(
finish=finish,
Expand Down Expand Up @@ -356,7 +361,9 @@ def handle_output(tool_call, output):
run_id=chain_run_id,
parent_run_id=parent_run_id,
)
finish = AgentFinish(return_values={"response": output})
finish = AgentFinish(
return_values={"response": output}, log=output
)
self.callback_handler.on_agent_finish(
finish=finish,
run_id=self._run.id,
Expand Down Expand Up @@ -548,7 +555,9 @@ def handle_output(tool_call, output):
parent_run_id=parent_run_id,
)
# agent finish
finish = AgentFinish(return_values={"response": last_message})
finish = AgentFinish(
return_values={"response": last_message}, log=last_message
)
self.callback_handler.on_agent_finish(
finish=finish,
run_id=self._run.id,
Expand Down

0 comments on commit e3f5e31

Please sign in to comment.