Share via


EmbeddingGeneratorExtensions.GenerateEmbeddingVectorAsync<TInput,TEmbedding> Method

Definition

public static System.Threading.Tasks.Task<ReadOnlyMemory<TEmbedding>> GenerateEmbeddingVectorAsync<TInput,TEmbedding> (this Microsoft.Extensions.AI.IEmbeddingGenerator<TInput,Microsoft.Extensions.AI.Embedding<TEmbedding>> generator, TInput value, Microsoft.Extensions.AI.EmbeddingGenerationOptions? options = default, System.Threading.CancellationToken cancellationToken = default);
static member GenerateEmbeddingVectorAsync : Microsoft.Extensions.AI.IEmbeddingGenerator<'Input, Microsoft.Extensions.AI.Embedding<'Embedding>> * 'Input * Microsoft.Extensions.AI.EmbeddingGenerationOptions * System.Threading.CancellationToken -> System.Threading.Tasks.Task<ReadOnlyMemory<'Embedding>>
<Extension()>
Public Function GenerateEmbeddingVectorAsync(Of TInput, TEmbedding) (generator As IEmbeddingGenerator(Of TInput, Embedding(Of TEmbedding)), value As TInput, Optional options As EmbeddingGenerationOptions = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ReadOnlyMemory(Of TEmbedding))

Type Parameters

TInput
TEmbedding

Parameters

generator
IEmbeddingGenerator<TInput,Embedding<TEmbedding>>
value
TInput
cancellationToken
CancellationToken

Returns

Task<ReadOnlyMemory<TEmbedding>>

Applies to