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.
public virtual Task<float[]> GetDocumentEmbeddingsAsync(string text, CancellationToken cancellationToken = default)
Parameters
textstringThe document text to embed. Cannot be null or empty.
cancellationTokenCancellationTokenOptional token to cancel the operation.
Returns
Remarks
The default implementation reuses the plain path. Override it when the provider applies a distinct document instruction or input type.
GetDocumentEmbeddingsAsync(IEnumerable<string>, CancellationToken)
Asynchronously generates embedding vectors for a batch of documents/passages, applying any document-specific instruction the model supports.
public virtual Task<float[][]> GetDocumentEmbeddingsAsync(IEnumerable<string> texts, CancellationToken cancellationToken = default)
Parameters
textsIEnumerable<string>The document texts to embed. Cannot be null or empty.
cancellationTokenCancellationTokenOptional 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.
Remarks
The default implementation reuses the plain path. Override it when the provider applies a distinct document instruction or input type.