Class LoopPlanner

java.lang.Object
com.google.adk.planner.LoopPlanner
All Implemented Interfaces:
Planner

public final class LoopPlanner extends Object implements Planner
这是一个规划器,它会不断循环调用各个子代理(sub-agents);当检测到需要升级的事件(escalate event)或达到预定的最大循环次数时,该规划器会停止运行。
  • 构造函数详细信息

    • LoopPlanner

      public LoopPlanner(int maxCycles)
  • 方法详细信息(Method Details)

    • init

      public void init(PlanningContext context)
      描述内容复制自接口文档: Planner
      使用上下文信息及可用的代理来初始化规划器。该函数仅在规划循环开始之前被调用一次。

      默认实现是一个空操作(即什么都不做)。如果需要执行某些设置工作(例如构建依赖关系图),请覆盖该实现。

      Specified by:
      init in interface Planner
    • firstAction

      public io.reactivex.rxjava3.core.Single<PlannerAction> firstAction(PlanningContext context)
      描述内容复制自接口文档: Planner
      请选择要执行的第一个操作。
      Specified by:
      firstAction in interface Planner
    • nextAction

      public io.reactivex.rxjava3.core.Single<PlannerAction> nextAction(PlanningContext context)
      描述内容复制自接口文档: Planner
      根据更新后的状态和事件,选择下一步要执行的操作。
      Specified by:
      nextAction in interface Planner