Share via


OpenAITextEmbeddingGenerationService.GenerateEmbeddingsAsync Method

Definition

Generates an embedding from the given data.

public System.Threading.Tasks.Task<System.Collections.Generic.IList<ReadOnlyMemory<float>>> GenerateEmbeddingsAsync (System.Collections.Generic.IList<string> data, Microsoft.SemanticKernel.Kernel? kernel = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GenerateEmbeddingsAsync : System.Collections.Generic.IList<string> * Microsoft.SemanticKernel.Kernel * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IList<ReadOnlyMemory<single>>>
override this.GenerateEmbeddingsAsync : System.Collections.Generic.IList<string> * Microsoft.SemanticKernel.Kernel * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IList<ReadOnlyMemory<single>>>
Public Function GenerateEmbeddingsAsync (data As IList(Of String), Optional kernel As Kernel = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of IList(Of ReadOnlyMemory(Of Single)))

Parameters

data
IList<String>

List of strings to generate embeddings for

kernel
Kernel

The Kernel containing services, plugins, and other state for use throughout the operation.

cancellationToken
CancellationToken

The CancellationToken to monitor for cancellation requests. The default is None.

Returns

List of embeddings

Implements

Applies to