EmbeddingModelEmbedContentAsync(Content, CancellationToken) Method

Embeds content based on a text input message.

Definition

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

Parameters

content  Content
The content 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