Table of Contents

Method GetDocumentEmbeddingsAsync

Namespace
LMKit.Abstractions
Assembly
LM-Kit.NET.dll

GetDocumentEmbeddingsAsync(string, CancellationToken)

Asynchronously generates the embedding vector for one document/passage, applying any document-specific instruction the model supports.

Task<float[]> GetDocumentEmbeddingsAsync(string text, CancellationToken cancellationToken = default)

Parameters

text string

The document text to embed. Cannot be null or empty.

cancellationToken CancellationToken

Optional token to cancel the operation.

Returns

Task<float[]>

A task whose result is the document embedding vector.

GetDocumentEmbeddingsAsync(IEnumerable<string>, CancellationToken)

Asynchronously generates embedding vectors for a batch of documents/passages, applying any document-specific instruction the model supports.

Task<float[][]> GetDocumentEmbeddingsAsync(IEnumerable<string> texts, CancellationToken cancellationToken = default)

Parameters

texts IEnumerable<string>

The document texts to embed. Cannot be null or empty.

cancellationToken CancellationToken

Optional token to cancel the operation.

Returns

Task<float[][]>

A task whose result is an array of vectors, one per input text and in the same order.

Share