AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/rag/store/ElasticsearchStore.java:501–589

ElasticsearchStore的构建器。位于 io.agentscope.core.rag.store 包。核心成员包括 url、indexName、dimensions、username、password、disableSslVerification。

Builder for ElasticsearchStore.

方法摘要Method Summary

方法Method说明Description
public Builder url(String url)
设置URL。
Sets the Elasticsearch connection URL.
public Builder indexName(String indexName)
设置索引名称。
Sets the index name.
public Builder dimensions(int dimensions)
设置向量维度。
Sets the vector dimensions.
public Builder username(String username)
设置该配置项。
Sets the username for authentication.
public Builder password(String password)
设置密码。
Sets the password for authentication.
public Builder disableSslVerification(boolean disableSslVerification)
禁用该配置。
Sets whether to disable SSL verification.
public ElasticsearchStore build() throws VectorStoreException
构建ElasticsearchStore 实例。
Builds the ElasticsearchStore instance.

方法详情Method Detail

url

public Builder url(String url)

设置URL。

Sets the Elasticsearch connection URL.

参数Parameters
名称Name类型Type说明Description
urlString服务地址(类型 `String`)。the URL
返回Returns Builder
构建器。the builder
源码Source io/agentscope/core/rag/store/ElasticsearchStore.java:516–519

indexName

public Builder indexName(String indexName)

设置索引名称。

Sets the index name.

参数Parameters
名称Name类型Type说明Description
indexNameString索引名称。the index name
返回Returns Builder
构建器。the builder
源码Source io/agentscope/core/rag/store/ElasticsearchStore.java:526–529

dimensions

public Builder dimensions(int dimensions)

设置向量维度。

Sets the vector dimensions.

参数Parameters
名称Name类型Type说明Description
dimensionsint维度的数量。the number of dimensions
返回Returns Builder
构建器。the builder
源码Source io/agentscope/core/rag/store/ElasticsearchStore.java:536–539

username

public Builder username(String username)

设置该配置项。

Sets the username for authentication.

参数Parameters
名称Name类型Type说明Description
usernameStringusername(类型 `String`)。the username
返回Returns Builder
构建器。the builder
源码Source io/agentscope/core/rag/store/ElasticsearchStore.java:546–549

password

public Builder password(String password)

设置密码。

Sets the password for authentication.

参数Parameters
名称Name类型Type说明Description
passwordString密码。the password
返回Returns Builder
构建器。the builder
源码Source io/agentscope/core/rag/store/ElasticsearchStore.java:556–559

disableSslVerification

public Builder disableSslVerification(boolean disableSslVerification)

禁用该配置。

Sets whether to disable SSL verification.

参数Parameters
名称Name类型Type说明Description
disableSslVerificationboolean禁用 Ssl Verification(类型 `boolean`)。true to disable verification
返回Returns Builder
构建器。the builder
源码Source io/agentscope/core/rag/store/ElasticsearchStore.java:567–570

build

public ElasticsearchStore build() throws VectorStoreException

构建ElasticsearchStore 实例。

Builds the ElasticsearchStore instance.

返回Returns ElasticsearchStore
存储实例。the store instance
抛出Throws
  • VectorStoreException 可能抛出 `VectorStoreException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/core/rag/store/ElasticsearchStore.java:577–588
基于官方固定版本源码静态生成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.