IGenerativeModelStreamContentAsync(String, String, String, CancellationToken) Method
Streams content generation asynchronously based on the given input prompt, file URI, and MIME type.
Namespace: GenerativeAIAssembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
IAsyncEnumerable<GenerateContentResponse> StreamContentAsync(
string prompt,
string fileUri,
string mimeType,
CancellationToken cancellationToken = default
)
- prompt String
- The input string used as a prompt for generating and streaming content.
- fileUri String
- The URI of the file to be used for content generation.
- mimeType String
- The MIME type associated with the provided file URI.
- cancellationToken CancellationToken (Optional)
- Token to monitor for cancellation requests.
IAsyncEnumerableGenerateContentResponseAn asynchronous enumerable of
GenerateContentResponse instances representing the streamed content responses.