FirebaseVertexAI

public final class FirebaseVertexAI


Entry point for all Vertex AI for Firebase functionality.

Summary

Nested types

public static class FirebaseVertexAI.Companion

Public fields

static final @NonNull FirebaseVertexAI

The FirebaseVertexAI instance for the default FirebaseApp

Public methods

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

Instantiates a new GenerativeModel given the provided parameters.

static final @NonNull FirebaseVertexAI
static final @NonNull FirebaseVertexAI

Returns the FirebaseVertexAI instance for the provided FirebaseApp and location.

Public fields

instance

public static final @NonNull FirebaseVertexAI instance

The FirebaseVertexAI instance for the default FirebaseApp

Public methods

generativeModel

public final @NonNull GenerativeModel generativeModel(
    @NonNull String modelName,
    GenerationConfig generationConfig,
    List<@NonNull SafetySetting> safetySettings,
    List<@NonNull Tool> tools,
    ToolConfig toolConfig,
    Content systemInstruction,
    @NonNull RequestOptions requestOptions
)

Instantiates a new GenerativeModel given the provided parameters.

Parameters
@NonNull String modelName

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

GenerationConfig generationConfig

The configuration parameters to use for content generation.

List<@NonNull SafetySetting> safetySettings

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

List<@NonNull Tool> tools

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

ToolConfig toolConfig

The ToolConfig 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.

@NonNull RequestOptions requestOptions

Configuration options for sending requests to the backend.

Returns
@NonNull GenerativeModel

The initialized GenerativeModel instance.

getInstance

public static final @NonNull FirebaseVertexAI getInstance(@NonNull FirebaseApp app)

getInstance

public static final @NonNull FirebaseVertexAI getInstance(@NonNull FirebaseApp app, @NonNull String location)

Returns the FirebaseVertexAI instance for the provided FirebaseApp and location.

Parameters
@NonNull String location

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