FirebaseVertexAI

public final classFirebaseVertexAI


Entry point for allVertex AI in Firebase functionality.

Summary

Nested types

public static classFirebaseVertexAI.Companion

Public fields

static final @NonNullFirebaseVertexAI

TheFirebaseVertexAI instance for the defaultFirebaseApp

Public methods

final @NonNullGenerativeModel
generativeModel(
    @NonNullString modelName,
    GenerationConfig generationConfig,
    List<@NonNullSafetySetting> safetySettings,
    List<@NonNullTool> tools,
    ToolConfig toolConfig,
    Content systemInstruction,
    @NonNullRequestOptions requestOptions
)

Instantiates a newGenerativeModel given the provided parameters.

static final @NonNullFirebaseVertexAI
static final @NonNullFirebaseVertexAI

Returns theFirebaseVertexAI instance for the providedFirebaseApp andlocation.

final @NonNullImagenModel
@PublicPreviewAPI
imagenModel(
    @NonNullString modelName,
    ImagenGenerationConfig generationConfig,
    ImagenSafetySettings safetySettings,
    @NonNullRequestOptions requestOptions
)

Instantiates a newImagenModel given the provided parameters.

final @NonNullLiveGenerativeModel
@PublicPreviewAPI
liveModel(
    @NonNullString modelName,
    LiveGenerationConfig generationConfig,
    List<@NonNullTool> tools,
    Content systemInstruction,
    @NonNullRequestOptions requestOptions
)

Instantiates a newLiveGenerationConfig given the provided parameters.

Public fields

instance

public static final @NonNullFirebaseVertexAI instance

TheFirebaseVertexAI instance for the defaultFirebaseApp

Public methods

generativeModel

public final @NonNullGenerativeModel generativeModel(
    @NonNullString modelName,
    GenerationConfig generationConfig,
    List<@NonNullSafetySetting> safetySettings,
    List<@NonNullTool> tools,
    ToolConfig toolConfig,
    Content systemInstruction,
    @NonNullRequestOptions requestOptions
)

Instantiates a newGenerativeModel given the provided parameters.

Parameters
@NonNullString modelName

The name of the model to use, for example"gemini-2.0-flash-exp".

GenerationConfig generationConfig

The configuration parameters to use for content generation.

List<@NonNullSafetySetting> safetySettings

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

List<@NonNullTool> tools

A list ofTools the model may use to generate content.

ToolConfig toolConfig

TheToolConfig that defines how the model handles the tools provided.

Content systemInstruction

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

@NonNullRequestOptions requestOptions

Configuration options for sending requests to the backend.

Returns
@NonNullGenerativeModel

The initializedGenerativeModel instance.

getInstance

public static final @NonNullFirebaseVertexAI getInstance(@NonNullFirebaseApp app)

getInstance

public static final @NonNullFirebaseVertexAI getInstance(@NonNullFirebaseApp app, @NonNullString location)

Returns theFirebaseVertexAI instance for the providedFirebaseApp andlocation.

Parameters
@NonNullString location

location identifier, defaults tous-central1; see availableVertex AI regions .

imagenModel

@PublicPreviewAPI
public final @NonNullImagenModel imagenModel(
    @NonNullString modelName,
    ImagenGenerationConfig generationConfig,
    ImagenSafetySettings safetySettings,
    @NonNullRequestOptions requestOptions
)

Instantiates a newImagenModel given the provided parameters.

Parameters
@NonNullString modelName

The name of the model to use, for example"imagen-3.0-generate-001".

ImagenGenerationConfig generationConfig

The configuration parameters to use for image generation.

ImagenSafetySettings safetySettings

The safety bounds the model will abide by during image generation.

@NonNullRequestOptions requestOptions

Configuration options for sending requests to the backend.

Returns
@NonNullImagenModel

The initializedImagenModel instance.

liveModel

@PublicPreviewAPI
public final @NonNullLiveGenerativeModel liveModel(
    @NonNullString modelName,
    LiveGenerationConfig generationConfig,
    List<@NonNullTool> tools,
    Content systemInstruction,
    @NonNullRequestOptions requestOptions
)

Instantiates a newLiveGenerationConfig given the provided parameters.

Parameters
@NonNullString modelName

The name of the model to use, for example"gemini-2.0-flash-exp".

LiveGenerationConfig generationConfig

The configuration parameters to use for content generation.

List<@NonNullTool> tools

A list ofTools the model may use to generate content.

Content systemInstruction

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

@NonNullRequestOptions requestOptions

Configuration options for sending requests to the backend.

Returns
@NonNullLiveGenerativeModel

The initializedLiveGenerativeModel instance.

Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-07-21 UTC.