Skip to content

Commit 72feab7

Browse files
add tool calls to message for pretty xray output
1 parent fe37bb8 commit 72feab7

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/agentlab/agents/tool_use_agent/tool_use_agent.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -486,8 +486,11 @@ def get_action(self, obs: Any) -> float:
486486
tools_msg = MessageBuilder("tool_description").add_text(tools_str)
487487

488488
# Adding these extra messages to visualize in gradio
489-
messages.insert(0, tools_msg) # insert at the beginning of the messages
490-
messages.append(response.tool_calls)
489+
messages.insert(0, tools_msg) # insert at the beginning of the message
490+
# This avoids the assertion error with self.llm.user().add_responded_tool_calls(tool_calls)
491+
msg = self.llm.msg("tool")
492+
msg.responded_tool_calls = response.tool_calls
493+
messages.append(msg)
491494

492495
agent_info = bgym.AgentInfo(
493496
think=think,

0 commit comments

Comments
 (0)