Method GetEmbeddings
- Namespace
- LMKit.Abstractions
- Assembly
- LM-Kit.NET.dll
GetEmbeddings(string, CancellationToken)
Synchronously generates the embedding vector for a single text.
public float[] GetEmbeddings(string text, CancellationToken cancellationToken = default)
Parameters
textstringThe text to embed. Cannot be null or empty.
cancellationTokenCancellationTokenOptional token to cancel the operation.
Returns
- float[]
The embedding vector.
GetEmbeddings(IEnumerable<string>, CancellationToken)
Synchronously generates embedding vectors for a batch of texts.
public float[][] GetEmbeddings(IEnumerable<string> texts, CancellationToken cancellationToken = default)
Parameters
textsIEnumerable<string>The texts to embed. Cannot be null or empty.
cancellationTokenCancellationTokenOptional token to cancel the operation.
Returns
- float[][]
An array of vectors, one per input text and in the same order.