generateContent

Generates content given a GenAI model and a list of content.

Return

a com.google.genai.types.GenerateContentResponse instance that contains response contents and other metadata

Parameters

model

the name of the GenAI model to use for generation

contents

a < to send to the generative model

config

a com.google.genai.types.GenerateContentConfig instance that specifies the optional configurations


Generates content given a GenAI model and a content object.

Return

a com.google.genai.types.GenerateContentResponse instance that contains response contents and other metadata

Parameters

model

the name of the GenAI model to use for generation

content

a com.google.genai.types.Content to send to the generative model

config

a com.google.genai.types.GenerateContentConfig instance that specifies the optional configurations


Generates content given a GenAI model and a text string.

Return

a com.google.genai.types.GenerateContentResponse instance that contains response contents and other metadata

Parameters

model

the name of the GenAI model to use for generation

text

the text string to send to the generative model

config

a com.google.genai.types.GenerateContentConfig instance that specifies the optional configurations