strands.types.a2a
¶
Additional A2A types.
A2AResponse = tuple[Task, TaskStatusUpdateEvent | TaskArtifactUpdateEvent | None] | Message | Any
module-attribute
¶
A2AStreamEvent
¶
Bases: TypedEvent
Event emitted for every update received from the remote A2A server.
This event wraps all A2A response types during streaming, including: - Partial task updates (TaskArtifactUpdateEvent) - Status updates (TaskStatusUpdateEvent) - Complete messages (Message) - Final task completions
The event is emitted for EVERY update from the server, regardless of whether it represents a complete or partial response. When streaming completes, an AgentResultEvent containing the final AgentResult is also emitted after all A2AStreamEvents.
Source code in strands/types/a2a.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
__init__(a2a_event)
¶
Initialize with A2A event.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
a2a_event
|
A2AResponse
|
The original A2A event (Task tuple or Message) |
required |
Source code in strands/types/a2a.py
27 28 29 30 31 32 33 34 35 36 37 38 | |
TypedEvent
¶
Bases: dict
Base class for all typed events in the agent system.
Source code in strands/types/_events.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | |
is_callback_event
property
¶
True if this event should trigger the callback_handler to fire.
__init__(data=None)
¶
Initialize the typed event with optional data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict[str, Any] | None
|
Optional dictionary of event data to initialize with |
None
|
Source code in strands/types/_events.py
30 31 32 33 34 35 36 | |
as_dict()
¶
Convert this event to a raw dictionary for emitting purposes.
Source code in strands/types/_events.py
43 44 45 | |
prepare(invocation_state)
¶
Prepare the event for emission by adding invocation state.
This allows a subset of events to merge with the invocation_state without needing to pass around the invocation_state throughout the system.
Source code in strands/types/_events.py
47 48 49 50 51 52 53 | |