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,
    @NonNull RequestOptions requestOptions,
    List<@NonNull Tool> tools,
    ToolConfig toolConfig,
    Content systemInstruction
)

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,
    @NonNull RequestOptions requestOptions,
    List<@NonNull Tool> tools,
    ToolConfig toolConfig,
    Content systemInstruction
)

Instantiates a new GenerativeModel given the provided parameters.

Parameters
@NonNull String modelName

name of the model in the backend

GenerationConfig generationConfig

configuration parameters to use for content generation

List<@NonNull SafetySetting> safetySettings

safety bounds to use during alongside prompts during content generation

@NonNull RequestOptions requestOptions

configuration options to utilize during backend communication

List<@NonNull Tool> tools

list of tools to make available to the model

ToolConfig toolConfig

configuration that defines how the model handles the tools provided

Content systemInstruction

contains a Content that directs the model to behave a certain way

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