GeminiModelGenerateContentAsync(String, String, CancellationToken) Method
Generates content asynchronously based on the given text prompt and the specified file path.
Namespace: GenerativeAIAssembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
public Task<GenerateContentResponse> GenerateContentAsync(
string prompt,
string filePath,
CancellationToken cancellationToken = default
)
- prompt String
- The textual input used as the basis for content generation.
- filePath String
- The path to the file that should be included in the content generation request.
- cancellationToken CancellationToken (Optional)
- A cancellation token used to propagate notifications that the operation should be canceled.
TaskGenerateContentResponseA task representing the asynchronous operation, containing the
GenerateContentResponse or null if the operation fails.