Claudio.A2A.Transport behaviour (Claudio v0.5.0)
View SourceBehaviour for A2A transport implementations.
Claudio supports multiple transport bindings for the A2A protocol:
Claudio.A2A.Transport.HTTP— JSON-RPC 2.0 over HTTP (default)Claudio.A2A.Transport.GRPC— gRPC (requires optionalprotox+grpcdeps)
Usage
# Default HTTP transport
Client.send_message("https://agent.example.com/a2a", message)
# Explicit gRPC transport
Client.send_message("agent.example.com:443", message,
transport: Claudio.A2A.Transport.GRPC)
Summary
Callbacks
Cancel a task.
Discover an agent's capabilities.
Get a task by ID.
List tasks with optional filters.
Send a message to an agent.
Types
@type endpoint() :: String.t()
@type list_response() :: %{tasks: [Claudio.A2A.Task.t()], next_page_token: String.t()}
@type opts() :: keyword()
@type send_response() :: Claudio.A2A.Task.t() | Claudio.A2A.Message.t()
Callbacks
@callback cancel_task(endpoint(), task_id :: String.t(), opts()) :: {:ok, Claudio.A2A.Task.t()} | {:error, term()}
Cancel a task.
Common options
:auth_token— Bearer token for authentication
@callback discover(endpoint(), opts()) :: {:ok, Claudio.A2A.AgentCard.t()} | {:error, term()}
Discover an agent's capabilities.
Common options
:auth_token— Bearer token for authentication:receive_timeout— HTTP receive timeout in ms:connect_options— Connection options (e.g., transport opts)
@callback get_task(endpoint(), task_id :: String.t(), opts()) :: {:ok, Claudio.A2A.Task.t()} | {:error, term()}
Get a task by ID.
Common options
:history_length— Number of history messages to include:auth_token— Bearer token for authentication
@callback list_tasks(endpoint(), opts()) :: {:ok, list_response()} | {:error, term()}
List tasks with optional filters.
Common options
:context_id— Filter by context ID:status— Filter by task state atom (e.g.,:working,:completed):page_size— Results per page:page_token— Pagination token:history_length— Number of history messages to include:auth_token— Bearer token for authentication
@callback send_message(endpoint(), Claudio.A2A.Message.t(), opts()) :: {:ok, send_response()} | {:error, term()}
Send a message to an agent.
Common options
:auth_token— Bearer token for authentication:configuration— SendMessageConfiguration map:metadata— Additional metadata:receive_timeout— HTTP receive timeout in ms:connect_options— Connection options