AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/embedding/dashscope/DashScopeTextEmbedding.java:219–309

DashScopeTextEmbedding的构建器。位于 io.agentscope.core.embedding.dashscope 包。核心成员包括 apiKey、modelName、dimensions、executionConfig、baseUrl、build。

Builder for DashScopeTextEmbedding.

方法摘要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 DashScopeTextEmbedding build()
构建DashScopeTextEmbedding 实例。
Builds the DashScopeTextEmbedding instance.

方法详情Method Detail

apiKey

public Builder apiKey(String apiKey)

设置API 键。

Sets the API key for DashScope authentication.

参数Parameters
名称Name类型Type说明Description
apiKeyStringAPI 密钥。the API key
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/embedding/dashscope/DashScopeTextEmbedding.java:232–235

modelName

public Builder modelName(String modelName)

设置模型名称到使用。

Sets the model name to use.

参数Parameters
名称Name类型Type说明Description
modelNameString模型名称(类型 `String`)。the model name (e.g., "text-embedding-v3")
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/embedding/dashscope/DashScopeTextEmbedding.java:243–246

dimensions

public Builder dimensions(int dimensions)

设置维度的向量化向量。

Sets the dimension of embedding vectors.

参数Parameters
名称Name类型Type说明Description
dimensionsint维度。the dimension
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/embedding/dashscope/DashScopeTextEmbedding.java:254–257

executionConfig

public Builder executionConfig(ExecutionConfig config)

设置默认执行配置。

Sets the default execution configuration.

参数Parameters
名称Name类型Type说明Description
configExecutionConfig配置对象(类型 `ExecutionConfig`)。the execution config (null for defaults)
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/embedding/dashscope/DashScopeTextEmbedding.java:265–268

baseUrl

public Builder baseUrl(String baseUrl)

设置自定义基类 URL 用于 DashScope API。

Sets a custom base URL for DashScope API.

参数Parameters
名称Name类型Type说明Description
baseUrlString基类 URL(类型 `String`)。the base URL (null for default)
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/embedding/dashscope/DashScopeTextEmbedding.java:276–279

build

public DashScopeTextEmbedding build()

构建DashScopeTextEmbedding 实例。

Builds the DashScopeTextEmbedding instance.

返回Returns DashScopeTextEmbedding
返回DashScopeTextEmbedding。configured DashScopeTextEmbedding instance
抛出Throws
  • IllegalStateException 可能抛出 `IllegalStateException`。if required parameters are missing or invalid
源码Source io/agentscope/core/embedding/dashscope/DashScopeTextEmbedding.java:290–308
基于官方固定版本源码静态生成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.