DownloadCallback


interface DownloadCallback


用於下載模型的回呼函式。系統會傳回這些訊息,以利偵錯。

摘要

公開函式

open Unit

模型下載完成時會呼叫。

open Unit

當模型下載因錯誤 (例如功能無法使用的遠端例外狀況) 而無法開始時,系統會呼叫此方法。

open Unit

模型下載失敗時會呼叫。

open Unit

在模型下載作業已啟動時呼叫,因此不需要重新啟動。

open Unit
onDownloadProgress(totalBytesDownloaded: Long)

在模型下載期間呼叫。

open Unit
onDownloadStarted(bytesToDownload: Long)

在模型下載作業順利開始時呼叫。

公開函式

onDownloadCompleted

open fun onDownloadCompleted(): Unit

模型下載完成時會呼叫。

onDownloadDidNotStart

open fun onDownloadDidNotStart(e: GenerativeAIException): Unit

當模型下載因錯誤 (例如無法使用的功能的遠端例外狀況) 而未開始時,系統會呼叫此方法。

參數
e: GenerativeAIException

下載失敗時擲回的 GenerativeAIException

onDownloadFailed

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

在模型下載失敗時呼叫。

參數
failureStatus: String

下載失敗狀態訊息

e: GenerativeAIException

下載失敗時擲回的 GenerativeAIException

onDownloadPending

open fun onDownloadPending(): Unit

在模型下載作業已啟動時呼叫,因此不需要重新啟動。

onDownloadProgress

open fun onDownloadProgress(totalBytesDownloaded: Long): Unit

在模型下載期間呼叫。

參數
totalBytesDownloaded: Long

已下載的位元組

onDownloadStarted

open fun onDownloadStarted(bytesToDownload: Long): Unit

在模型下載作業順利開始時呼叫。

參數
bytesToDownload: Long

要下載的位元組總數