类 ExecutionConfig.Builder

java.lang.Object
io.agentscope.core.model.ExecutionConfig.Builder
封闭类:
ExecutionConfig

public static class ExecutionConfig.Builder extends Object
Builder for ExecutionConfig.
  • 构造器详细资料

    • Builder

      public Builder()
  • 方法详细资料

    • timeout

      public ExecutionConfig.Builder timeout(Duration timeout)
      Sets the timeout duration for a single execution.
      参数:
      timeout - the timeout duration, or null for no timeout
      返回:
      this builder instance
    • maxAttempts

      public ExecutionConfig.Builder maxAttempts(Integer maxAttempts)
      Sets the maximum number of attempts (including the initial attempt).

      For example, maxAttempts=3 means: 1 initial attempt + 2 retries.

      参数:
      maxAttempts - the max attempts (must be >= 1), or null
      返回:
      this builder instance
    • initialBackoff

      public ExecutionConfig.Builder initialBackoff(Duration initialBackoff)
      Sets the initial backoff duration for the first retry.
      参数:
      initialBackoff - the initial backoff duration, or null
      返回:
      this builder instance
    • maxBackoff

      public ExecutionConfig.Builder maxBackoff(Duration maxBackoff)
      Sets the maximum backoff duration between retries.
      参数:
      maxBackoff - the max backoff duration, or null
      返回:
      this builder instance
    • backoffMultiplier

      public ExecutionConfig.Builder backoffMultiplier(Double backoffMultiplier)
      Sets the backoff multiplier applied after each retry.

      For example, with initialBackoff=1s, maxBackoff=10s, and backoffMultiplier=2.0, the retry delays will be: 1s, 2s, 4s, 8s, 10s (capped), 10s, ...

      参数:
      backoffMultiplier - the backoff multiplier (must be >= 1.0), or null
      返回:
      this builder instance
    • retryOn

      public ExecutionConfig.Builder retryOn(Predicate<Throwable> retryOn)
      Sets the predicate to determine if an error should trigger a retry.
      参数:
      retryOn - the retry predicate (returns true to retry), or null
      返回:
      this builder instance
    • build

      public ExecutionConfig build()
      Builds a new ExecutionConfig instance.
      返回:
      a new ExecutionConfig instance