类 PlanNotebook.Builder

java.lang.Object
io.agentscope.core.plan.PlanNotebook.Builder
封闭类:
PlanNotebook

public static class PlanNotebook.Builder extends Object
Builder for constructing PlanNotebook instances with customizable settings.
  • 构造器详细资料

    • Builder

      public Builder()
  • 方法详细资料

    • planToHint

      public PlanNotebook.Builder planToHint(PlanToHint planToHint)
      Sets the strategy for converting plans to hints.
      参数:
      planToHint - The plan-to-hint converter implementation
      返回:
      This builder for method chaining
    • storage

      public PlanNotebook.Builder storage(PlanStorage storage)
      Sets the storage backend for persisting historical plans.
      参数:
      storage - The plan storage implementation
      返回:
      This builder for method chaining
    • maxSubtasks

      public PlanNotebook.Builder maxSubtasks(int maxSubtasks)
      Sets the maximum number of subtasks allowed per plan.
      参数:
      maxSubtasks - Maximum subtasks (null for unlimited)
      返回:
      This builder for method chaining
    • needUserConfirm

      public PlanNotebook.Builder needUserConfirm(boolean needUserConfirm)
      Sets whether to include "wait for user confirmation" rule in hints.

      When enabled (default), hints will include a rule requiring the agent to wait for explicit user confirmation before executing plans. When disabled, the agent may proceed with execution immediately after creating a plan.

      参数:
      needUserConfirm - true to require user confirmation, false to allow immediate execution
      返回:
      This builder for method chaining
    • keyPrefix

      public PlanNotebook.Builder keyPrefix(String keyPrefix)
      Sets the key prefix for state storage.

      Use this when multiple PlanNotebook instances need to coexist in the same session.

      参数:
      keyPrefix - the prefix for storage keys (e.g., "mainPlan", "subPlan")
      返回:
      This builder for method chaining
    • build

      public PlanNotebook build()
      Builds a new PlanNotebook with the configured settings.
      返回:
      A new PlanNotebook instance