FirebaseAIOnDevice

object FirebaseAIOnDevice


Entry point for Firebase AI On-Device functionality.

Note: This class does not provides any inference-related functionality for the on-device AI model.

Summary

Public functions

suspend OnDeviceModelStatus

Checks the current status / availability of the on-device AI model.

Flow<DownloadStatus>

Initiates the download of the on-device AI model.

Public functions

checkStatus

suspend fun checkStatus(): OnDeviceModelStatus

Checks the current status / availability of the on-device AI model.

Returns
OnDeviceModelStatus

An OnDeviceModelStatus object indicating the current state of the model.

download

fun download(): Flow<DownloadStatus>

Initiates the download of the on-device AI model.

This method returns a Flow that emits DownloadStatus updates as the download progresses. Consumers should collect the flow to start the download process, and optionally process any updates on the download state, progress, and completion or failure.

Returns
Flow<DownloadStatus>

A Flow of DownloadStatus objects representing the download lifecycle.