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

要下载的总字节数