BaseModelGenerateContentAsync Method

Generates a model response given an input GenerateContentRequest.

Definition

Namespace: GenerativeAI
Assembly: GenerativeAI (in GenerativeAI.dll) Version: 2.0.2+aa51399cad6d90cc71158d589a6268608b3c1893
C#
protected virtual Task<GenerateContentResponse> GenerateContentAsync(
	string model,
	GenerateContentRequest request
)

Parameters

model  String
The name of the Generative AI Model to use for generating the completion. Format: `models/{model}`.
request  GenerateContentRequest
The GenerateContentRequest containing the content of the current conversation with the model.

Return Value

TaskGenerateContentResponse
The GenerateContentResponse containing the model's response.

See Also