Partager via


DelegatingEmbeddingGenerator<TInput,TEmbedding>.GenerateAsync Method

Definition

Generates embeddings for each of the supplied values.

public virtual System.Threading.Tasks.Task<Microsoft.Extensions.AI.GeneratedEmbeddings<TEmbedding>> GenerateAsync (System.Collections.Generic.IEnumerable<TInput> values, Microsoft.Extensions.AI.EmbeddingGenerationOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
abstract member GenerateAsync : seq<'Input> * Microsoft.Extensions.AI.EmbeddingGenerationOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.GeneratedEmbeddings<'Embedding>>
override this.GenerateAsync : seq<'Input> * Microsoft.Extensions.AI.EmbeddingGenerationOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.AI.GeneratedEmbeddings<'Embedding>>
Public Overridable Function GenerateAsync (values As IEnumerable(Of TInput), Optional options As EmbeddingGenerationOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of GeneratedEmbeddings(Of TEmbedding))

Parameters

values
IEnumerable<TInput>

The collection of values for which to generate embeddings.

options
EmbeddingGenerationOptions

The embedding generation options to configure the request.

cancellationToken
CancellationToken

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

Returns

Task<GeneratedEmbeddings<TEmbedding>>

The generated embeddings.

Implements

Applies to