Constructor QdrantEmbeddingStore
QdrantEmbeddingStore(Uri, string, string)
Initializes a new instance of the QdrantEmbeddingStore.
public QdrantEmbeddingStore(Uri address, string apiKey = null, string certificateThumbprint = null)
Parameters
address
UriThe URI of the Qdrant service endpoint. Must not be null.
apiKey
stringAn optional API key for authentication.
certificateThumbprint
stringAn 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
address
is 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
grpcClient
QdrantGrpcClientA 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);