Constructor QdrantEmbeddingStore
QdrantEmbeddingStore(QdrantClient, bool)
Initializes a new instance of the QdrantEmbeddingStore class using the specified QdrantClient.
public QdrantEmbeddingStore(QdrantClient client, bool ownsClient = false)
Parameters
clientQdrantClientThe QdrantClient instance used to communicate with the Qdrant service.
ownsClientboolIf
true, the store takes ownership of the client and will dispose it when the store is disposed. Iffalse(default), the caller retains ownership and is responsible for disposing the client.
Exceptions
- ArgumentNullException
Thrown if
clientis null.
QdrantEmbeddingStore(Uri, string, string)
Initializes a new instance of the QdrantEmbeddingStore.
public QdrantEmbeddingStore(Uri address, string apiKey = null, string certificateThumbprint = null)
Parameters
addressUriThe URI of the Qdrant service endpoint. Must not be null.
apiKeystringAn optional API key for authentication.
certificateThumbprintstringAn optional SHA-256 certificate thumbprint to enable secure GRPC communication. If provided, a secure channel is used; otherwise, a standard connection is created.
Exceptions
- ArgumentNullException
Thrown when
addressis null.
QdrantEmbeddingStore(QdrantGrpcClient)
Initializes a new instance of the QdrantEmbeddingStore class using a pre-configured QdrantGrpcClient. This constructor is intended for use under .NET Framework to support HTTPS connections with secure gRPC communication.
public QdrantEmbeddingStore(QdrantGrpcClient grpcClient)
Parameters
grpcClientQdrantGrpcClientA pre-configured instance of QdrantGrpcClient that is set up to use a secure channel (HTTPS) with custom certificate thumbprint validation and optional API key authentication.
Example usage under .NET Framework:
// Update with your API key and certificate thumbprint, if any. string apiKey = ""; // update, if any string tp = "YOUR_CERTIFICATE_THUMBPRINT"; // Create a secure gRPC channel using HTTPS and a custom WinHttpHandler for certificate validation. var channel = GrpcChannel.ForAddress($"https://localhost:6334", new GrpcChannelOptions { HttpHandler = new WinHttpHandler { ServerCertificateValidationCallback = CertificateValidation.Thumbprint(tp) } }); // Intercept the call to add the API key to metadata. var callInvoker = channel.Intercept(metadata0 => { metadata0.Add("api-key", apiKey); return metadata0; }); // Create a QdrantGrpcClient using the intercepted call invoker. var grpcClient = new QdrantGrpcClient(callInvoker); // Instantiate the QdrantEmbeddingStore using the secure gRPC client. var store = new QdrantEmbeddingStore(grpcClient);