EmbeddingModelEmbedContentAsync(IEnumerablePart, CancellationToken) Method

Embeds content based on a sequence of Part objects.

Definition

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

Parameters

parts  IEnumerablePart
The sequence of Part objects to be used for embedding content.
cancellationToken  CancellationToken  (Optional)
A token for cancelling the operation, if needed.

Return Value

TaskEmbedContentResponse
Returns an instance of EmbedContentResponse containing the embeddings.

See Also