IGenerativeModelStreamContentAsync(IEnumerablePart, CancellationToken) Method

Streams content generation based on a GenerateContentRequest asynchronously.

Definition

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

Parameters

parts  IEnumerablePart

[Missing <param name="parts"/> documentation for "M:GenerativeAI.IGenerativeModel.StreamContentAsync(System.Collections.Generic.IEnumerable{GenerativeAI.Types.Part},System.Threading.CancellationToken)"]

cancellationToken  CancellationToken  (Optional)
A token to monitor for cancellation requests.

Return Value

IAsyncEnumerableGenerateContentResponse
An asynchronous stream of GenerateContentResponse objects representing the generated content.

See Also