-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
questionQuestion about using the SDKQuestion about using the SDK
Description
Hello,
Thank you for the excellent work on this project! I'm currently working with the following code snippet to handle streaming events:
async for event in result.stream_events():
# We'll ignore the raw responses event deltas
if event.type == "raw_response_event":
continue
# When the agent updates, print that
elif event.type == "agent_updated_stream_event":
print(f"Agent updated: {event.new_agent.name}")
continue
# When items are generated, print them
elif event.item.type == "tool_call_item":
print("-- Tool was called")
elif event.item.type == "tool_call_output_item":
print(f"-- Tool output: {event.item.output}")
elif event.item.type == "message_output_item":
print(f"-- Message output:\n {ItemHelpers.text_message_output(event.item)}")
else:
pass # Ignore other event types
I would like to print the name of the tool within the tool_call_item
event section, but I'm not sure how to access it. Does the current implementation allow for retrieving the tool name? If so, could you please guide me on how to do this, or share if there are any plans to implement this feature?
Metadata
Metadata
Assignees
Labels
questionQuestion about using the SDKQuestion about using the SDK