Table of Contents

Method GenerateAsync

Namespace
LMKit.Integrations.SemanticKernel.Embeddings
Assembly
LM-Kit.NET.Integrations.SemanticKernel.dll

GenerateAsync(IEnumerable<string>, EmbeddingGenerationOptions?, CancellationToken)

Asynchronously generates embeddings for a collection of text inputs.

public Task<GeneratedEmbeddings<Embedding<float>>> GenerateAsync(IEnumerable<string> values, EmbeddingGenerationOptions? options = null, CancellationToken cancellationToken = default)

Parameters

values IEnumerable<string>

A collection of text strings for which embeddings are to be generated.

options EmbeddingGenerationOptions

Optional embedding generation options.

cancellationToken CancellationToken

A token that can be used to cancel the embedding generation operation.

Returns

Task<GeneratedEmbeddings<Embedding<float>>>

A task that represents the asynchronous operation. The task result contains Microsoft.Extensions.AI.GeneratedEmbeddings<TEmbedding> with embedding vectors corresponding to the input texts.