Repository navigation
Replies: 1 comment
|
In the code you quoted, The implementation has changed since that snippet. On current main, a from smolagents.agents import ToolOutput
outputs_by_call_id = {}
for event in agent.run(task, stream=True):
if isinstance(event, ToolOutput) and not event.is_final_answer:
outputs_by_call_id[event.id] = event.outputFully iterate the generator so the run completes. This is If you only need the readable trace after a run: from smolagents.memory import ActionStep
for step in agent.memory.steps:
if isinstance(step, ActionStep):
print(step.step_number, step.observations)The distinction is visible in process_tool_calls: |
Uh oh!
There was an error while loading. Please reload this page.
In the ToolCallingAgent.step() method, when tool_name == "final_answer", memory_step.action_output is assigned the value of final_answer and is returned. However, when tool_name != "final_answer", memory_step.action_output is not assigned a value.
All reactions