Builder
public static class Builder
源码Source
io/agentscope/core/embedding/dashscope/DashScopeMultiModalEmbedding.java:310–400DashScopeMultiModalEmbedding的构建器。位于 io.agentscope.core.embedding.dashscope 包。核心成员包括 apiKey、modelName、dimensions、executionConfig、baseUrl、build。
Builder for DashScopeMultiModalEmbedding.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder apiKey(String apiKey) | 设置API 键。 Sets the API key for DashScope authentication. |
public Builder modelName(String modelName) | 设置模型名称到使用。 Sets the model name to use. |
public Builder dimensions(int dimensions) | 设置维度的向量化向量。 Sets the dimension of embedding vectors. |
public Builder executionConfig(ExecutionConfig config) | 设置默认执行配置。 Sets the default execution configuration. |
public Builder baseUrl(String baseUrl) | 设置自定义基类 URL 用于 DashScope API。 Sets a custom base URL for DashScope API. |
public DashScopeMultiModalEmbedding build() | 构建DashScopeMultiModalEmbedding 实例。 Builds the DashScopeMultiModalEmbedding instance. |
方法详情Method Detail
apiKey
public Builder apiKey(String apiKey)
设置API 键。
Sets the API key for DashScope authentication.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
apiKey | String | API 密钥。the API key |
Builder返回当前实例,以支持链式调用。this builder instance
源码Source
io/agentscope/core/embedding/dashscope/DashScopeMultiModalEmbedding.java:323–326modelName
public Builder modelName(String modelName)
设置模型名称到使用。
Sets the model name to use.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
modelName | String | 模型名称(类型 `String`)。the model name (e.g., "multimodal-embedding-v1") |
Builder返回当前实例,以支持链式调用。this builder instance
源码Source
io/agentscope/core/embedding/dashscope/DashScopeMultiModalEmbedding.java:334–337dimensions
public Builder dimensions(int dimensions)
设置维度的向量化向量。
Sets the dimension of embedding vectors.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
dimensions | int | 维度。the dimension |
Builder返回当前实例,以支持链式调用。this builder instance
源码Source
io/agentscope/core/embedding/dashscope/DashScopeMultiModalEmbedding.java:345–348executionConfig
public Builder executionConfig(ExecutionConfig config)
设置默认执行配置。
Sets the default execution configuration.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
config | ExecutionConfig | 配置对象(类型 `ExecutionConfig`)。the execution config (null for defaults) |
Builder返回当前实例,以支持链式调用。this builder instance
源码Source
io/agentscope/core/embedding/dashscope/DashScopeMultiModalEmbedding.java:356–359baseUrl
public Builder baseUrl(String baseUrl)
设置自定义基类 URL 用于 DashScope API。
Sets a custom base URL for DashScope API.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
baseUrl | String | 基类 URL(类型 `String`)。the base URL (null for default) |
Builder返回当前实例,以支持链式调用。this builder instance
源码Source
io/agentscope/core/embedding/dashscope/DashScopeMultiModalEmbedding.java:367–370build
public DashScopeMultiModalEmbedding build()
构建DashScopeMultiModalEmbedding 实例。
Builds the DashScopeMultiModalEmbedding instance.
DashScopeMultiModalEmbedding返回DashScopeMultiModalEmbedding。configured DashScopeMultiModalEmbedding instance
IllegalStateException可能抛出 `IllegalStateException`。if required parameters are missing or invalid
源码Source
io/agentscope/core/embedding/dashscope/DashScopeMultiModalEmbedding.java:381–399