Skip to content

Commit 71fa12c

Browse files
authored
Print called tool's name in examples/basic/stream_items.py (#2174)
1 parent 8e1fd7a commit 71fa12c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

examples/basic/stream_items.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async def main():
3131
continue
3232
elif event.type == "run_item_stream_event":
3333
if event.item.type == "tool_call_item":
34-
print("-- Tool was called")
34+
print(f"-- Tool was called: {getattr(event.item.raw_item, 'name', 'Unknown Tool')}")
3535
elif event.item.type == "tool_call_output_item":
3636
print(f"-- Tool output: {event.item.output}")
3737
elif event.item.type == "message_output_item":
@@ -47,7 +47,7 @@ async def main():
4747

4848
# === Run starting ===
4949
# Agent updated: Joker
50-
# -- Tool was called
50+
# -- Tool was called: how_many_jokes
5151
# -- Tool output: 4
5252
# -- Message output:
5353
# Sure, here are four jokes for you:

0 commit comments

Comments
 (0)