Package com.google.adk.a2a.agent
Class RemoteA2AAgent
java.lang.Object
com.google.adk.workflow.BaseNode
com.google.adk.agents.BaseAgent
com.google.adk.a2a.agent.RemoteA2AAgent
- All Implemented Interfaces:
Node
Agent that communicates with a remote A2A agent via an A2A client.
The remote agent can be specified directly by providing an AgentCard to the builder,
or it can be resolved automatically using the provided A2A client.
Key responsibilities of this agent include:
- Agent card resolution and validation
- Converting ADK session history events into A2A requests (
Message) - Handling streaming and non-streaming responses from the A2A client
- Buffering and aggregating streamed response chunks into ADK
Events - Converting A2A client responses back into ADK format
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classException thrown when the agent card cannot be resolved.static classBuilder forRemoteA2AAgent.static classException thrown when a type error occurs. -
Method Summary
Modifier and TypeMethodDescriptionstatic RemoteA2AAgent.Builderbuilder()booleanprotected io.reactivex.rxjava3.core.Flowable<Event>runAsyncImpl(InvocationContext invocationContext) Agent-specific asynchronous logic.protected io.reactivex.rxjava3.core.Flowable<Event>runLiveImpl(InvocationContext invocationContext) Agent-specific synchronous logic.Returns the origin of the tool when this agent is used as a tool.Methods inherited from class com.google.adk.agents.BaseAgent
afterAgentCallback, beforeAgentCallback, canonicalAfterAgentCallbacks, canonicalBeforeAgentCallbacks, close, findAgent, findSubAgent, fromConfig, parentAgent, parentAgent, rootAgent, runAsync, runLive, runNode, subAgentsMethods inherited from class com.google.adk.workflow.BaseNode
config, description, inputSchema, name, outputSchema, rerunOnResume, stateSchema, waitForOutputMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.adk.workflow.Node
requiresAllPredecessors
-
Method Details
-
builder
-
isStreaming
public boolean isStreaming() -
runAsyncImpl
protected io.reactivex.rxjava3.core.Flowable<Event> runAsyncImpl(InvocationContext invocationContext) Description copied from class:BaseAgentAgent-specific asynchronous logic.- Specified by:
runAsyncImplin classBaseAgent- Parameters:
invocationContext- Current invocation context.- Returns:
- stream of agent-generated events.
-
runLiveImpl
protected io.reactivex.rxjava3.core.Flowable<Event> runLiveImpl(InvocationContext invocationContext) Description copied from class:BaseAgentAgent-specific synchronous logic.- Specified by:
runLiveImplin classBaseAgent- Parameters:
invocationContext- Current invocation context.- Returns:
- stream of agent-generated events.
-
toolOrigin
Description copied from class:BaseAgentReturns the origin of the tool when this agent is used as a tool.- Overrides:
toolOriginin classBaseAgent- Returns:
- the tool origin, defaults to "BASE_AGENT".
-