IGenerativeModelGenerateContentAsync(IEnumerablePart, CancellationToken) Method

Generate content based on a sequence of Part objects.

Definition

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

Parameters

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

Return Value

TaskGenerateContentResponse
Returns an instance of GenerateContentResponse containing the generated content.

See Also