FirebaseAI.Companion

public static class FirebaseAI.Companion


Summary

Public fields

static final @NonNull FirebaseAI

The FirebaseAI instance for the default FirebaseApp using the Google AI Backend.

Public methods

static final @NonNull FirebaseAI

The FirebaseAI instance for the provided FirebaseApp using the Google AI Backend.

static final @NonNull FirebaseAI

Returns the FirebaseAI instance for the provided FirebaseApp and backend.

static final @NonNull FirebaseAI
getInstance(
    @NonNull FirebaseApp app,
    @NonNull GenerativeBackend backend,
    boolean useLimitedUseAppCheckTokens
)

Returns the FirebaseAI instance for the provided FirebaseApp and backend.

Public fields

instance

public static final @NonNull FirebaseAI instance

The FirebaseAI instance for the default FirebaseApp using the Google AI Backend.

Public methods

getInstance

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

The FirebaseAI instance for the provided FirebaseApp using the Google AI Backend.

getInstance

public static final @NonNull FirebaseAI getInstance(@NonNull FirebaseApp app, @NonNull GenerativeBackend backend)

Returns the FirebaseAI instance for the provided FirebaseApp and backend.

Parameters
@NonNull GenerativeBackend backend

the backend reference to make generative AI requests to.

getInstance

public static final @NonNull FirebaseAI getInstance(
    @NonNull FirebaseApp app,
    @NonNull GenerativeBackend backend,
    boolean useLimitedUseAppCheckTokens
)

Returns the FirebaseAI instance for the provided FirebaseApp and backend.

Parameters
@NonNull GenerativeBackend backend

the backend reference to make generative AI requests to.

boolean useLimitedUseAppCheckTokens

when sending tokens to the backend, this option enables the usage of App Check's limited-use tokens instead of the standard cached tokens. Learn more about limited-use tokens, including their nuances, when to use them, and best practices for integrating them into your app.

This flag is set to false by default.