Python SDK Reference¶
This page contains SDK documentation for the a2a-sdk
Python package.
Client¶
Client-side components for interacting with an A2A agent.
ClientEvent = tuple[Task, UpdateEvent]
module-attribute
¶
Consumer = Callable[[ClientEvent | Message, AgentCard], Coroutine[None, Any, Any]]
module-attribute
¶
logger = logging.getLogger(__name__)
module-attribute
¶
A2ACardResolver
¶
Agent Card resolver.
agent_card_path = agent_card_path.lstrip('/')
instance-attribute
¶
base_url = base_url.rstrip('/')
instance-attribute
¶
httpx_client = httpx_client
instance-attribute
¶
get_agent_card(relative_card_path=None, http_kwargs=None)
async
¶
Fetches an agent card from a specified path relative to the base_url.
If relative_card_path is None, it defaults to the resolver's configured agent_card_path (for the public agent card).
Parameters:
Name | Type | Description | Default |
---|---|---|---|
relative_card_path
|
str | None
|
Optional path to the agent card endpoint, relative to the base URL. If None, uses the default public agent card path. |
None
|
http_kwargs
|
dict[str, Any] | None
|
Optional dictionary of keyword arguments to pass to the underlying httpx.get request. |
None
|
Returns:
Type | Description |
---|---|
AgentCard
|
An |
Raises:
Type | Description |
---|---|
A2AClientHTTPError
|
If an HTTP error occurs during the request. |
A2AClientJSONError
|
If the response body cannot be decoded as JSON or validated against the AgentCard schema. |
A2AClient
¶
[DEPRECATED] Backwards compatibility wrapper for the JSON-RPC client.
cancel_task(request, *, http_kwargs=None, context=None)
async
¶
Requests the agent to cancel a specific task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
CancelTaskRequest
|
The |
required |
http_kwargs
|
dict[str, Any] | None
|
Optional dictionary of keyword arguments to pass to the underlying httpx.post request. |
None
|
context
|
ClientCallContext | None
|
The client call context. |
None
|
Returns:
Type | Description |
---|---|
CancelTaskResponse
|
A |
Raises:
Type | Description |
---|---|
A2AClientHTTPError
|
If an HTTP error occurs during the request. |
A2AClientJSONError
|
If the response body cannot be decoded as JSON or validated. |
get_card(*, http_kwargs=None, context=None)
async
¶
Retrieves the authenticated card (if necessary) or the public one.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
http_kwargs
|
dict[str, Any] | None
|
Optional dictionary of keyword arguments to pass to the underlying httpx.post request. |
None
|
context
|
ClientCallContext | None
|
The client call context. |
None
|
Returns:
Type | Description |
---|---|
AgentCard
|
A |
Raises:
Type | Description |
---|---|
A2AClientHTTPError
|
If an HTTP error occurs during the request. |
A2AClientJSONError
|
If the response body cannot be decoded as JSON or validated. |
get_task(request, *, http_kwargs=None, context=None)
async
¶
Retrieves the current state and history of a specific task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
GetTaskRequest
|
The |
required |
http_kwargs
|
dict[str, Any] | None
|
Optional dictionary of keyword arguments to pass to the underlying httpx.post request. |
None
|
context
|
ClientCallContext | None
|
The client call context. |
None
|
Returns:
Type | Description |
---|---|
GetTaskResponse
|
A |
Raises:
Type | Description |
---|---|
A2AClientHTTPError
|
If an HTTP error occurs during the request. |
A2AClientJSONError
|
If the response body cannot be decoded as JSON or validated. |
get_task_callback(request, *, http_kwargs=None, context=None)
async
¶
Retrieves the push notification configuration for a specific task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
GetTaskPushNotificationConfigRequest
|
The |
required |
http_kwargs
|
dict[str, Any] | None
|
Optional dictionary of keyword arguments to pass to the underlying httpx.post request. |
None
|
context
|
ClientCallContext | None
|
The client call context. |
None
|
Returns:
Type | Description |
---|---|
GetTaskPushNotificationConfigResponse
|
A |
Raises:
Type | Description |
---|---|
A2AClientHTTPError
|
If an HTTP error occurs during the request. |
A2AClientJSONError
|
If the response body cannot be decoded as JSON or validated. |
resubscribe(request, *, http_kwargs=None, context=None)
async
¶
Reconnects to get task updates.
This method uses Server-Sent Events (SSE) to receive a stream of updates from the agent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
TaskResubscriptionRequest
|
The |
required |
http_kwargs
|
dict[str, Any] | None
|
Optional dictionary of keyword arguments to pass to the
underlying httpx.post request. A default |
None
|
context
|
ClientCallContext | None
|
The client call context. |
None
|
Yields:
Type | Description |
---|---|
AsyncGenerator[SendStreamingMessageResponse, None]
|
|
AsyncGenerator[SendStreamingMessageResponse, None]
|
These can be Task, Message, TaskStatusUpdateEvent, or TaskArtifactUpdateEvent. |
Raises:
Type | Description |
---|---|
A2AClientHTTPError
|
If an HTTP or SSE protocol error occurs during the request. |
A2AClientJSONError
|
If an SSE event data cannot be decoded as JSON or validated. |
send_message(request, *, http_kwargs=None, context=None)
async
¶
Sends a non-streaming message request to the agent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
SendMessageRequest
|
The |
required |
http_kwargs
|
dict[str, Any] | None
|
Optional dictionary of keyword arguments to pass to the underlying httpx.post request. |
None
|
context
|
ClientCallContext | None
|
The client call context. |
None
|
Returns:
Type | Description |
---|---|
SendMessageResponse
|
A |
Raises:
Type | Description |
---|---|
A2AClientHTTPError
|
If an HTTP error occurs during the request. |
A2AClientJSONError
|
If the response body cannot be decoded as JSON or validated. |
send_message_streaming(request, *, http_kwargs=None, context=None)
async
¶
Sends a streaming message request to the agent and yields responses as they arrive.
This method uses Server-Sent Events (SSE) to receive a stream of updates from the agent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
SendStreamingMessageRequest
|
The |
required |
http_kwargs
|
dict[str, Any] | None
|
Optional dictionary of keyword arguments to pass to the
underlying httpx.post request. A default |
None
|
context
|
ClientCallContext | None
|
The client call context. |
None
|
Yields:
Type | Description |
---|---|
AsyncGenerator[SendStreamingMessageResponse, None]
|
|
AsyncGenerator[SendStreamingMessageResponse, None]
|
These can be Task, Message, TaskStatusUpdateEvent, or TaskArtifactUpdateEvent. |
Raises:
Type | Description |
---|---|
A2AClientHTTPError
|
If an HTTP or SSE protocol error occurs during the request. |
A2AClientJSONError
|
If an SSE event data cannot be decoded as JSON or validated. |
set_task_callback(request, *, http_kwargs=None, context=None)
async
¶
Sets or updates the push notification configuration for a specific task.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
SetTaskPushNotificationConfigRequest
|
The |
required |
http_kwargs
|
dict[str, Any] | None
|
Optional dictionary of keyword arguments to pass to the underlying httpx.post request. |
None
|
context
|
ClientCallContext | None
|
The client call context. |
None
|
Returns:
Type | Description |
---|---|
SetTaskPushNotificationConfigResponse
|
A |
Raises:
Type | Description |
---|---|
A2AClientHTTPError
|
If an HTTP error occurs during the request. |
A2AClientJSONError
|
If the response body cannot be decoded as JSON or validated. |
A2AClientError
¶
Bases: Exception
Base exception for A2A Client errors.
A2AClientHTTPError
¶
Bases: A2AClientError
Client exception for HTTP errors received from the server.
A2AClientJSONError
¶
Bases: A2AClientError
Client exception for JSON errors during response parsing or validation.
message = message
instance-attribute
¶
A2AClientTimeoutError
¶
Bases: A2AClientError
Client exception for timeout errors during a request.
message = message
instance-attribute
¶
A2AGrpcClient
¶
Placeholder for A2AGrpcClient when dependencies are not installed.
AuthInterceptor
¶
Bases: ClientCallInterceptor
An interceptor that automatically adds authentication details to requests.
Based on the agent's security schemes.
intercept(method_name, request_payload, http_kwargs, agent_card, context)
async
¶
Applies authentication headers to the request if credentials are available.
Client
¶
Bases: ABC
Abstract base class defining the interface for an A2A client.
This class provides a standard set of methods for interacting with an A2A agent, regardless of the underlying transport protocol (e.g., gRPC, JSON-RPC). It supports sending messages, managing tasks, and handling event streams.
add_event_consumer(consumer)
async
¶
Attaches additional consumers to the Client
.
add_request_middleware(middleware)
async
¶
Attaches additional middleware to the Client
.
cancel_task(request, *, context=None)
abstractmethod
async
¶
Requests the agent to cancel a specific task.
consume(event, card)
async
¶
Processes the event via all the registered Consumer
s.
get_card(*, context=None)
abstractmethod
async
¶
Retrieves the agent's card.
get_task(request, *, context=None)
abstractmethod
async
¶
Retrieves the current state and history of a specific task.
get_task_callback(request, *, context=None)
abstractmethod
async
¶
Retrieves the push notification configuration for a specific task.
resubscribe(request, *, context=None)
abstractmethod
async
¶
Resubscribes to a task's event stream.
send_message(request, *, context=None)
abstractmethod
async
¶
Sends a message to the server.
This will automatically use the streaming or non-streaming approach
as supported by the server and the client config. Client will
aggregate update events and return an iterator of (Task
,Update
)
pairs, or a Message
. Client will also send these values to any
configured Consumer
s in the client.
set_task_callback(request, *, context=None)
abstractmethod
async
¶
Sets or updates the push notification configuration for a specific task.
ClientCallContext
¶
Bases: BaseModel
A context passed with each client call, allowing for call-specific.
configuration and data passing. Such as authentication details or request deadlines.
state = Field(default_factory=dict)
class-attribute
instance-attribute
¶
ClientCallInterceptor
¶
Bases: ABC
An abstract base class for client-side call interceptors.
Interceptors can inspect and modify requests before they are sent, which is ideal for concerns like authentication, logging, or tracing.
intercept(method_name, request_payload, http_kwargs, agent_card, context)
abstractmethod
async
¶
Intercepts a client call before the request is sent.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
method_name
|
str
|
The name of the RPC method (e.g., 'message/send'). |
required |
request_payload
|
dict[str, Any]
|
The JSON RPC request payload dictionary. |
required |
http_kwargs
|
dict[str, Any]
|
The keyword arguments for the httpx request. |
required |
agent_card
|
AgentCard | None
|
The AgentCard associated with the client. |
required |
context
|
ClientCallContext | None
|
The ClientCallContext for this specific call. |
required |
Returns:
Type | Description |
---|---|
dict[str, Any]
|
A tuple containing the (potentially modified) request_payload |
dict[str, Any]
|
and http_kwargs. |
ClientConfig
dataclass
¶
Configuration class for the A2AClient Factory.
accepted_output_modes = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
¶
The set of accepted output modes for the client.
grpc_channel_factory = None
class-attribute
instance-attribute
¶
Generates a grpc connection channel for a given url.
httpx_client = None
class-attribute
instance-attribute
¶
Http client to use to connect to agent.
polling = False
class-attribute
instance-attribute
¶
Whether client prefers to poll for updates from message:send. It is the callers job to check if the response is completed and if not run a polling loop.
push_notification_configs = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
¶
Push notification callbacks to use for every request.
streaming = True
class-attribute
instance-attribute
¶
Whether client supports streaming
supported_transports = dataclasses.field(default_factory=list)
class-attribute
instance-attribute
¶
Ordered list of transports for connecting to agent (in order of preference). Empty implies JSONRPC only.
This is a string type to allow custom transports to exist in closed ecosystems.
use_client_preference = False
class-attribute
instance-attribute
¶
Whether to use client transport preferences over server preferences. Recommended to use server preferences in most situations.
ClientFactory
¶
ClientFactory is used to generate the appropriate client for the agent.
The factory is configured with a ClientConfig
and optionally a list of
Consumer
s to use for all generated Client
s. The expected use is:
factory = ClientFactory(config, consumers)
Optionally register custom client implementations¶
factory.register('my_customer_transport', NewCustomTransportClient)
Then with an agent card make a client with additional consumers and¶
interceptors¶
client = factory.create(card, additional_consumers, interceptors)
Now the client can be used the same regardless of transport and¶
aligns client config with server capabilities.¶
create(card, consumers=None, interceptors=None)
¶
Create a new Client
for the provided AgentCard
.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
card
|
AgentCard
|
An |
required |
consumers
|
list[Consumer] | None
|
A list of |
None
|
interceptors
|
list[ClientCallInterceptor] | None
|
A list of interceptors to use for each request. These are used for things like attaching credentials or http headers to all outbound requests. |
None
|
Returns:
Type | Description |
---|---|
Client
|
A |
register(label, generator)
¶
Register a new transport producer for a given transport label.
CredentialService
¶
Bases: ABC
An abstract service for retrieving credentials.
get_credentials(security_scheme_name, context)
abstractmethod
async
¶
Retrieves a credential (e.g., token) for a security scheme.
InMemoryContextCredentialStore
¶
Bases: CredentialService
A simple in-memory store for session-keyed credentials.
This class uses the 'sessionId' from the ClientCallContext state to store and retrieve credentials...
get_credentials(security_scheme_name, context)
async
¶
Retrieves credentials from the in-memory store.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
security_scheme_name
|
str
|
The name of the security scheme. |
required |
context
|
ClientCallContext | None
|
The client call context. |
required |
Returns:
Type | Description |
---|---|
str | None
|
The credential string, or None if not found. |
set_credentials(session_id, security_scheme_name, credential)
async
¶
Method to populate the store.
create_text_message_object(role=Role.user, content='')
¶
Create a Message object containing a single TextPart.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
role
|
Role
|
The role of the message sender (user or agent). Defaults to Role.user. |
user
|
content
|
str
|
The text content of the message. Defaults to an empty string. |
''
|
Returns:
Type | Description |
---|---|
Message
|
A |
minimal_agent_card(url, transports=None)
¶
Generates a minimal card to simplify bootstrapping client creation.
This minimal card is not viable itself to interact with the remote agent. Instead this is a short hand way to take a known url and transport option and interact with the get card endpoint of the agent server to get the correct agent card. This pattern is necessary for gRPC based card access as typically these servers won't expose a well known path card.
Server¶
Types¶
A2AError
¶
Bases: RootModel[JSONParseError | InvalidRequestError | MethodNotFoundError | InvalidParamsError | InternalError | TaskNotFoundError | TaskNotCancelableError | PushNotificationNotSupportedError | UnsupportedOperationError | ContentTypeNotSupportedError | InvalidAgentResponseError | AuthenticatedExtendedCardNotConfiguredError]
root
instance-attribute
¶
A discriminated union of all standard JSON-RPC and A2A-specific error types.
A2ARequest
¶
Bases: RootModel[SendMessageRequest | SendStreamingMessageRequest | GetTaskRequest | CancelTaskRequest | SetTaskPushNotificationConfigRequest | GetTaskPushNotificationConfigRequest | TaskResubscriptionRequest | ListTaskPushNotificationConfigRequest | DeleteTaskPushNotificationConfigRequest | GetAuthenticatedExtendedCardRequest]
root
instance-attribute
¶
A discriminated union representing all possible JSON-RPC 2.0 requests supported by the A2A specification.
APIKeySecurityScheme
¶
Bases: A2ABaseModel
Defines a security scheme using an API key.
description = None
class-attribute
instance-attribute
¶
An optional description for the security scheme.
in_
instance-attribute
¶
The location of the API key.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
name
instance-attribute
¶
The name of the header, query, or cookie parameter to be used.
type = 'apiKey'
class-attribute
instance-attribute
¶
The type of the security scheme. Must be 'apiKey'.
AgentCapabilities
¶
Bases: A2ABaseModel
Defines optional capabilities supported by an agent.
extensions = None
class-attribute
instance-attribute
¶
A list of protocol extensions supported by the agent.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
push_notifications = None
class-attribute
instance-attribute
¶
Indicates if the agent supports sending push notifications for asynchronous task updates.
state_transition_history = None
class-attribute
instance-attribute
¶
Indicates if the agent provides a history of state transitions for a task.
streaming = None
class-attribute
instance-attribute
¶
Indicates if the agent supports Server-Sent Events (SSE) for streaming responses.
AgentCard
¶
Bases: A2ABaseModel
The AgentCard is a self-describing manifest for an agent. It provides essential metadata including the agent's identity, capabilities, skills, supported communication methods, and security requirements.
additional_interfaces = None
class-attribute
instance-attribute
¶
A list of additional supported interfaces (transport and URL combinations). This allows agents to expose multiple transports, potentially at different URLs.
Best practices: - SHOULD include all supported transports for completeness - SHOULD include an entry matching the main 'url' and 'preferredTransport' - MAY reuse URLs if multiple transports are available at the same endpoint - MUST accurately declare the transport available at each URL
Clients can select any interface from this list based on their transport capabilities and preferences. This enables transport negotiation and fallback scenarios.
capabilities
instance-attribute
¶
A declaration of optional capabilities supported by the agent.
default_input_modes
instance-attribute
¶
Default set of supported input MIME types for all skills, which can be overridden on a per-skill basis.
default_output_modes
instance-attribute
¶
Default set of supported output MIME types for all skills, which can be overridden on a per-skill basis.
description = Field(..., examples=['Agent that helps users with recipes and cooking.'])
class-attribute
instance-attribute
¶
A human-readable description of the agent, assisting users and other agents in understanding its purpose.
documentation_url = None
class-attribute
instance-attribute
¶
An optional URL to the agent's documentation.
icon_url = None
class-attribute
instance-attribute
¶
An optional URL to an icon for the agent.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
name = Field(..., examples=['Recipe Agent'])
class-attribute
instance-attribute
¶
A human-readable name for the agent.
preferred_transport = Field(default='JSONRPC', examples=['JSONRPC', 'GRPC', 'HTTP+JSON'])
class-attribute
instance-attribute
¶
The transport protocol for the preferred endpoint (the main 'url' field). If not specified, defaults to 'JSONRPC'.
IMPORTANT: The transport specified here MUST be available at the main 'url'. This creates a binding between the main URL and its supported transport protocol. Clients should prefer this transport and URL combination when both are supported.
protocol_version = '0.3.0'
class-attribute
instance-attribute
¶
The version of the A2A protocol this agent supports.
provider = None
class-attribute
instance-attribute
¶
Information about the agent's service provider.
security = Field(default=None, examples=[[{'oauth': ['read']}, {'api-key': [], 'mtls': []}]])
class-attribute
instance-attribute
¶
A list of security requirement objects that apply to all agent interactions. Each object lists security schemes that can be used. Follows the OpenAPI 3.0 Security Requirement Object. This list can be seen as an OR of ANDs. Each object in the list describes one possible set of security requirements that must be present on a request. This allows specifying, for example, "callers must either use OAuth OR an API Key AND mTLS."
security_schemes = None
class-attribute
instance-attribute
¶
A declaration of the security schemes available to authorize requests. The key is the scheme name. Follows the OpenAPI 3.0 Security Scheme Object.
signatures = None
class-attribute
instance-attribute
¶
JSON Web Signatures computed for this AgentCard.
skills
instance-attribute
¶
The set of skills, or distinct capabilities, that the agent can perform.
supports_authenticated_extended_card = None
class-attribute
instance-attribute
¶
If true, the agent can provide an extended agent card with additional details to authenticated users. Defaults to false.
url = Field(..., examples=['https://api.example.com/a2a/v1'])
class-attribute
instance-attribute
¶
The preferred endpoint URL for interacting with the agent. This URL MUST support the transport specified by 'preferredTransport'.
version = Field(..., examples=['1.0.0'])
class-attribute
instance-attribute
¶
The agent's own version number. The format is defined by the provider.
AgentCardSignature
¶
Bases: A2ABaseModel
AgentCardSignature represents a JWS signature of an AgentCard. This follows the JSON format of an RFC 7515 JSON Web Signature (JWS).
header = None
class-attribute
instance-attribute
¶
The unprotected JWS header values.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
protected
instance-attribute
¶
The protected JWS header for the signature. This is a Base64url-encoded JSON object, as per RFC 7515.
signature
instance-attribute
¶
The computed signature, Base64url-encoded.
AgentExtension
¶
Bases: A2ABaseModel
A declaration of a protocol extension supported by an Agent.
description = None
class-attribute
instance-attribute
¶
A human-readable description of how this agent uses the extension.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
params = None
class-attribute
instance-attribute
¶
Optional, extension-specific configuration parameters.
required = None
class-attribute
instance-attribute
¶
If true, the client must understand and comply with the extension's requirements to interact with the agent.
uri
instance-attribute
¶
The unique URI identifying the extension.
AgentInterface
¶
Bases: A2ABaseModel
Declares a combination of a target URL and a transport protocol for interacting with the agent. This allows agents to expose the same functionality over multiple transport mechanisms.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
transport = Field(..., examples=['JSONRPC', 'GRPC', 'HTTP+JSON'])
class-attribute
instance-attribute
¶
The transport protocol supported at this URL.
url = Field(..., examples=['https://api.example.com/a2a/v1', 'https://grpc.example.com/a2a', 'https://rest.example.com/v1'])
class-attribute
instance-attribute
¶
The URL where this interface is available. Must be a valid absolute HTTPS URL in production.
AgentProvider
¶
Bases: A2ABaseModel
Represents the service provider of an agent.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
organization
instance-attribute
¶
The name of the agent provider's organization.
url
instance-attribute
¶
A URL for the agent provider's website or relevant documentation.
AgentSkill
¶
Bases: A2ABaseModel
Represents a distinct capability or function that an agent can perform.
description
instance-attribute
¶
A detailed description of the skill, intended to help clients or users understand its purpose and functionality.
examples = Field(default=None, examples=[['I need a recipe for bread']])
class-attribute
instance-attribute
¶
Example prompts or scenarios that this skill can handle. Provides a hint to the client on how to use the skill.
id
instance-attribute
¶
A unique identifier for the agent's skill.
input_modes = None
class-attribute
instance-attribute
¶
The set of supported input MIME types for this skill, overriding the agent's defaults.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
name
instance-attribute
¶
A human-readable name for the skill.
output_modes = None
class-attribute
instance-attribute
¶
The set of supported output MIME types for this skill, overriding the agent's defaults.
security = Field(default=None, examples=[[{'google': ['oidc']}]])
class-attribute
instance-attribute
¶
Security schemes necessary for the agent to leverage this skill. As in the overall AgentCard.security, this list represents a logical OR of security requirement objects. Each object is a set of security schemes that must be used together (a logical AND).
tags = Field(..., examples=[['cooking', 'customer support', 'billing']])
class-attribute
instance-attribute
¶
A set of keywords describing the skill's capabilities.
Artifact
¶
Bases: A2ABaseModel
Represents a file, data structure, or other resource generated by an agent during a task.
artifact_id
instance-attribute
¶
A unique identifier (e.g. UUID) for the artifact within the scope of the task.
description = None
class-attribute
instance-attribute
¶
An optional, human-readable description of the artifact.
extensions = None
class-attribute
instance-attribute
¶
The URIs of extensions that are relevant to this artifact.
metadata = None
class-attribute
instance-attribute
¶
Optional metadata for extensions. The key is an extension-specific identifier.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
name = None
class-attribute
instance-attribute
¶
An optional, human-readable name for the artifact.
parts
instance-attribute
¶
An array of content parts that make up the artifact.
AuthenticatedExtendedCardNotConfiguredError
¶
Bases: A2ABaseModel
An A2A-specific error indicating that the agent does not have an Authenticated Extended Card configured
code = -32007
class-attribute
instance-attribute
¶
The error code for when an authenticated extended card is not configured.
data = None
class-attribute
instance-attribute
¶
A primitive or structured value containing additional information about the error. This may be omitted.
message = 'Authenticated Extended Card is not configured'
class-attribute
instance-attribute
¶
The error message.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
AuthorizationCodeOAuthFlow
¶
Bases: A2ABaseModel
Defines configuration details for the OAuth 2.0 Authorization Code flow.
authorization_url
instance-attribute
¶
The authorization URL to be used for this flow. This MUST be a URL and use TLS.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
refresh_url = None
class-attribute
instance-attribute
¶
The URL to be used for obtaining refresh tokens. This MUST be a URL and use TLS.
scopes
instance-attribute
¶
The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.
token_url
instance-attribute
¶
The token URL to be used for this flow. This MUST be a URL and use TLS.
CancelTaskRequest
¶
Bases: A2ABaseModel
Represents a JSON-RPC request for the tasks/cancel
method.
id
instance-attribute
¶
The identifier for this request.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
method = 'tasks/cancel'
class-attribute
instance-attribute
¶
The method name. Must be 'tasks/cancel'.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
params
instance-attribute
¶
The parameters identifying the task to cancel.
CancelTaskResponse
¶
Bases: RootModel[JSONRPCErrorResponse | CancelTaskSuccessResponse]
root
instance-attribute
¶
Represents a JSON-RPC response for the tasks/cancel
method.
CancelTaskSuccessResponse
¶
Bases: A2ABaseModel
Represents a successful JSON-RPC response for the tasks/cancel
method.
id = None
class-attribute
instance-attribute
¶
The identifier established by the client.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
result
instance-attribute
¶
The result, containing the final state of the canceled Task object.
ClientCredentialsOAuthFlow
¶
Bases: A2ABaseModel
Defines configuration details for the OAuth 2.0 Client Credentials flow.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
refresh_url = None
class-attribute
instance-attribute
¶
The URL to be used for obtaining refresh tokens. This MUST be a URL.
scopes
instance-attribute
¶
The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.
token_url
instance-attribute
¶
The token URL to be used for this flow. This MUST be a URL.
ContentTypeNotSupportedError
¶
Bases: A2ABaseModel
An A2A-specific error indicating an incompatibility between the requested content types and the agent's capabilities.
code = -32005
class-attribute
instance-attribute
¶
The error code for an unsupported content type.
data = None
class-attribute
instance-attribute
¶
A primitive or structured value containing additional information about the error. This may be omitted.
message = 'Incompatible content types'
class-attribute
instance-attribute
¶
The error message.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
DataPart
¶
Bases: A2ABaseModel
Represents a structured data segment (e.g., JSON) within a message or artifact.
data
instance-attribute
¶
The structured data content.
kind = 'data'
class-attribute
instance-attribute
¶
The type of this part, used as a discriminator. Always 'data'.
metadata = None
class-attribute
instance-attribute
¶
Optional metadata associated with this part.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
DeleteTaskPushNotificationConfigParams
¶
Bases: A2ABaseModel
Defines parameters for deleting a specific push notification configuration for a task.
id
instance-attribute
¶
The unique identifier (e.g. UUID) of the task.
metadata = None
class-attribute
instance-attribute
¶
Optional metadata associated with the request.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
push_notification_config_id
instance-attribute
¶
The ID of the push notification configuration to delete.
DeleteTaskPushNotificationConfigRequest
¶
Bases: A2ABaseModel
Represents a JSON-RPC request for the tasks/pushNotificationConfig/delete
method.
id
instance-attribute
¶
The identifier for this request.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
method = 'tasks/pushNotificationConfig/delete'
class-attribute
instance-attribute
¶
The method name. Must be 'tasks/pushNotificationConfig/delete'.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
params
instance-attribute
¶
The parameters identifying the push notification configuration to delete.
DeleteTaskPushNotificationConfigResponse
¶
Bases: RootModel[JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse]
root
instance-attribute
¶
Represents a JSON-RPC response for the tasks/pushNotificationConfig/delete
method.
DeleteTaskPushNotificationConfigSuccessResponse
¶
Bases: A2ABaseModel
Represents a successful JSON-RPC response for the tasks/pushNotificationConfig/delete
method.
id = None
class-attribute
instance-attribute
¶
The identifier established by the client.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
result
instance-attribute
¶
The result is null on successful deletion.
FileBase
¶
Bases: A2ABaseModel
Defines base properties for a file.
mime_type = None
class-attribute
instance-attribute
¶
The MIME type of the file (e.g., "application/pdf").
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
name = None
class-attribute
instance-attribute
¶
An optional name for the file (e.g., "document.pdf").
FilePart
¶
Bases: A2ABaseModel
Represents a file segment within a message or artifact. The file content can be provided either directly as bytes or as a URI.
file
instance-attribute
¶
The file content, represented as either a URI or as base64-encoded bytes.
kind = 'file'
class-attribute
instance-attribute
¶
The type of this part, used as a discriminator. Always 'file'.
metadata = None
class-attribute
instance-attribute
¶
Optional metadata associated with this part.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
FileWithBytes
¶
Bases: A2ABaseModel
Represents a file with its content provided directly as a base64-encoded string.
bytes
instance-attribute
¶
The base64-encoded content of the file.
mime_type = None
class-attribute
instance-attribute
¶
The MIME type of the file (e.g., "application/pdf").
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
name = None
class-attribute
instance-attribute
¶
An optional name for the file (e.g., "document.pdf").
FileWithUri
¶
Bases: A2ABaseModel
Represents a file with its content located at a specific URI.
mime_type = None
class-attribute
instance-attribute
¶
The MIME type of the file (e.g., "application/pdf").
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
name = None
class-attribute
instance-attribute
¶
An optional name for the file (e.g., "document.pdf").
uri
instance-attribute
¶
A URL pointing to the file's content.
GetAuthenticatedExtendedCardRequest
¶
Bases: A2ABaseModel
Represents a JSON-RPC request for the agent/getAuthenticatedExtendedCard
method.
id
instance-attribute
¶
The identifier for this request.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
method = 'agent/getAuthenticatedExtendedCard'
class-attribute
instance-attribute
¶
The method name. Must be 'agent/getAuthenticatedExtendedCard'.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
GetAuthenticatedExtendedCardResponse
¶
Bases: RootModel[JSONRPCErrorResponse | GetAuthenticatedExtendedCardSuccessResponse]
root
instance-attribute
¶
Represents a JSON-RPC response for the agent/getAuthenticatedExtendedCard
method.
GetAuthenticatedExtendedCardSuccessResponse
¶
Bases: A2ABaseModel
Represents a successful JSON-RPC response for the agent/getAuthenticatedExtendedCard
method.
id = None
class-attribute
instance-attribute
¶
The identifier established by the client.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
result
instance-attribute
¶
The result is an Agent Card object.
GetTaskPushNotificationConfigParams
¶
Bases: A2ABaseModel
Defines parameters for fetching a specific push notification configuration for a task.
id
instance-attribute
¶
The unique identifier (e.g. UUID) of the task.
metadata = None
class-attribute
instance-attribute
¶
Optional metadata associated with the request.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
push_notification_config_id = None
class-attribute
instance-attribute
¶
The ID of the push notification configuration to retrieve.
GetTaskPushNotificationConfigRequest
¶
Bases: A2ABaseModel
Represents a JSON-RPC request for the tasks/pushNotificationConfig/get
method.
id
instance-attribute
¶
The identifier for this request.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
method = 'tasks/pushNotificationConfig/get'
class-attribute
instance-attribute
¶
The method name. Must be 'tasks/pushNotificationConfig/get'.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
params
instance-attribute
¶
The parameters for getting a push notification configuration.
GetTaskPushNotificationConfigResponse
¶
Bases: RootModel[JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse]
root
instance-attribute
¶
Represents a JSON-RPC response for the tasks/pushNotificationConfig/get
method.
GetTaskPushNotificationConfigSuccessResponse
¶
Bases: A2ABaseModel
Represents a successful JSON-RPC response for the tasks/pushNotificationConfig/get
method.
id = None
class-attribute
instance-attribute
¶
The identifier established by the client.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
result
instance-attribute
¶
The result, containing the requested push notification configuration.
GetTaskRequest
¶
Bases: A2ABaseModel
Represents a JSON-RPC request for the tasks/get
method.
id
instance-attribute
¶
The identifier for this request.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
method = 'tasks/get'
class-attribute
instance-attribute
¶
The method name. Must be 'tasks/get'.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
params
instance-attribute
¶
The parameters for querying a task.
GetTaskResponse
¶
Bases: RootModel[JSONRPCErrorResponse | GetTaskSuccessResponse]
root
instance-attribute
¶
Represents a JSON-RPC response for the tasks/get
method.
GetTaskSuccessResponse
¶
Bases: A2ABaseModel
Represents a successful JSON-RPC response for the tasks/get
method.
id = None
class-attribute
instance-attribute
¶
The identifier established by the client.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
result
instance-attribute
¶
The result, containing the requested Task object.
HTTPAuthSecurityScheme
¶
Bases: A2ABaseModel
Defines a security scheme using HTTP authentication.
bearer_format = None
class-attribute
instance-attribute
¶
A hint to the client to identify how the bearer token is formatted (e.g., "JWT"). This is primarily for documentation purposes.
description = None
class-attribute
instance-attribute
¶
An optional description for the security scheme.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
scheme
instance-attribute
¶
The name of the HTTP Authentication scheme to be used in the Authorization header, as defined in RFC7235 (e.g., "Bearer"). This value should be registered in the IANA Authentication Scheme registry.
type = 'http'
class-attribute
instance-attribute
¶
The type of the security scheme. Must be 'http'.
ImplicitOAuthFlow
¶
Bases: A2ABaseModel
Defines configuration details for the OAuth 2.0 Implicit flow.
authorization_url
instance-attribute
¶
The authorization URL to be used for this flow. This MUST be a URL.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
refresh_url = None
class-attribute
instance-attribute
¶
The URL to be used for obtaining refresh tokens. This MUST be a URL.
scopes
instance-attribute
¶
The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.
In
¶
InternalError
¶
Bases: A2ABaseModel
An error indicating an internal error on the server.
code = -32603
class-attribute
instance-attribute
¶
The error code for an internal server error.
data = None
class-attribute
instance-attribute
¶
A primitive or structured value containing additional information about the error. This may be omitted.
message = 'Internal error'
class-attribute
instance-attribute
¶
The error message.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
InvalidAgentResponseError
¶
Bases: A2ABaseModel
An A2A-specific error indicating that the agent returned a response that does not conform to the specification for the current method.
code = -32006
class-attribute
instance-attribute
¶
The error code for an invalid agent response.
data = None
class-attribute
instance-attribute
¶
A primitive or structured value containing additional information about the error. This may be omitted.
message = 'Invalid agent response'
class-attribute
instance-attribute
¶
The error message.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
InvalidParamsError
¶
Bases: A2ABaseModel
An error indicating that the method parameters are invalid.
code = -32602
class-attribute
instance-attribute
¶
The error code for an invalid parameters error.
data = None
class-attribute
instance-attribute
¶
A primitive or structured value containing additional information about the error. This may be omitted.
message = 'Invalid parameters'
class-attribute
instance-attribute
¶
The error message.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
InvalidRequestError
¶
Bases: A2ABaseModel
An error indicating that the JSON sent is not a valid Request object.
code = -32600
class-attribute
instance-attribute
¶
The error code for an invalid request.
data = None
class-attribute
instance-attribute
¶
A primitive or structured value containing additional information about the error. This may be omitted.
message = 'Request payload validation error'
class-attribute
instance-attribute
¶
The error message.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
JSONParseError
¶
Bases: A2ABaseModel
An error indicating that the server received invalid JSON.
code = -32700
class-attribute
instance-attribute
¶
The error code for a JSON parse error.
data = None
class-attribute
instance-attribute
¶
A primitive or structured value containing additional information about the error. This may be omitted.
message = 'Invalid JSON payload'
class-attribute
instance-attribute
¶
The error message.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
JSONRPCError
¶
Bases: A2ABaseModel
Represents a JSON-RPC 2.0 Error object, included in an error response.
code
instance-attribute
¶
A number that indicates the error type that occurred.
data = None
class-attribute
instance-attribute
¶
A primitive or structured value containing additional information about the error. This may be omitted.
message
instance-attribute
¶
A string providing a short description of the error.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
JSONRPCErrorResponse
¶
Bases: A2ABaseModel
Represents a JSON-RPC 2.0 Error Response object.
error
instance-attribute
¶
An object describing the error that occurred.
id = None
class-attribute
instance-attribute
¶
The identifier established by the client.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
JSONRPCMessage
¶
Bases: A2ABaseModel
Defines the base structure for any JSON-RPC 2.0 request, response, or notification.
id = None
class-attribute
instance-attribute
¶
A unique identifier established by the client. It must be a String, a Number, or null. The server must reply with the same value in the response. This property is omitted for notifications.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
JSONRPCRequest
¶
Bases: A2ABaseModel
Represents a JSON-RPC 2.0 Request object.
id = None
class-attribute
instance-attribute
¶
A unique identifier established by the client. It must be a String, a Number, or null. The server must reply with the same value in the response. This property is omitted for notifications.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
method
instance-attribute
¶
A string containing the name of the method to be invoked.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
params = None
class-attribute
instance-attribute
¶
A structured value holding the parameter values to be used during the method invocation.
JSONRPCResponse
¶
Bases: RootModel[JSONRPCErrorResponse | SendMessageSuccessResponse | SendStreamingMessageSuccessResponse | GetTaskSuccessResponse | CancelTaskSuccessResponse | SetTaskPushNotificationConfigSuccessResponse | GetTaskPushNotificationConfigSuccessResponse | ListTaskPushNotificationConfigSuccessResponse | DeleteTaskPushNotificationConfigSuccessResponse | GetAuthenticatedExtendedCardSuccessResponse]
root
instance-attribute
¶
A discriminated union representing all possible JSON-RPC 2.0 responses for the A2A specification methods.
JSONRPCSuccessResponse
¶
Bases: A2ABaseModel
Represents a successful JSON-RPC 2.0 Response object.
id = None
class-attribute
instance-attribute
¶
The identifier established by the client.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
result
instance-attribute
¶
The value of this member is determined by the method invoked on the Server.
ListTaskPushNotificationConfigParams
¶
Bases: A2ABaseModel
Defines parameters for listing all push notification configurations associated with a task.
id
instance-attribute
¶
The unique identifier (e.g. UUID) of the task.
metadata = None
class-attribute
instance-attribute
¶
Optional metadata associated with the request.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
ListTaskPushNotificationConfigRequest
¶
Bases: A2ABaseModel
Represents a JSON-RPC request for the tasks/pushNotificationConfig/list
method.
id
instance-attribute
¶
The identifier for this request.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
method = 'tasks/pushNotificationConfig/list'
class-attribute
instance-attribute
¶
The method name. Must be 'tasks/pushNotificationConfig/list'.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
params
instance-attribute
¶
The parameters identifying the task whose configurations are to be listed.
ListTaskPushNotificationConfigResponse
¶
Bases: RootModel[JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse]
root
instance-attribute
¶
Represents a JSON-RPC response for the tasks/pushNotificationConfig/list
method.
ListTaskPushNotificationConfigSuccessResponse
¶
Bases: A2ABaseModel
Represents a successful JSON-RPC response for the tasks/pushNotificationConfig/list
method.
id = None
class-attribute
instance-attribute
¶
The identifier established by the client.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
result
instance-attribute
¶
The result, containing an array of all push notification configurations for the task.
Message
¶
Bases: A2ABaseModel
Represents a single message in the conversation between a user and an agent.
context_id = None
class-attribute
instance-attribute
¶
The context ID for this message, used to group related interactions.
extensions = None
class-attribute
instance-attribute
¶
The URIs of extensions that are relevant to this message.
kind = 'message'
class-attribute
instance-attribute
¶
The type of this object, used as a discriminator. Always 'message' for a Message.
message_id
instance-attribute
¶
A unique identifier for the message, typically a UUID, generated by the sender.
metadata = None
class-attribute
instance-attribute
¶
Optional metadata for extensions. The key is an extension-specific identifier.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
parts
instance-attribute
¶
An array of content parts that form the message body. A message can be composed of multiple parts of different types (e.g., text and files).
reference_task_ids = None
class-attribute
instance-attribute
¶
A list of other task IDs that this message references for additional context.
role
instance-attribute
¶
Identifies the sender of the message. user
for the client, agent
for the service.
task_id = None
class-attribute
instance-attribute
¶
The ID of the task this message is part of. Can be omitted for the first message of a new task.
MessageSendConfiguration
¶
Bases: A2ABaseModel
Defines configuration options for a message/send
or message/stream
request.
accepted_output_modes = None
class-attribute
instance-attribute
¶
A list of output MIME types the client is prepared to accept in the response.
blocking = None
class-attribute
instance-attribute
¶
If true, the client will wait for the task to complete. The server may reject this if the task is long-running.
history_length = None
class-attribute
instance-attribute
¶
The number of most recent messages from the task's history to retrieve in the response.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
push_notification_config = None
class-attribute
instance-attribute
¶
Configuration for the agent to send push notifications for updates after the initial response.
MessageSendParams
¶
Bases: A2ABaseModel
Defines the parameters for a request to send a message to an agent. This can be used to create a new task, continue an existing one, or restart a task.
configuration = None
class-attribute
instance-attribute
¶
Optional configuration for the send request.
message
instance-attribute
¶
The message object being sent to the agent.
metadata = None
class-attribute
instance-attribute
¶
Optional metadata for extensions.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
MethodNotFoundError
¶
Bases: A2ABaseModel
An error indicating that the requested method does not exist or is not available.
code = -32601
class-attribute
instance-attribute
¶
The error code for a method not found error.
data = None
class-attribute
instance-attribute
¶
A primitive or structured value containing additional information about the error. This may be omitted.
message = 'Method not found'
class-attribute
instance-attribute
¶
The error message.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
MutualTLSSecurityScheme
¶
Bases: A2ABaseModel
Defines a security scheme using mTLS authentication.
description = None
class-attribute
instance-attribute
¶
An optional description for the security scheme.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
type = 'mutualTLS'
class-attribute
instance-attribute
¶
The type of the security scheme. Must be 'mutualTLS'.
OAuth2SecurityScheme
¶
Bases: A2ABaseModel
Defines a security scheme using OAuth 2.0.
description = None
class-attribute
instance-attribute
¶
An optional description for the security scheme.
flows
instance-attribute
¶
An object containing configuration information for the supported OAuth 2.0 flows.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
oauth2_metadata_url = None
class-attribute
instance-attribute
¶
URL to the oauth2 authorization server metadata RFC8414. TLS is required.
type = 'oauth2'
class-attribute
instance-attribute
¶
The type of the security scheme. Must be 'oauth2'.
OAuthFlows
¶
Bases: A2ABaseModel
Defines the configuration for the supported OAuth 2.0 flows.
authorization_code = None
class-attribute
instance-attribute
¶
Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.
client_credentials = None
class-attribute
instance-attribute
¶
Configuration for the OAuth Client Credentials flow. Previously called application in OpenAPI 2.0.
implicit = None
class-attribute
instance-attribute
¶
Configuration for the OAuth Implicit flow.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
password = None
class-attribute
instance-attribute
¶
Configuration for the OAuth Resource Owner Password flow.
OpenIdConnectSecurityScheme
¶
Bases: A2ABaseModel
Defines a security scheme using OpenID Connect.
description = None
class-attribute
instance-attribute
¶
An optional description for the security scheme.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
open_id_connect_url
instance-attribute
¶
The OpenID Connect Discovery URL for the OIDC provider's metadata.
type = 'openIdConnect'
class-attribute
instance-attribute
¶
The type of the security scheme. Must be 'openIdConnect'.
Part
¶
PartBase
¶
Bases: A2ABaseModel
Defines base properties common to all message or artifact parts.
PasswordOAuthFlow
¶
Bases: A2ABaseModel
Defines configuration details for the OAuth 2.0 Resource Owner Password flow.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
refresh_url = None
class-attribute
instance-attribute
¶
The URL to be used for obtaining refresh tokens. This MUST be a URL.
scopes
instance-attribute
¶
The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it.
token_url
instance-attribute
¶
The token URL to be used for this flow. This MUST be a URL.
PushNotificationAuthenticationInfo
¶
Bases: A2ABaseModel
Defines authentication details for a push notification endpoint.
credentials = None
class-attribute
instance-attribute
¶
Optional credentials required by the push notification endpoint.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
schemes
instance-attribute
¶
A list of supported authentication schemes (e.g., 'Basic', 'Bearer').
PushNotificationConfig
¶
Bases: A2ABaseModel
Defines the configuration for setting up push notifications for task updates.
authentication = None
class-attribute
instance-attribute
¶
Optional authentication details for the agent to use when calling the notification URL.
id = None
class-attribute
instance-attribute
¶
A unique identifier (e.g. UUID) for the push notification configuration, set by the client to support multiple notification callbacks.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
token = None
class-attribute
instance-attribute
¶
A unique token for this task or session to validate incoming push notifications.
url
instance-attribute
¶
The callback URL where the agent should send push notifications.
PushNotificationNotSupportedError
¶
Bases: A2ABaseModel
An A2A-specific error indicating that the agent does not support push notifications.
code = -32003
class-attribute
instance-attribute
¶
The error code for when push notifications are not supported.
data = None
class-attribute
instance-attribute
¶
A primitive or structured value containing additional information about the error. This may be omitted.
message = 'Push Notification is not supported'
class-attribute
instance-attribute
¶
The error message.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
Role
¶
SecurityScheme
¶
Bases: RootModel[APIKeySecurityScheme | HTTPAuthSecurityScheme | OAuth2SecurityScheme | OpenIdConnectSecurityScheme | MutualTLSSecurityScheme]
root
instance-attribute
¶
Defines a security scheme that can be used to secure an agent's endpoints. This is a discriminated union type based on the OpenAPI 3.0 Security Scheme Object.
SecuritySchemeBase
¶
Bases: A2ABaseModel
Defines base properties shared by all security scheme objects.
SendMessageRequest
¶
Bases: A2ABaseModel
Represents a JSON-RPC request for the message/send
method.
id
instance-attribute
¶
The identifier for this request.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
method = 'message/send'
class-attribute
instance-attribute
¶
The method name. Must be 'message/send'.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
params
instance-attribute
¶
The parameters for sending a message.
SendMessageResponse
¶
Bases: RootModel[JSONRPCErrorResponse | SendMessageSuccessResponse]
root
instance-attribute
¶
Represents a JSON-RPC response for the message/send
method.
SendMessageSuccessResponse
¶
Bases: A2ABaseModel
Represents a successful JSON-RPC response for the message/send
method.
id = None
class-attribute
instance-attribute
¶
The identifier established by the client.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
result
instance-attribute
¶
The result, which can be a direct reply Message or the initial Task object.
SendStreamingMessageRequest
¶
Bases: A2ABaseModel
Represents a JSON-RPC request for the message/stream
method.
id
instance-attribute
¶
The identifier for this request.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
method = 'message/stream'
class-attribute
instance-attribute
¶
The method name. Must be 'message/stream'.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
params
instance-attribute
¶
The parameters for sending a message.
SendStreamingMessageResponse
¶
Bases: RootModel[JSONRPCErrorResponse | SendStreamingMessageSuccessResponse]
root
instance-attribute
¶
Represents a JSON-RPC response for the message/stream
method.
SendStreamingMessageSuccessResponse
¶
Bases: A2ABaseModel
Represents a successful JSON-RPC response for the message/stream
method.
The server may send multiple response objects for a single request.
id = None
class-attribute
instance-attribute
¶
The identifier established by the client.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
result
instance-attribute
¶
The result, which can be a Message, Task, or a streaming update event.
SetTaskPushNotificationConfigRequest
¶
Bases: A2ABaseModel
Represents a JSON-RPC request for the tasks/pushNotificationConfig/set
method.
id
instance-attribute
¶
The identifier for this request.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
method = 'tasks/pushNotificationConfig/set'
class-attribute
instance-attribute
¶
The method name. Must be 'tasks/pushNotificationConfig/set'.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
params
instance-attribute
¶
The parameters for setting the push notification configuration.
SetTaskPushNotificationConfigResponse
¶
Bases: RootModel[JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse]
root
instance-attribute
¶
Represents a JSON-RPC response for the tasks/pushNotificationConfig/set
method.
SetTaskPushNotificationConfigSuccessResponse
¶
Bases: A2ABaseModel
Represents a successful JSON-RPC response for the tasks/pushNotificationConfig/set
method.
id = None
class-attribute
instance-attribute
¶
The identifier established by the client.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
result
instance-attribute
¶
The result, containing the configured push notification settings.
Task
¶
Bases: A2ABaseModel
Represents a single, stateful operation or conversation between a client and an agent.
artifacts = None
class-attribute
instance-attribute
¶
A collection of artifacts generated by the agent during the execution of the task.
context_id
instance-attribute
¶
A server-generated unique identifier (e.g. UUID) for maintaining context across multiple related tasks or interactions.
history = None
class-attribute
instance-attribute
¶
An array of messages exchanged during the task, representing the conversation history.
id
instance-attribute
¶
A unique identifier (e.g. UUID) for the task, generated by the server for a new task.
kind = 'task'
class-attribute
instance-attribute
¶
The type of this object, used as a discriminator. Always 'task' for a Task.
metadata = None
class-attribute
instance-attribute
¶
Optional metadata for extensions. The key is an extension-specific identifier.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
status
instance-attribute
¶
The current status of the task, including its state and a descriptive message.
TaskArtifactUpdateEvent
¶
Bases: A2ABaseModel
An event sent by the agent to notify the client that an artifact has been generated or updated. This is typically used in streaming models.
append = None
class-attribute
instance-attribute
¶
If true, the content of this artifact should be appended to a previously sent artifact with the same ID.
artifact
instance-attribute
¶
The artifact that was generated or updated.
context_id
instance-attribute
¶
The context ID associated with the task.
kind = 'artifact-update'
class-attribute
instance-attribute
¶
The type of this event, used as a discriminator. Always 'artifact-update'.
last_chunk = None
class-attribute
instance-attribute
¶
If true, this is the final chunk of the artifact.
metadata = None
class-attribute
instance-attribute
¶
Optional metadata for extensions.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
task_id
instance-attribute
¶
The ID of the task this artifact belongs to.
TaskIdParams
¶
Bases: A2ABaseModel
Defines parameters containing a task ID, used for simple task operations.
id
instance-attribute
¶
The unique identifier (e.g. UUID) of the task.
metadata = None
class-attribute
instance-attribute
¶
Optional metadata associated with the request.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
TaskNotCancelableError
¶
Bases: A2ABaseModel
An A2A-specific error indicating that the task is in a state where it cannot be canceled.
code = -32002
class-attribute
instance-attribute
¶
The error code for a task that cannot be canceled.
data = None
class-attribute
instance-attribute
¶
A primitive or structured value containing additional information about the error. This may be omitted.
message = 'Task cannot be canceled'
class-attribute
instance-attribute
¶
The error message.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
TaskNotFoundError
¶
Bases: A2ABaseModel
An A2A-specific error indicating that the requested task ID was not found.
code = -32001
class-attribute
instance-attribute
¶
The error code for a task not found error.
data = None
class-attribute
instance-attribute
¶
A primitive or structured value containing additional information about the error. This may be omitted.
message = 'Task not found'
class-attribute
instance-attribute
¶
The error message.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
TaskPushNotificationConfig
¶
Bases: A2ABaseModel
A container associating a push notification configuration with a specific task.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
push_notification_config
instance-attribute
¶
The push notification configuration for this task.
task_id
instance-attribute
¶
The unique identifier (e.g. UUID) of the task.
TaskQueryParams
¶
Bases: A2ABaseModel
Defines parameters for querying a task, with an option to limit history length.
history_length = None
class-attribute
instance-attribute
¶
The number of most recent messages from the task's history to retrieve.
id
instance-attribute
¶
The unique identifier (e.g. UUID) of the task.
metadata = None
class-attribute
instance-attribute
¶
Optional metadata associated with the request.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
TaskResubscriptionRequest
¶
Bases: A2ABaseModel
Represents a JSON-RPC request for the tasks/resubscribe
method, used to resume a streaming connection.
id
instance-attribute
¶
The identifier for this request.
jsonrpc = '2.0'
class-attribute
instance-attribute
¶
The version of the JSON-RPC protocol. MUST be exactly "2.0".
method = 'tasks/resubscribe'
class-attribute
instance-attribute
¶
The method name. Must be 'tasks/resubscribe'.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
params
instance-attribute
¶
The parameters identifying the task to resubscribe to.
TaskState
¶
Bases: str
, Enum
Defines the lifecycle states of a Task.
auth_required = 'auth-required'
class-attribute
instance-attribute
¶
canceled = 'canceled'
class-attribute
instance-attribute
¶
completed = 'completed'
class-attribute
instance-attribute
¶
failed = 'failed'
class-attribute
instance-attribute
¶
input_required = 'input-required'
class-attribute
instance-attribute
¶
rejected = 'rejected'
class-attribute
instance-attribute
¶
submitted = 'submitted'
class-attribute
instance-attribute
¶
unknown = 'unknown'
class-attribute
instance-attribute
¶
working = 'working'
class-attribute
instance-attribute
¶
TaskStatus
¶
Bases: A2ABaseModel
Represents the status of a task at a specific point in time.
message = None
class-attribute
instance-attribute
¶
An optional, human-readable message providing more details about the current status.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
state
instance-attribute
¶
The current state of the task's lifecycle.
timestamp = Field(default=None, examples=['2023-10-27T10:00:00Z'])
class-attribute
instance-attribute
¶
An ISO 8601 datetime string indicating when this status was recorded.
TaskStatusUpdateEvent
¶
Bases: A2ABaseModel
An event sent by the agent to notify the client of a change in a task's status. This is typically used in streaming or subscription models.
context_id
instance-attribute
¶
The context ID associated with the task.
final
instance-attribute
¶
If true, this is the final event in the stream for this interaction.
kind = 'status-update'
class-attribute
instance-attribute
¶
The type of this event, used as a discriminator. Always 'status-update'.
metadata = None
class-attribute
instance-attribute
¶
Optional metadata for extensions.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
status
instance-attribute
¶
The new status of the task.
task_id
instance-attribute
¶
The ID of the task that was updated.
TextPart
¶
Bases: A2ABaseModel
Represents a text segment within a message or artifact.
kind = 'text'
class-attribute
instance-attribute
¶
The type of this part, used as a discriminator. Always 'text'.
metadata = None
class-attribute
instance-attribute
¶
Optional metadata associated with this part.
model_config = ConfigDict(validate_by_name=True, validate_by_alias=True, serialize_by_alias=True, alias_generator=to_camel_custom)
class-attribute
instance-attribute
¶
text
instance-attribute
¶
The string content of the text part.
TransportProtocol
¶
UnsupportedOperationError
¶
Bases: A2ABaseModel
An A2A-specific error indicating that the requested operation is not supported by the agent.
code = -32004
class-attribute
instance-attribute
¶
The error code for an unsupported operation.
data = None
class-attribute
instance-attribute
¶
A primitive or structured value containing additional information about the error. This may be omitted.
message = 'This operation is not supported'
class-attribute
instance-attribute
¶
The error message.