Skip to content
Navigation

A2A protocol types — agent cards, configs, and task events. All model classes use Pydantic BaseModel with frozen=True.

python
from orbiter.a2a.types import (
    AgentCapabilities,
    AgentCard,
    AgentSkill,
    ClientConfig,
    ServingConfig,
    TaskArtifactUpdateEvent,
    TaskState,
    TaskStatus,
    TaskStatusUpdateEvent,
    TransportMode,
)

TransportMode

python
class TransportMode(StrEnum)

Supported A2A transport protocols.

ValueDescription
JSONRPC = "jsonrpc"JSON-RPC over HTTP
GRPC = "grpc"gRPC transport
WEBSOCKET = "websocket"WebSocket transport

TaskState

python
class TaskState(StrEnum)

Lifecycle states for a remote A2A task.

ValueDescription
SUBMITTED = "submitted"Task has been submitted
WORKING = "working"Agent is processing the task
COMPLETED = "completed"Task completed successfully
FAILED = "failed"Task execution failed
CANCELED = "canceled"Task was canceled

AgentSkill

python
class AgentSkill(BaseModel, frozen=True)

A single capability advertised by an agent.

FieldTypeDefaultDescription
idstr(required)Unique skill identifier
namestr(required)Human-readable name
descriptionstr""What the skill does
tagstuple[str, ...]()Classification tags

AgentCapabilities

python
class AgentCapabilities(BaseModel, frozen=True)

Runtime capabilities of an A2A agent.

FieldTypeDefaultDescription
streamingboolFalseSupports streaming responses
push_notificationsboolFalseSupports push notifications
state_transition_historyboolFalseTracks state transitions

AgentCard

python
class AgentCard(BaseModel, frozen=True)

Complete metadata descriptor for a remote A2A agent. Published at /.well-known/agent-card for discovery.

FieldTypeDefaultDescription
namestr(required)Agent identifier
descriptionstr""Agent purpose
versionstr"0.0.1"Agent version
urlstr""Agent endpoint URL
capabilitiesAgentCapabilitiesAgentCapabilities()Runtime capabilities
skillstuple[AgentSkill, ...]()Advertised skills
default_input_modestuple[str, ...]("text",)Accepted input formats
default_output_modestuple[str, ...]("text",)Produced output formats
supported_transportstuple[TransportMode, ...](TransportMode.JSONRPC,)Transport protocols

Example

python
card = AgentCard(
    name="research-agent",
    description="Performs web research",
    url="http://localhost:8000",
    capabilities=AgentCapabilities(streaming=True),
    skills=(
        AgentSkill(id="search", name="Web Search", tags=("research",)),
    ),
)

ServingConfig

python
class ServingConfig(BaseModel, frozen=True)

Server-side configuration for publishing an agent via A2A.

FieldTypeDefaultDescription
hoststr"localhost"Bind host
portint0Bind port (0 = auto)
endpointstr"/"Base URL path
streamingboolFalseEnable streaming
versionstr"0.0.1"Advertised version
skillstuple[AgentSkill, ...]()Skills to advertise
input_modestuple[str, ...]("text",)Accepted input formats
output_modestuple[str, ...]("text",)Produced output formats
transportstuple[TransportMode, ...](TransportMode.JSONRPC,)Enabled transports
extradict[str, Any]{}Extension point for custom config

ClientConfig

python
class ClientConfig(BaseModel, frozen=True)

Client-side configuration for connecting to a remote A2A agent.

FieldTypeDefaultDescription
streamingboolFalseRequest streaming
timeoutfloat600.0Request timeout in seconds (must be > 0)
transportstuple[TransportMode, ...](TransportMode.JSONRPC,)Preferred transports
accepted_output_modestuple[str, ...]()Accepted output formats (empty = any)
extradict[str, Any]{}Extension point for custom config

TaskStatus

python
class TaskStatus(BaseModel, frozen=True)

Current status of a remote A2A task.

FieldTypeDefaultDescription
stateTaskState(required)Task lifecycle state
reasonstr""Reason / error message

TaskStatusUpdateEvent

python
class TaskStatusUpdateEvent(BaseModel, frozen=True)

Emitted when a remote task changes state.

FieldTypeDefaultDescription
task_idstr(required)Task being updated
statusTaskStatus(required)New status

TaskArtifactUpdateEvent

python
class TaskArtifactUpdateEvent(BaseModel, frozen=True)

Emitted when a remote task produces output.

FieldTypeDefaultDescription
task_idstr(required)Task being updated
textstr""Artifact text content
last_chunkboolFalseWhether this is the final chunk