-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
Description
The current implementation ignores the _update_event variable, which causes the streaming output of the connected agent to fail to obtain typewriter-effect output content.
async for item in a2a_stream:
if isinstance(item, A2AMessage):
# Process A2A Message
contents = self._parse_contents_from_a2a(item.parts)
update = AgentResponseUpdate(
contents=contents,
role="assistant" if item.role == A2ARole.agent else "user",
response_id=str(getattr(item, "message_id", str(ulid.ULID()))),
raw_representation=item,
)
all_updates.append(update)
yield update
elif isinstance(item, tuple) and len(item) == 2 and isinstance(item[0], Task):
task, _update_event = item # ~~~JUST HERE !!!! ~~~~
for update in self._updates_from_task(task, background=background):
all_updates.append(update)
yield update
else:
raise NotImplementedError("Only Message and Task responses are supported")The streaming response workflow of the A2A Server is roughly as follows:
- The first event returns a Task
- The second event returns the first chunk of the model output wrapped as a TaskArtifactUpdateEvent, with append = False and TaskState.working
TaskArtifactUpdateEvent(
task_id=task_id,
context_id=context_id,
artifact= The First Chunk Of Model Output,
append= False,
)- Subsequent events wrap the subsequent model outputs as TaskArtifactUpdateEvent in sequence, with append = True and TaskState.working
- Returns a TaskStatusUpdateEvent with TaskState.completed
To be honest, after using the A2AAgent implementation for a period of time, I have encountered many issues, submitted some of them, and they have been fixed. First of all, I would like to thank all the developers for your hard work and timely responses.
However, this also exposes a problem: the implementation of A2AAgent has not been properly integration-tested in real business scenarios. It is already at the RC5 version, and the current quality is worrying.
Code Sample
Error Messages / Stack Traces
Package Versions
agent-framework:1.0.0rc5
Python Version
No response
Additional Context
No response
Metadata
Metadata
Assignees
Labels
Type
Projects
Status