Core A2A Library components
mainThe A2A library provides the fundamental building blocks for the Agent2Agent protocol.
Client-side
A2AClient: Primary client for making A2A requests. Supports streaming, task management, and push notifications.A2ACardResolver: ResolvesAgentCardinformation from endpoints to discover capabilities.
Server-side
A2AServer: Handles JSON-RPC requests, manages task lifecycles viaTaskProjection, and coordinates responses.IAgentHandler: The interface you implement to define agent behavior. RequiresExecuteAsync()andCancelAsync().TaskUpdater: API for emitting lifecycle events:Submit,StartWork,AddArtifact,Complete,Fail,Cancel,RequireInput.MessageResponder: API for stateless, immediate message replies.RequestContext: Provides context to the agent, including the incomingMessage,TaskId,ContextId, and properties likeUserTextandIsContinuation.AgentEventQueue: A channel-backed queue where agents write events for the SDK to process.ITaskStore: Interface for task persistence. UseInMemoryTaskStorefor development/testing.
Core Models
AgentTask: Represents task status, history, artifacts, and metadata.AgentCard: Contains agent metadata, capabilities, and endpoints.Message: The data format for messages exchanged between agents.