IGenerativeModelGenerateAnswerAsync(GenerateAnswerRequest, CancellationToken) Method

Generates an answer asynchronously based on the provided request.

Definition

Namespace: GenerativeAI
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
Task<GenerateAnswerResponse> GenerateAnswerAsync(
	GenerateAnswerRequest request,
	CancellationToken cancellationToken = default
)

Parameters

request  GenerateAnswerRequest
The request containing the input details for generating an answer.
cancellationToken  CancellationToken  (Optional)
A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Return Value

TaskGenerateAnswerResponse
Returns a GenerateAnswerResponse containing the generated answer and additional context.

See Also