Skip to content

Add Streaming Support to A2A #2362

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

physicsrob
Copy link
Contributor

This PR implements streaming capabilities for pydantic-ai's A2A integration, enabling real-time updates during agent execution.

  • Streaming Agent Execution: Switched from blocking agent.run() to streaming agent.iter() to emit real-time updates
  • Real-time Status Updates: Agents now emit TaskStatusUpdateEvent messages for working/completed states
  • Incremental Message Streaming: Agent responses are streamed as they're generated when enable_streaming=True
  • Artifact Updates: Final results are emitted as TaskArtifactUpdateEvent for structured outputs

[ ] Blocked by pydantic/fasta2a#26 -- This PR relies on functionality introduced in my previous fasta2a PR

@physicsrob
Copy link
Contributor Author

cc @Kludex

FYI, the next PR is ready to go here (physicsrob#1). This will add dependency injection support. But first we need to land the fasta2a change and this current PR.

@aristide1997
Copy link

@Kludex have you had a chance to look at this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants