Class RemoteA2AAgent

java.lang.Object
com.google.adk.agents.BaseAgent
com.google.adk.a2a.agent.RemoteA2AAgent

public class RemoteA2AAgent extends BaseAgent
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
  • Method Details

    • builder

      public static RemoteA2AAgent.Builder builder()
    • runAsyncImpl

      protected io.reactivex.rxjava3.core.Flowable<Event> runAsyncImpl(InvocationContext invocationContext)
      Description copied from class: BaseAgent
      Agent-specific asynchronous logic.
      Specified by:
      runAsyncImpl in class BaseAgent
      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: BaseAgent
      Agent-specific synchronous logic.
      Specified by:
      runLiveImpl in class BaseAgent
      Parameters:
      invocationContext - Current invocation context.
      Returns:
      stream of agent-generated events.