AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/embedding/ollama/OllamaTextEmbedding.java:214–288

OllamaTextEmbedding的构建器。位于 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
baseUrlString基类 URL(类型 `String`)。the base URL (e.g., "http://localhost:11434")
返回Returns Builder
返回当前实例,以支持链式调用。this builder instance
源码Source io/agentscope/core/embedding/ollama/OllamaTextEmbedding.java:226–229

modelName

public Builder modelName(String modelName)

设置模型名称到使用。

Sets the model name to use.

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

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/ollama/OllamaTextEmbedding.java:248–251

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/ollama/OllamaTextEmbedding.java:259–262

build

public OllamaTextEmbedding build()

构建OllamaTextEmbedding 实例。

Builds the OllamaTextEmbedding instance.

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