Class DashScopeModelConfig.Builder

java.lang.Object
io.agentscope.extensions.scheduler.config.DashScopeModelConfig.Builder
Enclosing class:
DashScopeModelConfig

public static class DashScopeModelConfig.Builder extends Object
Builder for creating DashScopeModelConfig instances.
  • Method Details

    • apiKey

      public DashScopeModelConfig.Builder apiKey(String apiKey)
      Set the API key for DashScope authentication (required).
      Parameters:
      apiKey - The API key
      Returns:
      This builder
    • modelName

      public DashScopeModelConfig.Builder modelName(String modelName)
      Set the model name to use (required).

      The model name determines which API is used:

      • Vision models (qvq* or *-vl*) → MultiModalConversation API
      • Text models → Generation API

      Common model names:

      • "qwen-max" - Latest flagship model
      • "qwen-plus" - Enhanced performance
      • "qwen-turbo" - Fast and efficient
      • "qwen-vl-plus" - Vision-language model
      Parameters:
      modelName - The model name
      Returns:
      This builder
    • stream

      public DashScopeModelConfig.Builder stream(boolean stream)
      Set whether streaming should be enabled (optional, default: true).
      Parameters:
      stream - true to enable streaming, false for non-streaming
      Returns:
      This builder
    • enableThinking

      public DashScopeModelConfig.Builder enableThinking(boolean enableThinking)
      Set whether thinking mode should be enabled (optional, default: false). Thinking mode allows the model to show its reasoning process.
      Parameters:
      enableThinking - true to enable thinking mode, false to disable
      Returns:
      This builder
    • baseUrl

      public DashScopeModelConfig.Builder baseUrl(String baseUrl)
      Set a custom base URL for DashScope API (optional).

      Useful for:

      • Using regional endpoints
      • Proxying through custom servers
      • Testing with mock servers
      Parameters:
      baseUrl - The base URL (null for default)
      Returns:
      This builder
    • build

      public DashScopeModelConfig build()
      Build the DashScopeModelConfig instance.
      Returns:
      A new DashScopeModelConfig instance
      Throws:
      IllegalArgumentException - if required fields are missing or invalid