类:RemoteA2AAgent

All Implemented Interfaces:
Node

public class RemoteA2AAgent extends BaseAgent
该代理通过 A2A 客户端与远程的 A2A 代理进行通信。

可以通过直接提供相应的参数来指定远程代理。 AgentCard “致开发者:” 或者,该问题可以通过提供的 A2A 客户端自动解决。

该代理的主要职责包括:

  • 代理卡(Agent card)的分辨率处理及验证
  • 将 ADK 会话历史事件转换为 A2A 请求)Message)
  • 处理来自 A2A 客户端的流式(streaming)和非流式(non-streaming)响应
  • 将流式响应数据块缓冲并汇总到 ADK 中 Events
  • 将 A2A 客户端响应转换回 ADK 格式
  • 方法详细信息(Method Details)

    • builder

      public static RemoteA2AAgent.Builder builder()
    • isStreaming

      public boolean isStreaming()
    • runAsyncImpl

      protected io.reactivex.rxjava3.core.Flowable<Event> runAsyncImpl(InvocationContext invocationContext)
      描述内容复制自相关类: BaseAgent
      与特定代理(Agent)相关的异步逻辑(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)
      描述内容复制自相关类: BaseAgent
      与特定代理相关的同步逻辑(Agent-specific synchronous logic)。
      Specified by:
      runLiveImpl in class BaseAgent
      Parameters:
      invocationContext - Current invocation context.
      Returns:
      stream of agent-generated events.
    • toolOrigin

      public AgentEnums.AgentOrigin toolOrigin()
      描述内容复制自相关类: BaseAgent
      当该代理被用作工具时,该方法会返回该工具的来源信息。
      Overrides:
      toolOrigin in class BaseAgent
      Returns:
      the tool origin, defaults to "BASE_AGENT".