Class DashScopeModelConfig.Builder
java.lang.Object
io.agentscope.extensions.scheduler.config.DashScopeModelConfig.Builder
- Enclosing class:
- DashScopeModelConfig
Builder for creating DashScopeModelConfig instances.
-
Method Summary
Modifier and TypeMethodDescriptionSet the API key for DashScope authentication (required).Set a custom base URL for DashScope API (optional).build()Build the DashScopeModelConfig instance.enableThinking(boolean enableThinking) Set whether thinking mode should be enabled (optional, default: false).Set the model name to use (required).stream(boolean stream) Set whether streaming should be enabled (optional, default: true).
-
Method Details
-
apiKey
Set the API key for DashScope authentication (required).- Parameters:
apiKey- The API key- Returns:
- This builder
-
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
Set whether streaming should be enabled (optional, default: true).- Parameters:
stream- true to enable streaming, false for non-streaming- Returns:
- This builder
-
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
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
Build the DashScopeModelConfig instance.- Returns:
- A new DashScopeModelConfig instance
- Throws:
IllegalArgumentException- if required fields are missing or invalid
-