次の方法で共有


IEmbeddingGenerationService<TValue,TEmbedding>.GenerateEmbeddingsAsync Method

Definition

Generates an embedding from the given data.

public System.Threading.Tasks.Task<System.Collections.Generic.IList<ReadOnlyMemory<TEmbedding>>> GenerateEmbeddingsAsync (System.Collections.Generic.IList<TValue> data, Microsoft.SemanticKernel.Kernel? kernel = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GenerateEmbeddingsAsync : System.Collections.Generic.IList<'Value> * Microsoft.SemanticKernel.Kernel * System.Threading.CancellationToken -> System.Threading.Tasks.Task<System.Collections.Generic.IList<ReadOnlyMemory<'Embedding>>>
Public Function GenerateEmbeddingsAsync (data As IList(Of TValue), Optional kernel As Kernel = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of IList(Of ReadOnlyMemory(Of TEmbedding)))

Parameters

data
IList<TValue>

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

Task<IList<ReadOnlyMemory<TEmbedding>>>

List of embeddings

Applies to