AS AgentScopeAPI 手册 / API Reference

Builder

public static class Builder
源码Source io/agentscope/core/rag/store/QdrantStore.java:980–1086

构建器,用于构建并配置目标实例。位于 io.agentscope.core.rag.store 包。核心成员包括 location、collectionName、dimensions、apiKey、useTransportLayerSecurity、checkCompatibility。

Builder for creating QdrantStore instances with fluent configuration.

Example usage:

`QdrantStore store = QdrantStore.builder()
.location("http://localhost:6333")
.collectionName("my_collection")
.dimensions(1024)
.apiKey("my-api-key")
.useTransportLayerSecurity(true)
.checkCompatibility(false)
.build();
`

方法摘要Method Summary

方法Method说明Description
public Builder location(String location)
设置该配置项。
Sets the Qdrant server location.
public Builder collectionName(String collectionName)
设置集合名称。
Sets the collection name.
public Builder dimensions(int dimensions)
设置向量维度。
Sets the vector dimensions.
public Builder apiKey(String apiKey)
设置API 键。
Sets the API key for authentication.
public Builder useTransportLayerSecurity(boolean useTransportLayerSecurity)
设置该配置项。
Sets whether to use Transport Layer Security (TLS) for gRPC connections.
public Builder checkCompatibility(boolean checkCompatibility)
设置该配置项。
Sets whether to check client-server compatibility.
public QdrantStore build() throws VectorStoreException
构建新的QdrantStore 实例。
Builds a new QdrantStore instance.

方法详情Method Detail

location

public Builder location(String location)

设置该配置项。

Sets the Qdrant server location.

参数Parameters
名称Name类型Type说明Description
locationStringlocation(类型 `String`)。the Qdrant server location (e.g., "http://localhost:6333" or "localhost:6334")
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/rag/store/QdrantStore.java:997–1000

collectionName

public Builder collectionName(String collectionName)

设置集合名称。

Sets the collection name.

参数Parameters
名称Name类型Type说明Description
collectionNameString集合到使用的名称。the name of the collection to use
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/rag/store/QdrantStore.java:1008–1011

dimensions

public Builder dimensions(int dimensions)

设置向量维度。

Sets the vector dimensions.

参数Parameters
名称Name类型Type说明Description
dimensionsint向量维度(类型 `int`)。the dimension of vectors that will be stored
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/rag/store/QdrantStore.java:1019–1022

apiKey

public Builder apiKey(String apiKey)

设置API 键。

Sets the API key for authentication.

参数Parameters
名称Name类型Type说明Description
apiKeyStringAPI 键(类型 `String`)。the API key (optional, null for no authentication)
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/rag/store/QdrantStore.java:1030–1033

useTransportLayerSecurity

public Builder useTransportLayerSecurity(boolean useTransportLayerSecurity)

设置该配置项。

Sets whether to use Transport Layer Security (TLS) for gRPC connections.

参数Parameters
名称Name类型Type说明Description
useTransportLayerSecurityboolean使用传输层 Layer Security(类型 `boolean`)。true to enable TLS, false otherwise
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/rag/store/QdrantStore.java:1043–1046

checkCompatibility

public Builder checkCompatibility(boolean checkCompatibility)

设置该配置项。

Sets whether to check client-server compatibility.

参数Parameters
名称Name类型Type说明Description
checkCompatibilityboolean检查 Compatibility(类型 `boolean`)。true to enable compatibility checks, false to skip
返回Returns Builder
返回当前实例,以支持链式调用。this builder
源码Source io/agentscope/core/rag/store/QdrantStore.java:1058–1061

build

public QdrantStore build() throws VectorStoreException

构建新的QdrantStore 实例。

Builds a new QdrantStore instance.

返回Returns QdrantStore
一种新的QdrantStore 实例。a new QdrantStore instance
抛出Throws
  • VectorStoreException 可能抛出 `VectorStoreException`。Thrown when the operation cannot be completed.
源码Source io/agentscope/core/rag/store/QdrantStore.java:1073–1085
基于官方固定版本源码静态生成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.