EmbeddingModelBatchEmbedContentAsync(IEnumerableContent, CancellationToken) Method

Embeds a batch of content based on a collection of Content objects.

Definition

Namespace: GenerativeAI
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
public Task<BatchEmbedContentsResponse> BatchEmbedContentAsync(
	IEnumerable<Content> contents,
	CancellationToken cancellationToken = default
)

Parameters

contents  IEnumerableContent
The collection of Content objects to embed.
cancellationToken  CancellationToken  (Optional)
A token to monitor for cancellation requests.

Return Value

TaskBatchEmbedContentsResponse
A task representing the asynchronous operation, containing the batch embedding response.

See Also