Skip to content

Commit 8dfbe98

Browse files
committed
Improve tool output readability
Separate tool name and output for better readability. Before: > read_file: anthropic>=0.25.0 python-dotenv>=1.0.0 After: > read_file: anthropic>=0.25.0 python-dotenv>=1.0.0
1 parent a9c7100 commit 8dfbe98

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

agents/s02_tool_use.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,8 @@ def agent_loop(messages: list):
125125
if block.type == "tool_use":
126126
handler = TOOL_HANDLERS.get(block.name)
127127
output = handler(**block.input) if handler else f"Unknown tool: {block.name}"
128-
print(f"> {block.name}: {output[:200]}")
128+
print(f"> {block.name}:")
129+
print(output[:200])
129130
results.append({"type": "tool_result", "tool_use_id": block.id, "content": output})
130131
messages.append({"role": "user", "content": results})
131132

0 commit comments

Comments
 (0)