OpenAITextEmbeddingGenerationService.GenerateEmbeddingsAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
- 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