Class ClientOptions

java.lang.Object
com.alibaba.dashscope.ClientOptions

public final class ClientOptions extends Object
Immutable client options (design §2). Every field is an explicit value: null means "fall through the config chain" (builder > JVM system property > environment variable > ~/.dashscope/config.toml > default, see config/ConfigResolver).
  • Method Details

    • builder

      public static ClientOptions.Builder builder()
    • toBuilder

      public ClientOptions.Builder toBuilder()
    • getApiKey

      public String getApiKey()
    • getBaseUrl

      public String getBaseUrl()
    • getWsBaseUrl

      public String getWsBaseUrl()
    • getWorkspace

      public String getWorkspace()
    • getRegion

      public String getRegion()
    • getTimeout

      public Duration getTimeout()
      Single-request timeout (design §3).
    • getMaxRetries

      public Integer getMaxRetries()
    • getRaiseOnError

      public Boolean getRaiseOnError()
      Default true: failures raise exceptions; false: 2.x-style isError() returns.
    • getWsPingInterval

      public Duration getWsPingInterval()
      WebSocket ping interval (audio design §12#1). Default 0 = off (aligned with Python); behind NATs or proxies that silently drop idle connections, 20–30 s is recommended so half-open connections are detected instead of hanging forever.
    • getHttpClient

      public okhttp3.OkHttpClient getHttpClient()
      Externally injected OkHttpClient; the caller then owns its lifecycle.
    • getExecutor

      public Executor getExecutor()
      Externally injected async executor; the caller owns its lifecycle.