You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
asyncfor chunk inself.agent.stream(): # Iterates over agent's stream
83
83
message: Message = Message(
84
84
role=Role.agent,
@@ -87,8 +87,8 @@ Let's look at `examples/helloworld/agent_executor.py`. It defines `HelloWorldAge
87
87
final=chunk['done'], # Indicates if this is the last chunk
88
88
)
89
89
# Yields each chunk as a streaming success response
90
-
yieldSendMessageStreamingResponse(
91
-
root=SendMessageStreamingSuccessResponse(
90
+
yieldSendStreamingMessageResponse(
91
+
root=SendStreamingMessageSuccessResponse(
92
92
id=request.id, result=message
93
93
)
94
94
)
@@ -98,7 +98,7 @@ Let's look at `examples/helloworld/agent_executor.py`. It defines `HelloWorldAge
98
98
99
99
1. It iterates through the chunks produced by `self.agent.stream()`.
100
100
2. For each chunk, it creates an A2A`Message`. The `final` attribute of the message is important for streaming; it tells the client if more chunks are coming.
101
-
3. Each message is`yield`ed, wrapped in a `SendMessageStreamingSuccessResponse`. This is how SSE (Server-Sent Events) are generated by the SDK.
101
+
3. Each message is`yield`ed, wrapped in a `SendStreamingMessageSuccessResponse`. This is how SSE (Server-Sent Events) are generated by the SDK.
102
102
103
103
-`on_cancel`and`on_resubscribe`:
104
104
The Helloworld example marks these as`UnsupportedOperationError` because it doesn't implement task cancellation or resubscription.
0 commit comments