A2AAgent

fun A2AAgent(name: String, agentCard: AgentCard, httpClient: A2AHttpClient = JdkA2AHttpClient(), description: String? = null, subAgents: List<BaseAgent> = emptyList(), beforeAgentCallbacks: List<BeforeAgentCallback> = emptyList(), afterAgentCallbacks: List<AfterAgentCallback> = emptyList()): BaseRemoteA2AAgent

Builds a JVM A2A agent from an already-resolved agentCard, wiring up the client so the caller never supplies a client and card separately.

Streaming is chosen per invocation from RunConfig.streamingMode (gated by the card's capability), matching ADK Go/Python -- there is no per-agent streaming flag.

Parameters

name

this agent's identifier in the ADK agent tree (event author and transfer_to_agent target), independent of the card's advertised name.

agentCard

the resolved remote agent card.

httpClient

HTTP client backing the JSON-RPC transport; defaults to a JdkA2AHttpClient.

description

overrides the agent's description; when null, the remote card's description is used (matching ADK Python/Go).

subAgents

child agents in the ADK agent tree.

beforeAgentCallbacks

callbacks invoked before the agent runs.

afterAgentCallbacks

callbacks invoked after the agent runs.


suspend fun A2AAgent(name: String, agentCardUrl: String, httpClient: A2AHttpClient = JdkA2AHttpClient(), description: String? = null, subAgents: List<BaseAgent> = emptyList(), beforeAgentCallbacks: List<BeforeAgentCallback> = emptyList(), afterAgentCallbacks: List<AfterAgentCallback> = emptyList()): BaseRemoteA2AAgent

Builds a JVM A2A agent from agentCardUrl, auto-fetching the AgentCard from the remote agent's /.well-known/agent-card.json (like ADK Python/Go). Suspends on the network fetch.

Parameters

name

this agent's identifier in the ADK agent tree (event author and transfer_to_agent target), independent of the card's advertised name.

agentCardUrl

the remote agent's base URL or full agent-card URL.

httpClient

HTTP client backing the JSON-RPC transport; defaults to a JdkA2AHttpClient.

description

overrides the agent's description; when null, the remote card's description is used (matching ADK Python/Go).

subAgents

child agents in the ADK agent tree.

beforeAgentCallbacks

callbacks invoked before the agent runs.

afterAgentCallbacks

callbacks invoked after the agent runs.


fun A2AAgent(name: String, agentCard: AgentCard, config: A2AAgentConfig): BaseRemoteA2AAgent

Builds a JVM A2A agent from a resolved agentCard, taking its optional settings from config.


suspend fun A2AAgent(name: String, agentCardUrl: String, config: A2AAgentConfig): BaseRemoteA2AAgent

Builds a JVM A2A agent from agentCardUrl, taking its optional settings from config. Suspends on the network fetch of the AgentCard.