IGenerativeModelGenerateContentAsync(String, CancellationToken) Method

Generates content asynchronously based on the specified text input prompt.

Definition

Namespace: GenerativeAI
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
Task<GenerateContentResponse> GenerateContentAsync(
	string prompt,
	CancellationToken cancellationToken = default
)

Parameters

prompt  String
The text input used to generate the content.
cancellationToken  CancellationToken  (Optional)
Token to monitor for cancellation requests.

Return Value

TaskGenerateContentResponse
A task representing the asynchronous operation, containing the generated content response.

See Also