Class RemoteA2AAgent

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

public class RemoteA2AAgent extends BaseAgent
Agent that communicates with a remote A2A agent via A2A client.

This agent supports multiple ways to specify the remote agent:

  1. Direct AgentCard object
  2. URL to agent card JSON
  3. File path to agent card JSON

The agent handles:

  • Agent card resolution and validation
  • A2A message conversion and error handling
  • Session state management across requests

**EXPERIMENTAL:** Subject to change, rename, or removal in any future patch release. Do not use in production code.

  • 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.