DownloadCallback


interface DownloadCallback


Callback functions used for model downloading. The messages returned are for debugging purposes.

Summary

Public functions

open Unit

Called when model download completed.

open Unit

Called when model download did not start due to errors (e.g. remote exception of features not available).

open Unit

Called when model download failed.

open Unit

Called when model download has been initiated already, hence no need to restart.

open Unit
onDownloadProgress(totalBytesDownloaded: Long)

Called when model download is in progress.

open Unit
onDownloadStarted(bytesToDownload: Long)

Called when model download started properly.

Public functions

onDownloadCompleted

open fun onDownloadCompleted(): Unit

Called when model download completed.

onDownloadDidNotStart

open fun onDownloadDidNotStart(e: GenerativeAIException): Unit

Called when model download did not start due to errors (e.g. remote exception of features not available).

Parameters
e: GenerativeAIException

the GenerativeAIException thrown for download failure

onDownloadFailed

open fun onDownloadFailed(failureStatus: String, e: GenerativeAIException): Unit

Called when model download failed.

Parameters
failureStatus: String

the download failure status message

e: GenerativeAIException

the GenerativeAIException thrown for download failure

onDownloadPending

open fun onDownloadPending(): Unit

Called when model download has been initiated already, hence no need to restart.

onDownloadProgress

open fun onDownloadProgress(totalBytesDownloaded: Long): Unit

Called when model download is in progress.

Parameters
totalBytesDownloaded: Long

the already downloaded bytes

onDownloadStarted

open fun onDownloadStarted(bytesToDownload: Long): Unit

Called when model download started properly.

Parameters
bytesToDownload: Long

the total bytes to be downloaded