Table of Contents

Constructor QdrantEmbeddingStore

Namespace
LMKit.Data.Storage.Qdrant
Assembly
LM-Kit.NET.Data.Connectors.Qdrant.dll

QdrantEmbeddingStore(QdrantClient, bool)

Initializes a new instance of the QdrantEmbeddingStore class using the specified QdrantClient.

public QdrantEmbeddingStore(QdrantClient client, bool ownsClient = false)

Parameters

client QdrantClient

The QdrantClient instance used to communicate with the Qdrant service.

ownsClient bool

If true, the store takes ownership of the client and will dispose it when the store is disposed. If false (default), the caller retains ownership and is responsible for disposing the client.

Exceptions

ArgumentNullException

Thrown if client is null.

QdrantEmbeddingStore(Uri, string, string)

Initializes a new instance of the QdrantEmbeddingStore.

public QdrantEmbeddingStore(Uri address, string apiKey = null, string certificateThumbprint = null)

Parameters

address Uri

The URI of the Qdrant service endpoint. Must not be null.

apiKey string

An optional API key for authentication.

certificateThumbprint string

An 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 QdrantGrpcClient

A 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);