类 DashScopeHttpClient.Builder

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

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

    • Builder

      public Builder()
  • 方法详细资料

    • transport

      public DashScopeHttpClient.Builder transport(HttpTransport transport)
      Set the HTTP transport.
      参数:
      transport - the transport to use
      返回:
      this builder
    • apiKey

      public DashScopeHttpClient.Builder apiKey(String apiKey)
      Set the API key.
      参数:
      apiKey - the DashScope API key
      返回:
      this builder
    • baseUrl

      public DashScopeHttpClient.Builder baseUrl(String baseUrl)
      Set the base URL.
      参数:
      baseUrl - the base URL (null for default)
      返回:
      this builder
    • publicKeyId

      public DashScopeHttpClient.Builder publicKeyId(String publicKeyId)
      Set the RSA public key ID for encryption.

      When both publicKeyId and publicKey are set, requests and responses will be encrypted using AES-GCM with RSA key exchange, following Aliyun's encryption protocol.

      参数:
      publicKeyId - the public key ID (null to disable encryption)
      返回:
      this builder
    • publicKey

      public DashScopeHttpClient.Builder publicKey(String publicKey)
      Set the RSA public key for encryption (Base64-encoded).

      When both publicKeyId and publicKey are set, requests and responses will be encrypted using AES-GCM with RSA key exchange, following Aliyun's encryption protocol.

      参数:
      publicKey - the Base64-encoded RSA public key (null to disable encryption)
      返回:
      this builder
    • build

      public DashScopeHttpClient build()
      Build the DashScopeHttpClient.

      If no transport is specified, the default transport from HttpTransportFactory.getDefault() will be used, which provides automatic lifecycle management and cleanup on JVM shutdown.

      返回:
      a new DashScopeHttpClient instance