IGenerativeModelStreamContentAsync(GenerateContentRequest, CancellationToken) Method
Streams content generation results asynchronously based on a given request and optional cancellation token.
Namespace: GenerativeAIAssembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
IAsyncEnumerable<GenerateContentResponse> StreamContentAsync(
GenerateContentRequest request,
CancellationToken cancellationToken = default
)
- request GenerateContentRequest
- The content generation request containing input configurations and options.
- cancellationToken CancellationToken (Optional)
- An optional token to monitor for cancellation requests.
IAsyncEnumerableGenerateContentResponseAn asynchronous enumerable of
GenerateContentResponse objects containing the streamed generation results.