Builder
public static class Builder
源码Source
io/agentscope/core/embedding/ollama/OllamaTextEmbedding.java:214–288OllamaTextEmbedding的构建器。位于 io.agentscope.core.embedding.ollama 包。核心成员包括 baseUrl、modelName、dimensions、executionConfig、build。
Builder for OllamaTextEmbedding.
方法摘要Method Summary
| 方法Method | 说明Description |
|---|---|
public Builder baseUrl(String baseUrl) | 设置基类 URL。 Sets the base URL for Ollama API. |
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 OllamaTextEmbedding build() | 构建OllamaTextEmbedding 实例。 Builds the OllamaTextEmbedding instance. |
方法详情Method Detail
baseUrl
public Builder baseUrl(String baseUrl)
设置基类 URL。
Sets the base URL for Ollama API.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
baseUrl | String | 基类 URL(类型 `String`)。the base URL (e.g., "http://localhost:11434") |
Builder返回当前实例,以支持链式调用。this builder instance
源码Source
io/agentscope/core/embedding/ollama/OllamaTextEmbedding.java:226–229modelName
public Builder modelName(String modelName)
设置模型名称到使用。
Sets the model name to use.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
modelName | String | 模型名称(类型 `String`)。the model name (e.g., "nomic-embed-text", "all-minilm") |
Builder返回当前实例,以支持链式调用。this builder instance
源码Source
io/agentscope/core/embedding/ollama/OllamaTextEmbedding.java:237–240dimensions
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/ollama/OllamaTextEmbedding.java:248–251executionConfig
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/ollama/OllamaTextEmbedding.java:259–262build
public OllamaTextEmbedding build()
构建OllamaTextEmbedding 实例。
Builds the OllamaTextEmbedding instance.
OllamaTextEmbedding返回OllamaTextEmbedding。configured OllamaTextEmbedding instance
IllegalStateException可能抛出 `IllegalStateException`。if required parameters are missing or invalid
源码Source
io/agentscope/core/embedding/ollama/OllamaTextEmbedding.java:273–287