Table of Contents

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

text string

The text to embed. Cannot be null or empty.

cancellationToken CancellationToken

Optional 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

texts IEnumerable<string>

The texts to embed. Cannot be null or empty.

cancellationToken CancellationToken

Optional token to cancel the operation.

Returns

float[][]

An array of vectors, one per input text and in the same order.

Share