InferenceMode
@PublicPreviewAPI
class InferenceMode
Specifies how the SDK should choose between on-device and in-cloud inference.
Summary
Public companion properties |
|
|---|---|
InferenceMode |
Only use in-cloud inference. |
InferenceMode |
Only use on-device inference. |
InferenceMode |
Prefer in-cloud inference, but fallback to on-device if cloud is unavailable. |
InferenceMode |
Prefer on-device inference, but fallback to in-cloud if unavailable. |
Public companion properties
PREFER_IN_CLOUD
val PREFER_IN_CLOUD: InferenceMode
Prefer in-cloud inference, but fallback to on-device if cloud is unavailable.
In this mode, the SDK will use in-cloud inference only unless the device is offline, at which point the SDK will fall back to on-device inference.
PREFER_ON_DEVICE
val PREFER_ON_DEVICE: InferenceMode
Prefer on-device inference, but fallback to in-cloud if unavailable.
In this mode, the SDK will attempt to use on-device inference first and, if the on-device model is unable to generate an answer, it will retry using the cloud model.