EmbeddingModelEmbedContentAsync(IEnumerableString, CancellationToken) Method

Embeds content based on a collection of strings.

Definition

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

Parameters

messages  IEnumerableString
The collection of text strings 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