FirebaseVertexAI

class FirebaseVertexAI


Entry point for all Vertex AI for Firebase functionality.

Summary

Public companion functions

FirebaseVertexAI
FirebaseVertexAI
getInstance(app: FirebaseApp, location: String)

Returns the FirebaseVertexAI instance for the provided FirebaseApp and location.

Public companion properties

FirebaseVertexAI

The FirebaseVertexAI instance for the default FirebaseApp

Public functions

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

Instantiates a new GenerativeModel given the provided parameters.

Public companion functions

getInstance

fun getInstance(app: FirebaseApp): FirebaseVertexAI

getInstance

fun getInstance(app: FirebaseApp = Firebase.app, location: String): FirebaseVertexAI

Returns the FirebaseVertexAI instance for the provided FirebaseApp and location.

Parameters
location: String

location identifier, defaults to us-central1; see available Vertex AI regions .

Public companion properties

instance

val instanceFirebaseVertexAI

The FirebaseVertexAI instance for the default FirebaseApp

Public functions

generativeModel

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

Instantiates a new GenerativeModel given the provided parameters.

Parameters
modelName: String

The name of the model to use, for example "gemini-1.5-pro".

generationConfig: GenerationConfig? = null

The configuration parameters to use for content generation.

safetySettings: List<SafetySetting>? = null

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

tools: List<Tool>? = null

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

toolConfig: ToolConfig? = null

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

systemInstruction: Content? = null

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

requestOptions: RequestOptions = RequestOptions()

Configuration options for sending requests to the backend.

Returns
GenerativeModel

The initialized GenerativeModel instance.