initGenerativeModel

suspend fun initGenerativeModel(): GenerativeModel

Initializes a GenerativeModel instance with the default configuration.

This function will download the model if it is not already available and call GenerativeModel.warmup on it.

Return

The GenerativeModel instance.


suspend fun initGenerativeModel(config: GenerationConfig): GenerativeModel

Initializes a GenerativeModel instance with the given config.

This function will download the model if it is not already available and call GenerativeModel.warmup on it.

Return

The GenerativeModel instance.

Parameters

config

The GenerationConfig to use for initialization.


suspend fun initGenerativeModel(block: GenerationConfig.Builder.() -> Unit): GenerativeModel

A convenience function to initialize a GenerativeModel instance with a configuration block.

This function will download the model if it is not already available and call GenerativeModel.warmup on it.

Return

The GenerativeModel instance.

Parameters

block

The block to configure the GenerationConfig.