Python SDK Reference¶
This page contains SDK documentation for the a2a-sdk
Python package.
Client¶
Client-side components for interacting with an A2A agent.
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
¶
A2A Client for interacting with an A2A agent.
agent_card = agent_card
instance-attribute
¶
httpx_client = httpx_client
instance-attribute
¶
interceptors = interceptors or []
instance-attribute
¶
url = agent_card.url
instance-attribute
¶
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_client_from_agent_card_url(httpx_client, base_url, agent_card_path=AGENT_CARD_WELL_KNOWN_PATH, http_kwargs=None)
async
staticmethod
¶
Fetches the public AgentCard and initializes an A2A client.
This method will always fetch the public agent card. If an authenticated or extended agent card is required, the A2ACardResolver should be used directly to fetch the specific card, and then the A2AClient should be instantiated with it.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
httpx_client
|
AsyncClient
|
An async HTTP client instance (e.g., httpx.AsyncClient). |
required |
base_url
|
str
|
The base URL of the agent's host. |
required |
agent_card_path
|
str
|
The path to the agent card endpoint, relative to the base URL. |
AGENT_CARD_WELL_KNOWN_PATH
|
http_kwargs
|
dict[str, Any] | None
|
Optional dictionary of keyword arguments to pass to the underlying httpx.get request when fetching the agent card. |
None
|
Returns:
Type | Description |
---|---|
A2AClient
|
An initialized |
Raises:
Type | Description |
---|---|
A2AClientHTTPError
|
If an HTTP error occurs fetching the agent card. |
A2AClientJSONError
|
If the agent card response is invalid. |
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. |
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]
|
|
AsyncGenerator[SendStreamingMessageResponse]
|
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.
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. |
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 |
Server¶
Types¶
A2AError
¶
Bases: RootModel[JSONParseError | InvalidRequestError | MethodNotFoundError | InvalidParamsError | InternalError | TaskNotFoundError | TaskNotCancelableError | PushNotificationNotSupportedError | UnsupportedOperationError | ContentTypeNotSupportedError | InvalidAgentResponseError]
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]
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). A client can use any of these to communicate with the agent.
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 = None
class-attribute
instance-attribute
¶
The transport protocol for the preferred endpoint. Defaults to 'JSONRPC' if not specified.
protocol_version = '0.2.6'
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 = None
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.
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.
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
instance-attribute
¶
The preferred endpoint URL for interacting with the agent.
version = Field(..., examples=['1.0.0'])
class-attribute
instance-attribute
¶
The agent's own version number. The format is defined by the provider.
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.
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
instance-attribute
¶
The transport protocol supported at this URL. This is a string to allow for future extension. Core supported transports include 'JSONRPC', 'GRPC', and 'HTTP+JSON'.
url
instance-attribute
¶
The URL where this interface is available.
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.
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 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.
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 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.
GetTaskPushNotificationConfigParams
¶
Bases: A2ABaseModel
Defines parameters for fetching a specific push notification configuration for a task.
id
instance-attribute
¶
The unique identifier 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]
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 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 identifier 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 identifier 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
¶
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
¶
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 ID for the push notification configuration, created by the server 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]
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 identifier 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 for the task, generated by the client for a new task or provided by the agent.
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 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 ID 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 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.
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.