generativeModel

actual fun generativeModel(modelName: String, generationConfig: GenerationConfig?, safetySettings: List<SafetySetting>?, tools: List<Tool>?, toolConfig: ToolConfig?, systemInstruction: Content?, requestOptions: RequestOptions): GenerativeModel(source)

Instantiates a new GenerativeModel given the provided parameters.

Return

The initialized GenerativeModel instance.

Parameters

modelName

The name of the model to use. See the documentation for a list of supported models.

generationConfig

The configuration parameters to use for content generation.

safetySettings

The safety bounds the model will abide to during content generation.

tools

A list of Tools the model may use to generate content.

toolConfig

The ToolConfig that defines how the model handles the tools provided.

systemInstruction

Content instructions that direct the model to behave a certain way. Currently only text content is supported.

requestOptions

Configuration options for sending requests to the backend.


actual fun generativeModel(modelName: String, generationConfig: GenerationConfig?, safetySettings: List<SafetySetting>?, tools: List<Tool>?, toolConfig: ToolConfig?, systemInstruction: Content?, requestOptions: RequestOptions, onDeviceConfig: OnDeviceConfig): GenerativeModel(source)

Instantiates a new GenerativeModel given the provided parameters.

Return

The initialized GenerativeModel instance.

Parameters

modelName

The name of the model to use. See the documentation for a list of supported models.

generationConfig

The configuration parameters to use for content generation.

safetySettings

The safety bounds the model will abide to during content generation.

tools

A list of Tools the model may use to generate content.

toolConfig

The ToolConfig that defines how the model handles the tools provided.

systemInstruction

Content instructions that direct the model to behave a certain way. Currently only text content is supported.

requestOptions

Configuration options for sending requests to the backend.

onDeviceConfig

Configuration for on-device inference.

expect fun generativeModel(modelName: String, generationConfig: GenerationConfig? = null, safetySettings: List<SafetySetting>? = null, tools: List<Tool>? = null, toolConfig: ToolConfig? = null, systemInstruction: Content? = null, requestOptions: RequestOptions = RequestOptions()): GenerativeModel(source)

Instantiates a new GenerativeModel given the provided parameters.

Return

The initialized GenerativeModel instance.

Parameters

modelName

The name of the model to use. See the documentation for a list of supported models.

generationConfig

The configuration parameters to use for content generation.

safetySettings

The safety bounds the model will abide to during content generation.

tools

A list of Tools the model may use to generate content.

toolConfig

The ToolConfig that defines how the model handles the tools provided.

systemInstruction

Content instructions that direct the model to behave a certain way. Currently only text content is supported.

requestOptions

Configuration options for sending requests to the backend.


expect fun generativeModel(modelName: String, generationConfig: GenerationConfig? = null, safetySettings: List<SafetySetting>? = null, tools: List<Tool>? = null, toolConfig: ToolConfig? = null, systemInstruction: Content? = null, requestOptions: RequestOptions = RequestOptions(), onDeviceConfig: OnDeviceConfig): GenerativeModel(source)

Instantiates a new GenerativeModel given the provided parameters.

Return

The initialized GenerativeModel instance.

Parameters

modelName

The name of the model to use. See the documentation for a list of supported models.

generationConfig

The configuration parameters to use for content generation.

safetySettings

The safety bounds the model will abide to during content generation.

tools

A list of Tools the model may use to generate content.

toolConfig

The ToolConfig that defines how the model handles the tools provided.

systemInstruction

Content instructions that direct the model to behave a certain way. Currently only text content is supported.

requestOptions

Configuration options for sending requests to the backend.

onDeviceConfig

Configuration for on-device inference.

actual fun generativeModel(modelName: String, generationConfig: GenerationConfig?, safetySettings: List<SafetySetting>?, tools: List<Tool>?, toolConfig: ToolConfig?, systemInstruction: Content?, requestOptions: RequestOptions): GenerativeModel(source)

Instantiates a new GenerativeModel given the provided parameters.

Return

The initialized GenerativeModel instance.

Parameters

modelName

The name of the model to use. See the documentation for a list of supported models.

generationConfig

The configuration parameters to use for content generation.

safetySettings

The safety bounds the model will abide to during content generation.

tools

A list of Tools the model may use to generate content.

toolConfig

The ToolConfig that defines how the model handles the tools provided.

systemInstruction

Content instructions that direct the model to behave a certain way. Currently only text content is supported.

requestOptions

Configuration options for sending requests to the backend.


actual fun generativeModel(modelName: String, generationConfig: GenerationConfig?, safetySettings: List<SafetySetting>?, tools: List<Tool>?, toolConfig: ToolConfig?, systemInstruction: Content?, requestOptions: RequestOptions, onDeviceConfig: OnDeviceConfig): GenerativeModel(source)

Instantiates a new GenerativeModel given the provided parameters.

Return

The initialized GenerativeModel instance.

Parameters

modelName

The name of the model to use. See the documentation for a list of supported models.

generationConfig

The configuration parameters to use for content generation.

safetySettings

The safety bounds the model will abide to during content generation.

tools

A list of Tools the model may use to generate content.

toolConfig

The ToolConfig that defines how the model handles the tools provided.

systemInstruction

Content instructions that direct the model to behave a certain way. Currently only text content is supported.

requestOptions

Configuration options for sending requests to the backend.

onDeviceConfig

Configuration for on-device inference.