Skip to content

Python SDK Reference

This page contains SDK documentation for the a2a-sdk Python package.

pip install a2a-sdk

Client

Client-side components for interacting with an A2A agent.

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 AgentCard object representing the agent's capabilities.

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 CancelTaskRequest object specifying the task ID.

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 CancelTaskResponse object containing the updated Task with canceled status or an error.

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='/.well-known/agent.json', 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.

'/.well-known/agent.json'
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 A2AClient instance.

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 GetTaskRequest object specifying the task ID and history length.

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 GetTaskResponse object containing the Task or an error.

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 GetTaskPushNotificationConfigRequest object specifying the task ID.

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 GetTaskPushNotificationConfigResponse object containing the configuration or an error.

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 SendMessageRequest object containing the message and configuration.

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 SendMessageResponse object containing the agent's response (Task or Message) or an error.

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 SendStreamingMessageRequest object containing the message and configuration.

required
http_kwargs dict[str, Any] | None

Optional dictionary of keyword arguments to pass to the underlying httpx.post request. A default timeout=None is set but can be overridden.

None
context ClientCallContext | None

The client call context.

None

Yields:

Type Description
AsyncGenerator[SendStreamingMessageResponse]

SendStreamingMessageResponse objects as they are received in the SSE stream.

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 SetTaskPushNotificationConfigRequest object specifying the task ID and configuration.

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 SetTaskPushNotificationConfigResponse object containing the confirmation or an error.

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.

message = message instance-attribute

status_code = status_code instance-attribute

A2AClientJSONError

Bases: A2AClientError

Client exception for JSON errors during response parsing or validation.

message = message instance-attribute

A2AGrpcClient

A2A Client for interacting with an A2A agent via gRPC.

agent_card = agent_card instance-attribute

stub = grpc_stub instance-attribute

cancel_task(request) async

Requests the agent to cancel a specific task.

Parameters:

Name Type Description Default
request TaskIdParams

The TaskIdParams object specifying the task ID.

required

Returns:

Type Description
Task

A Task object containing the updated Task

get_task(request) async

Retrieves the current state and history of a specific task.

Parameters:

Name Type Description Default
request TaskQueryParams

The TaskQueryParams object specifying the task ID

required

Returns:

Type Description
Task

A Task object containing the Task or None.

get_task_callback(request) async

Retrieves the push notification configuration for a specific task.

Parameters:

Name Type Description Default
request TaskIdParams

The TaskIdParams object specifying the task ID.

required

Returns:

Type Description
TaskPushNotificationConfig

A TaskPushNotificationConfig object containing the configuration.

send_message(request) async

Sends a non-streaming message request to the agent.

Parameters:

Name Type Description Default
request MessageSendParams

The MessageSendParams object containing the message and configuration.

required

Returns:

Type Description
Task | Message

A Task or Message object containing the agent's response.

send_message_streaming(request) async

Sends a streaming message request to the agent and yields responses as they arrive.

This method uses gRPC streams to receive a stream of updates from the agent.

Parameters:

Name Type Description Default
request MessageSendParams

The MessageSendParams object containing the message and configuration.

required

Yields:

Type Description
AsyncGenerator[Message | Task | TaskStatusUpdateEvent | TaskArtifactUpdateEvent]

Message or Task or TaskStatusUpdateEvent or

AsyncGenerator[Message | Task | TaskStatusUpdateEvent | TaskArtifactUpdateEvent]

TaskArtifactUpdateEvent objects as they are received in the

AsyncGenerator[Message | Task | TaskStatusUpdateEvent | TaskArtifactUpdateEvent]

stream.

set_task_callback(request) async

Sets or updates the push notification configuration for a specific task.

Parameters:

Name Type Description Default
request TaskPushNotificationConfig

The TaskPushNotificationConfig object specifying the task ID and configuration.

required

Returns:

Type Description
TaskPushNotificationConfig

A TaskPushNotificationConfig object containing the config.

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 Message object with a new UUID messageId.


Server

Server-side components for implementing an A2A agent.


Types

A2A

Bases: RootModel[Any]

root instance-attribute

APIKeySecurityScheme

Bases: BaseModel

API Key security scheme.

description = None class-attribute instance-attribute

Description of this security scheme.

in_ = Field(..., alias='in') class-attribute instance-attribute

The location of the API key. Valid values are "query", "header", or "cookie".

name instance-attribute

The name of the header, query or cookie parameter to be used.

type = 'apiKey' class-attribute instance-attribute

AgentCapabilities

Bases: BaseModel

Defines optional capabilities supported by an agent.

extensions = None class-attribute instance-attribute

extensions supported by this agent.

pushNotifications = None class-attribute instance-attribute

true if the agent can notify updates to client.

stateTransitionHistory = None class-attribute instance-attribute

true if the agent exposes status change history for tasks.

streaming = None class-attribute instance-attribute

true if the agent supports SSE.

AgentCard

Bases: BaseModel

An AgentCard conveys key information: - Overall details (version, name, description, uses) - Skills: A set of capabilities the agent can perform - Default modalities/content types supported by the agent. - Authentication requirements

additionalInterfaces = None class-attribute instance-attribute

Announcement of additional supported transports. Client can use any of the supported transports.

capabilities instance-attribute

Optional capabilities supported by the agent.

defaultInputModes instance-attribute

The set of interaction modes that the agent supports across all skills. This can be overridden per-skill. Supported media types for input.

defaultOutputModes instance-attribute

Supported media types for output.

description instance-attribute

A human-readable description of the agent. Used to assist users and other agents in understanding what the agent can do.

documentationUrl = None class-attribute instance-attribute

A URL to documentation for the agent.

iconUrl = None class-attribute instance-attribute

A URL to an icon for the agent.

name instance-attribute

Human readable name of the agent.

preferredTransport = None class-attribute instance-attribute

The transport of the preferred endpoint. If empty, defaults to JSONRPC.

provider = None class-attribute instance-attribute

The service provider of the agent

security = None class-attribute instance-attribute

Security requirements for contacting the agent.

securitySchemes = None class-attribute instance-attribute

Security scheme details used for authenticating with this agent.

skills instance-attribute

Skills are a unit of capability that an agent can perform.

supportsAuthenticatedExtendedCard = None class-attribute instance-attribute

true if the agent supports providing an extended agent card when the user is authenticated. Defaults to false if not specified.

url instance-attribute

A URL to the address the agent is hosted at. This represents the preferred endpoint as declared by the agent.

version instance-attribute

The version of the agent - format is up to the provider.

AgentExtension

Bases: BaseModel

A declaration of an extension supported by an Agent.

description = None class-attribute instance-attribute

A description of how this agent uses this extension.

params = None class-attribute instance-attribute

Optional configuration for the extension.

required = None class-attribute instance-attribute

Whether the client must follow specific requirements of the extension.

uri instance-attribute

The URI of the extension.

AgentInterface

Bases: BaseModel

AgentInterface provides a declaration of a combination of the target url and the supported transport to interact with the agent.

transport instance-attribute

The transport supported this url. This is an open form string, to be easily extended for many transport protocols. The core ones officially supported are JSONRPC, GRPC and HTTP+JSON.

url instance-attribute

AgentProvider

Bases: BaseModel

Represents the service provider of an agent.

organization instance-attribute

Agent provider's organization name.

url instance-attribute

Agent provider's URL.

AgentSkill

Bases: BaseModel

Represents a unit of capability that an agent can perform.

description instance-attribute

Description of the skill - will be used by the client or a human as a hint to understand what the skill does.

examples = None class-attribute instance-attribute

The set of example scenarios that the skill can perform. Will be used by the client as a hint to understand how the skill can be used.

id instance-attribute

Unique identifier for the agent's skill.

inputModes = None class-attribute instance-attribute

The set of interaction modes that the skill supports (if different than the default). Supported media types for input.

name instance-attribute

Human readable name of the skill.

outputModes = None class-attribute instance-attribute

Supported media types for output.

tags instance-attribute

Set of tagwords describing classes of capabilities for this specific skill.

Artifact

Bases: BaseModel

Represents an artifact generated for a task.

artifactId instance-attribute

Unique identifier for the artifact.

description = None class-attribute instance-attribute

Optional description for the artifact.

extensions = None class-attribute instance-attribute

The URIs of extensions that are present or contributed to this Artifact.

metadata = None class-attribute instance-attribute

Extension metadata.

name = None class-attribute instance-attribute

Optional name for the artifact.

parts instance-attribute

Artifact parts.

AuthorizationCodeOAuthFlow

Bases: BaseModel

Configuration details for a supported OAuth Flow

authorizationUrl instance-attribute

The authorization URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS

refreshUrl = None class-attribute instance-attribute

The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.

scopes instance-attribute

The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. The map MAY be empty.

tokenUrl instance-attribute

The token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.

CancelTaskRequest

Bases: BaseModel

JSON-RPC request model for the 'tasks/cancel' method.

id instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

method = 'tasks/cancel' class-attribute instance-attribute

A String containing the name of the method to be invoked.

params instance-attribute

A Structured value that holds the parameter values to be used during the invocation of the method.

CancelTaskResponse

Bases: RootModel[JSONRPCErrorResponse | CancelTaskSuccessResponse]

root instance-attribute

JSON-RPC response for the 'tasks/cancel' method.

CancelTaskSuccessResponse

Bases: BaseModel

JSON-RPC success response model for the 'tasks/cancel' method.

id = None class-attribute instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

result instance-attribute

The result object on success.

ClientCredentialsOAuthFlow

Bases: BaseModel

Configuration details for a supported OAuth Flow

refreshUrl = None class-attribute instance-attribute

The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.

scopes instance-attribute

The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. The map MAY be empty.

tokenUrl instance-attribute

The token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.

ContentTypeNotSupportedError

Bases: BaseModel

A2A specific error indicating incompatible content types between request and agent capabilities.

code = -32005 class-attribute instance-attribute

A Number that indicates the error type that occurred.

data = None class-attribute instance-attribute

A Primitive or Structured value that contains additional information about the error. This may be omitted.

message = 'Incompatible content types' class-attribute instance-attribute

A String providing a short description of the error.

DataPart

Bases: BaseModel

Represents a structured data segment within a message part.

data instance-attribute

Structured data content

kind = 'data' class-attribute instance-attribute

Part type - data for DataParts

metadata = None class-attribute instance-attribute

Optional metadata associated with the part.

DeleteTaskPushNotificationConfigParams

Bases: BaseModel

Parameters for removing pushNotificationConfiguration associated with a Task

id instance-attribute

Task id.

metadata = None class-attribute instance-attribute

pushNotificationConfigId instance-attribute

DeleteTaskPushNotificationConfigRequest

Bases: BaseModel

JSON-RPC request model for the 'tasks/pushNotificationConfig/delete' method.

id instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

method = 'tasks/pushNotificationConfig/delete' class-attribute instance-attribute

A String containing the name of the method to be invoked.

params instance-attribute

A Structured value that holds the parameter values to be used during the invocation of the method.

DeleteTaskPushNotificationConfigResponse

Bases: RootModel[JSONRPCErrorResponse | DeleteTaskPushNotificationConfigSuccessResponse]

root instance-attribute

JSON-RPC response for the 'tasks/pushNotificationConfig/delete' method.

DeleteTaskPushNotificationConfigSuccessResponse

Bases: BaseModel

JSON-RPC success response model for the 'tasks/pushNotificationConfig/delete' method.

id = None class-attribute instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

result instance-attribute

The result object on success.

FileBase

Bases: BaseModel

Represents the base entity for FileParts

mimeType = None class-attribute instance-attribute

Optional mimeType for the file

name = None class-attribute instance-attribute

Optional name for the file

FilePart

Bases: BaseModel

Represents a File segment within parts.

file instance-attribute

File content either as url or bytes

kind = 'file' class-attribute instance-attribute

Part type - file for FileParts

metadata = None class-attribute instance-attribute

Optional metadata associated with the part.

FileWithBytes

Bases: BaseModel

Define the variant where 'bytes' is present and 'uri' is absent

bytes instance-attribute

base64 encoded content of the file

mimeType = None class-attribute instance-attribute

Optional mimeType for the file

name = None class-attribute instance-attribute

Optional name for the file

FileWithUri

Bases: BaseModel

Define the variant where 'uri' is present and 'bytes' is absent

mimeType = None class-attribute instance-attribute

Optional mimeType for the file

name = None class-attribute instance-attribute

Optional name for the file

uri instance-attribute

URL for the File content

GetTaskPushNotificationConfigParams

Bases: BaseModel

Parameters for fetching a pushNotificationConfiguration associated with a Task

id instance-attribute

Task id.

metadata = None class-attribute instance-attribute

pushNotificationConfigId = None class-attribute instance-attribute

GetTaskPushNotificationConfigRequest

Bases: BaseModel

JSON-RPC request model for the 'tasks/pushNotificationConfig/get' method.

id instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

method = 'tasks/pushNotificationConfig/get' class-attribute instance-attribute

A String containing the name of the method to be invoked.

params instance-attribute

A Structured value that holds the parameter values to be used during the invocation of the method. TaskIdParams type is deprecated for this method

GetTaskPushNotificationConfigResponse

Bases: RootModel[JSONRPCErrorResponse | GetTaskPushNotificationConfigSuccessResponse]

root instance-attribute

JSON-RPC response for the 'tasks/pushNotificationConfig/set' method.

GetTaskPushNotificationConfigSuccessResponse

Bases: BaseModel

JSON-RPC success response model for the 'tasks/pushNotificationConfig/get' method.

id = None class-attribute instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

result instance-attribute

The result object on success.

GetTaskRequest

Bases: BaseModel

JSON-RPC request model for the 'tasks/get' method.

id instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

method = 'tasks/get' class-attribute instance-attribute

A String containing the name of the method to be invoked.

params instance-attribute

A Structured value that holds the parameter values to be used during the invocation of the method.

GetTaskResponse

Bases: RootModel[JSONRPCErrorResponse | GetTaskSuccessResponse]

root instance-attribute

JSON-RPC response for the 'tasks/get' method.

GetTaskSuccessResponse

Bases: BaseModel

JSON-RPC success response for the 'tasks/get' method.

id = None class-attribute instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

result instance-attribute

The result object on success.

HTTPAuthSecurityScheme

Bases: BaseModel

HTTP Authentication security scheme.

bearerFormat = None class-attribute instance-attribute

A hint to the client to identify how the bearer token is formatted. Bearer tokens are usually generated by an authorization server, so this information is primarily for documentation purposes.

description = None class-attribute instance-attribute

Description of this security scheme.

scheme instance-attribute

The name of the HTTP Authentication scheme to be used in the Authorization header as defined in RFC7235. The values used SHOULD be registered in the IANA Authentication Scheme registry. The value is case-insensitive, as defined in RFC7235.

type = 'http' class-attribute instance-attribute

ImplicitOAuthFlow

Bases: BaseModel

Configuration details for a supported OAuth Flow

authorizationUrl instance-attribute

The authorization URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS

refreshUrl = None class-attribute instance-attribute

The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.

scopes instance-attribute

The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. The map MAY be empty.

In

Bases: str, Enum

The location of the API key. Valid values are "query", "header", or "cookie".

cookie = 'cookie' class-attribute instance-attribute

header = 'header' class-attribute instance-attribute

query = 'query' class-attribute instance-attribute

InternalError

Bases: BaseModel

JSON-RPC error indicating an internal JSON-RPC error on the server.

code = -32603 class-attribute instance-attribute

A Number that indicates the error type that occurred.

data = None class-attribute instance-attribute

A Primitive or Structured value that contains additional information about the error. This may be omitted.

message = 'Internal error' class-attribute instance-attribute

A String providing a short description of the error.

InvalidAgentResponseError

Bases: BaseModel

A2A specific error indicating agent returned invalid response for the current method

code = -32006 class-attribute instance-attribute

A Number that indicates the error type that occurred.

data = None class-attribute instance-attribute

A Primitive or Structured value that contains additional information about the error. This may be omitted.

message = 'Invalid agent response' class-attribute instance-attribute

A String providing a short description of the error.

InvalidParamsError

Bases: BaseModel

JSON-RPC error indicating invalid method parameter(s).

code = -32602 class-attribute instance-attribute

A Number that indicates the error type that occurred.

data = None class-attribute instance-attribute

A Primitive or Structured value that contains additional information about the error. This may be omitted.

message = 'Invalid parameters' class-attribute instance-attribute

A String providing a short description of the error.

InvalidRequestError

Bases: BaseModel

JSON-RPC error indicating the JSON sent is not a valid Request object.

code = -32600 class-attribute instance-attribute

A Number that indicates the error type that occurred.

data = None class-attribute instance-attribute

A Primitive or Structured value that contains additional information about the error. This may be omitted.

message = 'Request payload validation error' class-attribute instance-attribute

A String providing a short description of the error.

JSONParseError

Bases: BaseModel

JSON-RPC error indicating invalid JSON was received by the server.

code = -32700 class-attribute instance-attribute

A Number that indicates the error type that occurred.

data = None class-attribute instance-attribute

A Primitive or Structured value that contains additional information about the error. This may be omitted.

message = 'Invalid JSON payload' class-attribute instance-attribute

A String providing a short description of the error.

JSONRPCError

Bases: BaseModel

Represents a JSON-RPC 2.0 Error object. This is typically included in a JSONRPCErrorResponse when an error occurs.

code instance-attribute

A Number that indicates the error type that occurred.

data = None class-attribute instance-attribute

A Primitive or Structured value that contains additional information about the error. This may be omitted.

message instance-attribute

A String providing a short description of the error.

JSONRPCErrorResponse

Bases: BaseModel

Represents a JSON-RPC 2.0 Error Response object.

error instance-attribute

id = None class-attribute instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

JSONRPCMessage

Bases: BaseModel

Base interface for any JSON-RPC 2.0 request or response.

id = None class-attribute instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

JSONRPCRequest

Bases: BaseModel

Represents a JSON-RPC 2.0 Request object.

id = None class-attribute instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies 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.

params = None class-attribute instance-attribute

A Structured value that holds the parameter values to be used during the invocation of the method.

JSONRPCSuccessResponse

Bases: BaseModel

Represents a JSON-RPC 2.0 Success Response object.

id = None class-attribute instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

result instance-attribute

The result object on success

ListTaskPushNotificationConfigParams

Bases: BaseModel

Parameters for getting list of pushNotificationConfigurations associated with a Task

id instance-attribute

Task id.

metadata = None class-attribute instance-attribute

ListTaskPushNotificationConfigRequest

Bases: BaseModel

JSON-RPC request model for the 'tasks/pushNotificationConfig/list' method.

id instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

method = 'tasks/pushNotificationConfig/list' class-attribute instance-attribute

A String containing the name of the method to be invoked.

params instance-attribute

A Structured value that holds the parameter values to be used during the invocation of the method.

ListTaskPushNotificationConfigResponse

Bases: RootModel[JSONRPCErrorResponse | ListTaskPushNotificationConfigSuccessResponse]

root instance-attribute

JSON-RPC response for the 'tasks/pushNotificationConfig/list' method.

ListTaskPushNotificationConfigSuccessResponse

Bases: BaseModel

JSON-RPC success response model for the 'tasks/pushNotificationConfig/list' method.

id = None class-attribute instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

result instance-attribute

The result object on success.

Message

Bases: BaseModel

Represents a single message exchanged between user and agent.

contextId = None class-attribute instance-attribute

The context the message is associated with

extensions = None class-attribute instance-attribute

The URIs of extensions that are present or contributed to this Message.

kind = 'message' class-attribute instance-attribute

Event type

messageId instance-attribute

Identifier created by the message creator

metadata = None class-attribute instance-attribute

Extension metadata.

parts instance-attribute

Message content

referenceTaskIds = None class-attribute instance-attribute

List of tasks referenced as context by this message.

role instance-attribute

Message sender's role

taskId = None class-attribute instance-attribute

Identifier of task the message is related to

MessageSendConfiguration

Bases: BaseModel

Configuration for the send message request.

acceptedOutputModes instance-attribute

Accepted output modalities by the client.

blocking = None class-attribute instance-attribute

If the server should treat the client as a blocking request.

historyLength = None class-attribute instance-attribute

Number of recent messages to be retrieved.

pushNotificationConfig = None class-attribute instance-attribute

Where the server should send notifications when disconnected.

MessageSendParams

Bases: BaseModel

Sent by the client to the agent as a request. May create, continue or restart a task.

configuration = None class-attribute instance-attribute

Send message configuration.

message instance-attribute

The message being sent to the server.

metadata = None class-attribute instance-attribute

Extension metadata.

MethodNotFoundError

Bases: BaseModel

JSON-RPC error indicating the method does not exist or is not available.

code = -32601 class-attribute instance-attribute

A Number that indicates the error type that occurred.

data = None class-attribute instance-attribute

A Primitive or Structured value that contains additional information about the error. This may be omitted.

message = 'Method not found' class-attribute instance-attribute

A String providing a short description of the error.

OAuth2SecurityScheme

Bases: BaseModel

OAuth2.0 security scheme configuration.

description = None class-attribute instance-attribute

Description of this security scheme.

flows instance-attribute

An object containing configuration information for the flow types supported.

type = 'oauth2' class-attribute instance-attribute

OAuthFlows

Bases: BaseModel

Allows configuration of the supported OAuth Flows

authorizationCode = None class-attribute instance-attribute

Configuration for the OAuth Authorization Code flow. Previously called accessCode in OpenAPI 2.0.

clientCredentials = 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

password = None class-attribute instance-attribute

Configuration for the OAuth Resource Owner Password flow

OpenIdConnectSecurityScheme

Bases: BaseModel

OpenID Connect security scheme configuration.

description = None class-attribute instance-attribute

Description of this security scheme.

openIdConnectUrl instance-attribute

Well-known URL to discover the [[OpenID-Connect-Discovery]] provider metadata.

type = 'openIdConnect' class-attribute instance-attribute

Part

Bases: RootModel[TextPart | FilePart | DataPart]

root instance-attribute

Represents a part of a message, which can be text, a file, or structured data.

PartBase

Bases: BaseModel

Base properties common to all message parts.

metadata = None class-attribute instance-attribute

Optional metadata associated with the part.

PasswordOAuthFlow

Bases: BaseModel

Configuration details for a supported OAuth Flow

refreshUrl = None class-attribute instance-attribute

The URL to be used for obtaining refresh tokens. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.

scopes instance-attribute

The available scopes for the OAuth2 security scheme. A map between the scope name and a short description for it. The map MAY be empty.

tokenUrl instance-attribute

The token URL to be used for this flow. This MUST be in the form of a URL. The OAuth2 standard requires the use of TLS.

PushNotificationAuthenticationInfo

Bases: BaseModel

Defines authentication details for push notifications.

credentials = None class-attribute instance-attribute

Optional credentials

schemes instance-attribute

Supported authentication schemes - e.g. Basic, Bearer

PushNotificationConfig

Bases: BaseModel

Configuration for setting up push notifications for task updates.

authentication = None class-attribute instance-attribute

id = None class-attribute instance-attribute

Push Notification ID - created by server to support multiple callbacks

token = None class-attribute instance-attribute

Token unique to this task/session.

url instance-attribute

URL for sending the push notifications.

PushNotificationNotSupportedError

Bases: BaseModel

A2A specific error indicating the agent does not support push notifications.

code = -32003 class-attribute instance-attribute

A Number that indicates the error type that occurred.

data = None class-attribute instance-attribute

A Primitive or Structured value that contains additional information about the error. This may be omitted.

message = 'Push Notification is not supported' class-attribute instance-attribute

A String providing a short description of the error.

Role

Bases: str, Enum

Message sender's role

agent = 'agent' class-attribute instance-attribute

user = 'user' class-attribute instance-attribute

SecurityScheme

Bases: RootModel[APIKeySecurityScheme | HTTPAuthSecurityScheme | OAuth2SecurityScheme | OpenIdConnectSecurityScheme]

root instance-attribute

Mirrors the OpenAPI Security Scheme Object (https://swagger.io/specification/#security-scheme-object)

SecuritySchemeBase

Bases: BaseModel

Base properties shared by all security schemes.

description = None class-attribute instance-attribute

Description of this security scheme.

SendMessageRequest

Bases: BaseModel

JSON-RPC request model for the 'message/send' method.

id instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

method = 'message/send' class-attribute instance-attribute

A String containing the name of the method to be invoked.

params instance-attribute

A Structured value that holds the parameter values to be used during the invocation of the method.

SendMessageResponse

Bases: RootModel[JSONRPCErrorResponse | SendMessageSuccessResponse]

root instance-attribute

JSON-RPC response model for the 'message/send' method.

SendMessageSuccessResponse

Bases: BaseModel

JSON-RPC success response model for the 'message/send' method.

id = None class-attribute instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

result instance-attribute

The result object on success

SendStreamingMessageRequest

Bases: BaseModel

JSON-RPC request model for the 'message/stream' method.

id instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

method = 'message/stream' class-attribute instance-attribute

A String containing the name of the method to be invoked.

params instance-attribute

A Structured value that holds the parameter values to be used during the invocation of the method.

SendStreamingMessageResponse

Bases: RootModel[JSONRPCErrorResponse | SendStreamingMessageSuccessResponse]

root instance-attribute

JSON-RPC response model for the 'message/stream' method.

SendStreamingMessageSuccessResponse

Bases: BaseModel

JSON-RPC success response model for the 'message/stream' method.

id = None class-attribute instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

result instance-attribute

The result object on success

SetTaskPushNotificationConfigRequest

Bases: BaseModel

JSON-RPC request model for the 'tasks/pushNotificationConfig/set' method.

id instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

method = 'tasks/pushNotificationConfig/set' class-attribute instance-attribute

A String containing the name of the method to be invoked.

params instance-attribute

A Structured value that holds the parameter values to be used during the invocation of the method.

SetTaskPushNotificationConfigResponse

Bases: RootModel[JSONRPCErrorResponse | SetTaskPushNotificationConfigSuccessResponse]

root instance-attribute

JSON-RPC response for the 'tasks/pushNotificationConfig/set' method.

SetTaskPushNotificationConfigSuccessResponse

Bases: BaseModel

JSON-RPC success response model for the 'tasks/pushNotificationConfig/set' method.

id = None class-attribute instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

result instance-attribute

The result object on success.

Task

Bases: BaseModel

artifacts = None class-attribute instance-attribute

Collection of artifacts created by the agent.

contextId instance-attribute

Server-generated id for contextual alignment across interactions

history = None class-attribute instance-attribute

id instance-attribute

Unique identifier for the task

kind = 'task' class-attribute instance-attribute

Event type

metadata = None class-attribute instance-attribute

Extension metadata.

status instance-attribute

Current status of the task

TaskArtifactUpdateEvent

Bases: BaseModel

Sent by server during sendStream or subscribe requests

append = None class-attribute instance-attribute

Indicates if this artifact appends to a previous one

artifact instance-attribute

Generated artifact

contextId instance-attribute

The context the task is associated with

kind = 'artifact-update' class-attribute instance-attribute

Event type

lastChunk = None class-attribute instance-attribute

Indicates if this is the last chunk of the artifact

metadata = None class-attribute instance-attribute

Extension metadata.

taskId instance-attribute

Task id

TaskIdParams

Bases: BaseModel

Parameters containing only a task ID, used for simple task operations.

id instance-attribute

Task id.

metadata = None class-attribute instance-attribute

TaskNotCancelableError

Bases: BaseModel

A2A specific error indicating the task is in a state where it cannot be canceled.

code = -32002 class-attribute instance-attribute

A Number that indicates the error type that occurred.

data = None class-attribute instance-attribute

A Primitive or Structured value that contains additional information about the error. This may be omitted.

message = 'Task cannot be canceled' class-attribute instance-attribute

A String providing a short description of the error.

TaskNotFoundError

Bases: BaseModel

A2A specific error indicating the requested task ID was not found.

code = -32001 class-attribute instance-attribute

A Number that indicates the error type that occurred.

data = None class-attribute instance-attribute

A Primitive or Structured value that contains additional information about the error. This may be omitted.

message = 'Task not found' class-attribute instance-attribute

A String providing a short description of the error.

TaskPushNotificationConfig

Bases: BaseModel

Parameters for setting or getting push notification configuration for a task

pushNotificationConfig instance-attribute

Push notification configuration.

taskId instance-attribute

Task id.

TaskQueryParams

Bases: BaseModel

Parameters for querying a task, including optional history length.

historyLength = None class-attribute instance-attribute

Number of recent messages to be retrieved.

id instance-attribute

Task id.

metadata = None class-attribute instance-attribute

TaskResubscriptionRequest

Bases: BaseModel

JSON-RPC request model for the 'tasks/resubscribe' method.

id instance-attribute

An identifier established by the Client that MUST contain a String, Number. Numbers SHOULD NOT contain fractional parts.

jsonrpc = '2.0' class-attribute instance-attribute

Specifies the version of the JSON-RPC protocol. MUST be exactly "2.0".

method = 'tasks/resubscribe' class-attribute instance-attribute

A String containing the name of the method to be invoked.

params instance-attribute

A Structured value that holds the parameter values to be used during the invocation of the method.

TaskState

Bases: str, Enum

Represents the possible 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: BaseModel

TaskState and accompanying message.

message = None class-attribute instance-attribute

Additional status updates for client

state instance-attribute

timestamp = None class-attribute instance-attribute

ISO 8601 datetime string when the status was recorded.

TaskStatusUpdateEvent

Bases: BaseModel

Sent by server during sendStream or subscribe requests

contextId instance-attribute

The context the task is associated with

final instance-attribute

Indicates the end of the event stream

kind = 'status-update' class-attribute instance-attribute

Event type

metadata = None class-attribute instance-attribute

Extension metadata.

status instance-attribute

Current status of the task

taskId instance-attribute

Task id

TextPart

Bases: BaseModel

Represents a text segment within parts.

kind = 'text' class-attribute instance-attribute

Part type - text for TextParts

metadata = None class-attribute instance-attribute

Optional metadata associated with the part.

text instance-attribute

Text content

UnsupportedOperationError

Bases: BaseModel

A2A specific error indicating the requested operation is not supported by the agent.

code = -32004 class-attribute instance-attribute

A Number that indicates the error type that occurred.

data = None class-attribute instance-attribute

A Primitive or Structured value that contains additional information about the error. This may be omitted.

message = 'This operation is not supported' class-attribute instance-attribute

A String providing a short description of the error.