Class ModelRetryInterceptor.Builder

java.lang.Object
com.alibaba.cloud.ai.graph.agent.interceptor.modelretry.ModelRetryInterceptor.Builder
Enclosing class:
ModelRetryInterceptor

public static class ModelRetryInterceptor.Builder extends Object
  • Constructor Details

    • Builder

      public Builder()
  • Method Details

    • maxAttempts

      public ModelRetryInterceptor.Builder maxAttempts(int maxAttempts)
      Set the maximum number of retries (including the first call).
      Parameters:
      maxAttempts - The maximum number of attempts must be >= 1.
    • initialDelay

      public ModelRetryInterceptor.Builder initialDelay(long initialDelay)
      Set the initial retry delay (milliseconds).
      Parameters:
      initialDelay - Initial delay time, in milliseconds
    • maxDelay

      public ModelRetryInterceptor.Builder maxDelay(long maxDelay)
      Set the maximum retry delay (milliseconds).
      Parameters:
      maxDelay - Maximum delay time, in milliseconds
    • backoffMultiplier

      public ModelRetryInterceptor.Builder backoffMultiplier(double backoffMultiplier)
      Set the backoff factor (the multiplier for the delay time on each retry).
      Parameters:
      backoffMultiplier - The retreat factor must be >= 1.0
    • retryableExceptionPredicate

      public ModelRetryInterceptor.Builder retryableExceptionPredicate(Predicate<Exception> predicate)
      Configure custom retryable exception handling logic
      Parameters:
      predicate - Exception detection function
    • build

      public ModelRetryInterceptor build()