Package-level declarations

Types

Link copied to clipboard
class Chat(model: GenerativeModel, val history: MutableList<Content> = ArrayList())

Representation of a multi-turn interaction with a model.

Link copied to clipboard
abstract class DownloadStatus

An abstract class representing the status of an on-device model download operation.

Link copied to clipboard
actual class FirebaseAI

Entry point for all Firebase AI functionality.

expect class FirebaseAI

Entry point for all Firebase AI functionality.

actual class FirebaseAI

Entry point for all Firebase AI functionality.

Link copied to clipboard
actual class GenerativeModel

Represents a multimodal model (like Gemini), capable of generating content based on various input types.

expect class GenerativeModel

Represents a multimodal model (like Gemini), capable of generating content based on various input types.

actual class GenerativeModel

A model of the cloud backend, over the platform SDK. The platforms other than Android have no on-device model (as Android without the firebase-ai-ondevice library): OnDeviceConfig modes that prefer one of the two fall back to the cloud, ONLY_ON_DEVICE fails with FirebaseAIOnDeviceNotAvailableException, and onDeviceExtension is null.

Link copied to clipboard

Specifies how the SDK should choose between on-device and in-cloud inference.

Link copied to clipboard

Indicates the source of the model inference.

Link copied to clipboard
actual class LiveGenerativeModel

Represents a multimodal model (like Gemini) capable of real-time content generation based on various input types, supporting bidirectional streaming.

expect class LiveGenerativeModel

Represents a multimodal model (like Gemini) capable of real-time content generation based on various input types, supporting bidirectional streaming.

actual class LiveGenerativeModel

Represents a multimodal model (like Gemini) capable of real-time content generation based on various input types, supporting bidirectional streaming.

Link copied to clipboard
class OnDeviceConfig @JvmOverloads constructor(val mode: InferenceMode, val maxOutputTokens: Int? = null, val temperature: Float? = null, val topK: Int? = null, val seed: Int? = null, val candidateCount: Int = 1, val modelOption: OnDeviceModelOption? = null, val enableThinking: Boolean? = null)

Configuration for on-device AI model inference.

Link copied to clipboard
actual class OnDeviceExtension

Extension class for performing on-device operations.

expect class OnDeviceExtension

Extension class for performing on-device operations.

actual class OnDeviceExtension

The on-device model of a GenerativeModel. The platforms other than Android have none (as Android without the firebase-ai-ondevice library), so GenerativeModel.onDeviceExtension is always null there and no instance exists; its members report the model as unavailable.

Link copied to clipboard
Link copied to clipboard

Represents the current status of the on-device AI model.

Link copied to clipboard

Representation of a multi-turn interaction with a server template model.

Link copied to clipboard

Represents a multimodal model (like Gemini), capable of generating content based on various templated input types.

Represents a multimodal model (like Gemini), capable of generating content based on various templated input types.

Represents a multimodal model (like Gemini), capable of generating content based on various templated input types.

Properties

Link copied to clipboard

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

Functions

Link copied to clipboard
fun Firebase.ai(app: FirebaseApp = Firebase.app, backend: GenerativeBackend = GenerativeBackend.googleAI()): FirebaseAI
fun Firebase.ai(app: FirebaseApp = Firebase.app, backend: GenerativeBackend = GenerativeBackend.googleAI(), useLimitedUseAppCheckTokens: Boolean): FirebaseAI

Returns the FirebaseAI instance for the provided FirebaseApp and backend.