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 |
|---|---|---|
location | String | location(类型 `String`)。the Qdrant server location (e.g., "http://localhost:6333" or "localhost:6334") |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/rag/store/QdrantStore.java:997–1000collectionName
public Builder collectionName(String collectionName)
设置集合名称。
Sets the collection name.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
collectionName | String | 集合到使用的名称。the name of the collection to use |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/rag/store/QdrantStore.java:1008–1011dimensions
public Builder dimensions(int dimensions)
设置向量维度。
Sets the vector dimensions.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
dimensions | int | 向量维度(类型 `int`)。the dimension of vectors that will be stored |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/rag/store/QdrantStore.java:1019–1022apiKey
public Builder apiKey(String apiKey)
设置API 键。
Sets the API key for authentication.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
apiKey | String | API 键(类型 `String`)。the API key (optional, null for no authentication) |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/rag/store/QdrantStore.java:1030–1033useTransportLayerSecurity
public Builder useTransportLayerSecurity(boolean useTransportLayerSecurity)
设置该配置项。
Sets whether to use Transport Layer Security (TLS) for gRPC connections.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
useTransportLayerSecurity | boolean | 使用传输层 Layer Security(类型 `boolean`)。true to enable TLS, false otherwise |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/rag/store/QdrantStore.java:1043–1046checkCompatibility
public Builder checkCompatibility(boolean checkCompatibility)
设置该配置项。
Sets whether to check client-server compatibility.
参数Parameters
| 名称Name | 类型Type | 说明Description |
|---|---|---|
checkCompatibility | boolean | 检查 Compatibility(类型 `boolean`)。true to enable compatibility checks, false to skip |
Builder返回当前实例,以支持链式调用。this builder
源码Source
io/agentscope/core/rag/store/QdrantStore.java:1058–1061build
public QdrantStore build() throws VectorStoreException
构建新的QdrantStore 实例。
Builds a new QdrantStore instance.
QdrantStore一种新的QdrantStore 实例。a new QdrantStore instance
VectorStoreException可能抛出 `VectorStoreException`。Thrown when the operation cannot be completed.
源码Source
io/agentscope/core/rag/store/QdrantStore.java:1073–1085