Skip to content

Commit

Permalink
Rename tool_response_message to error_message and append it
Browse files Browse the repository at this point in the history
  • Loading branch information
albertvillanova committed Jan 23, 2025
1 parent 94ce0be commit 16f3bcd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/smolagents/agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def write_inner_memory_from_logs(self, summary_mode: Optional[bool] = False) ->
}
memory.append(tool_call_message)
if step_log.error is not None:
tool_response_message = {
error_message = {
"role": MessageRole.ASSISTANT,
"content": [
{
Expand All @@ -312,6 +312,7 @@ def write_inner_memory_from_logs(self, summary_mode: Optional[bool] = False) ->
}
],
}
memory.append(error_message)
if step_log.observations is not None:
if step_log.tool_calls:
tool_call_reference = f"Call id: {(step_log.tool_calls[0].id if getattr(step_log.tool_calls[0], 'id') else 'call_0')}\n"
Expand Down

0 comments on commit 16f3bcd

Please sign in to comment.