AS AgentScopeAPI 手册 / API Reference

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
apiKeyStringAPI 密钥。The API key
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/extensions/scheduler/config/DashScopeModelConfig.java:227–230

modelName

public Builder modelName(String modelName)

设置模型名称到使用(必填)。

Set the model name to use (required).

参数Parameters
名称Name类型Type说明Description
modelNameString模型名称。The model name
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/extensions/scheduler/config/DashScopeModelConfig.java:252–255

stream

public Builder stream(boolean stream)

设置流。

Set whether streaming should be enabled (optional, default: true).

参数Parameters
名称Name类型Type说明Description
streamboolean流(类型 `boolean`)。true to enable streaming, false for non-streaming
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/extensions/scheduler/config/DashScopeModelConfig.java:263–266

enableThinking

public Builder enableThinking(boolean enableThinking)

启用该配置。

Set whether thinking mode should be enabled (optional, default: false).

参数Parameters
名称Name类型Type说明Description
enableThinkingboolean启用 Thinking(类型 `boolean`)。true to enable thinking mode, false to disable
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/extensions/scheduler/config/DashScopeModelConfig.java:275–278

baseUrl

public Builder baseUrl(String baseUrl)

设置自定义基类 URL 用于 DashScope API(可选)。

Set a custom base URL for DashScope API (optional).

参数Parameters
名称Name类型Type说明Description
baseUrlString基类 URL(类型 `String`)。The base URL (null for default)
返回Returns Builder
返回当前实例,以支持链式调用。This builder
源码Source io/agentscope/extensions/scheduler/config/DashScopeModelConfig.java:293–296

build

public DashScopeModelConfig build()

构建DashScopeModelConfig 实例。

Build the DashScopeModelConfig instance.

返回Returns DashScopeModelConfig
一种新的DashScopeModelConfig 实例。A new DashScopeModelConfig instance
抛出Throws
  • IllegalArgumentException 可能抛出 `IllegalArgumentException`。if required fields are missing or invalid
源码Source io/agentscope/extensions/scheduler/config/DashScopeModelConfig.java:304–306
基于官方固定版本源码静态生成Generated from pinned official sources · Python 2.0.11 · Java 2.0.4
签名与文档为静态抽取;如有疑问请以源码为准。Signatures and docs are extracted statically; verify against the source when in doubt.