IGenerativeModelGenerateContentAsync(String, CancellationToken) Method
Generates content asynchronously based on the specified text input prompt.
Namespace: GenerativeAIAssembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
Task<GenerateContentResponse> GenerateContentAsync(
string prompt,
CancellationToken cancellationToken = default
)
- prompt String
- The text input used to generate the content.
- cancellationToken CancellationToken (Optional)
- Token to monitor for cancellation requests.
TaskGenerateContentResponseA task representing the asynchronous operation, containing the generated content response.