Builder
public static class Builder
源码Source
io/agentscope/extensions/scheduler/config/DashScopeModelConfig.java:212–307构建器,用于构建并配置目标实例。位于 io.agentscope.extensions.scheduler.config 包。核心成员包括 apiKey、modelName、stream、enableThinking、baseUrl、build。
Builder for creating DashScopeModelConfig instances.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder apiKey(String apiKey) | 设置API 键。 Set the API key for DashScope authentication (required). |
public Builder modelName(String modelName) | 设置模型名称到使用(必填)。 Set the model name to use (required). |
public Builder stream(boolean stream) | 设置流。 Set whether streaming should be enabled (optional, default: true). |
public Builder enableThinking(boolean enableThinking) | 启用该配置。 Set whether thinking mode should be enabled (optional, default: false). |
public Builder baseUrl(String baseUrl) | 设置自定义基类 URL 用于 DashScope API(可选)。 Set a custom base URL for DashScope API (optional). |
public DashScopeModelConfig build() | 构建DashScopeModelConfig 实例。 Build the DashScopeModelConfig instance. |
方法详情Method Detail
apiKey
public Builder apiKey(String apiKey)
设置API 键。
Set the API key for DashScope authentication (required).
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
apiKey | String | API 密钥。The API key |
Builder返回当前实例,以支持链式调用。This builder
源码Source
io/agentscope/extensions/scheduler/config/DashScopeModelConfig.java:227–230modelName
public Builder modelName(String modelName)
设置模型名称到使用(必填)。
Set the model name to use (required).
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
modelName | String | 模型名称。The model name |
Builder返回当前实例,以支持链式调用。This builder
源码Source
io/agentscope/extensions/scheduler/config/DashScopeModelConfig.java:252–255stream
public Builder stream(boolean stream)
设置流。
Set whether streaming should be enabled (optional, default: true).
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
stream | boolean | 流(类型 `boolean`)。true to enable streaming, false for non-streaming |
Builder返回当前实例,以支持链式调用。This builder
源码Source
io/agentscope/extensions/scheduler/config/DashScopeModelConfig.java:263–266enableThinking
public Builder enableThinking(boolean enableThinking)
启用该配置。
Set whether thinking mode should be enabled (optional, default: false).
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
enableThinking | boolean | 启用 Thinking(类型 `boolean`)。true to enable thinking mode, false to disable |
Builder返回当前实例,以支持链式调用。This builder
源码Source
io/agentscope/extensions/scheduler/config/DashScopeModelConfig.java:275–278baseUrl
public Builder baseUrl(String baseUrl)
设置自定义基类 URL 用于 DashScope API(可选)。
Set a custom base URL for DashScope API (optional).
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
baseUrl | String | 基类 URL(类型 `String`)。The base URL (null for default) |
Builder返回当前实例,以支持链式调用。This builder
源码Source
io/agentscope/extensions/scheduler/config/DashScopeModelConfig.java:293–296build
public DashScopeModelConfig build()
构建DashScopeModelConfig 实例。
Build the DashScopeModelConfig instance.
DashScopeModelConfig一种新的DashScopeModelConfig 实例。A new DashScopeModelConfig instance
IllegalArgumentException可能抛出 `IllegalArgumentException`。if required fields are missing or invalid
源码Source
io/agentscope/extensions/scheduler/config/DashScopeModelConfig.java:304–306