EmbeddingModelEmbedContentAsync(EmbedContentRequest, CancellationToken) Method

Embeds content based on the provided text input message.

Definition

Namespace: GenerativeAI
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
public Task<EmbedContentResponse> EmbedContentAsync(
	EmbedContentRequest request,
	CancellationToken cancellationToken = default
)

Parameters

request  EmbedContentRequest
The request object to generate embeddings from.
cancellationToken  CancellationToken  (Optional)
A token to monitor for cancellation requests.

Return Value

TaskEmbedContentResponse
A task representing the asynchronous operation, containing the embedding response.

See Also