GeminiModelStreamContentAsync(String, String, CancellationToken) Method
Streams content generation asynchronously based on the provided text prompt, file path, and cancellation token.
Namespace: GenerativeAIAssembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
public IAsyncEnumerable<GenerateContentResponse> StreamContentAsync(
string prompt,
string filePath,
CancellationToken cancellationToken = default
)
- prompt String
- The input text prompt used to guide the content generation process.
- filePath String
- The local file path
- cancellationToken CancellationToken (Optional)
- A token to monitor for cancellation requests during the streaming process.
IAsyncEnumerableGenerateContentResponseAn asynchronous enumerable of
GenerateContentResponse instances representing the streamed content generation results.