Package io.agentscope.core.rag.store
Class QdrantStore.Builder
java.lang.Object
io.agentscope.core.rag.store.QdrantStore.Builder
- Enclosing class:
- QdrantStore
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
Modifier and TypeMethodDescriptionSets the API key for authentication.build()Builds a new QdrantStore instance.checkCompatibility(boolean checkCompatibility) Sets whether to check client-server compatibility.collectionName(String collectionName) Sets the collection name.dimensions(int dimensions) Sets the vector dimensions.Sets the Qdrant server location.useTransportLayerSecurity(boolean useTransportLayerSecurity) Sets whether to use Transport Layer Security (TLS) for gRPC connections.
-
Method Details
-
location
Sets the Qdrant server location.- Parameters:
location- the Qdrant server location (e.g., "http://localhost:6333" or "localhost:6334")- Returns:
- this builder
-
collectionName
Sets the collection name.- Parameters:
collectionName- the name of the collection to use- Returns:
- this builder
-
dimensions
Sets the vector dimensions.- Parameters:
dimensions- the dimension of vectors that will be stored- Returns:
- this builder
-
apiKey
Sets the API key for authentication.- Parameters:
apiKey- the API key (optional, null for no authentication)- Returns:
- this builder
-
useTransportLayerSecurity
Sets whether to use Transport Layer Security (TLS) for gRPC connections.Default is false. Set to true to enable TLS encryption for secure connections.
- Parameters:
useTransportLayerSecurity- true to enable TLS, false otherwise- Returns:
- this builder
-
checkCompatibility
Sets whether to check client-server compatibility.Default is true. Set to false to skip version compatibility checks, which can be useful when connecting to older Qdrant servers or when compatibility checks fail incorrectly.
- Parameters:
checkCompatibility- true to enable compatibility checks, false to skip- Returns:
- this builder
-
build
Builds a new QdrantStore instance.The client connection is established immediately during construction. If the connection fails or the collection cannot be created, a VectorStoreException is thrown.
- Returns:
- a new QdrantStore instance
- Throws:
IllegalArgumentException- if required parameters are invalidVectorStoreException- if client initialization or collection creation fails
-