AirshipAi

interface AirshipAi(source)

Entry point for Airship's on-device AI features, reached via com.urbanairship.Airship.ai.

Gated by com.urbanairship.PrivacyManager.Feature.ON_DEVICE_AI — disabled, no model resolves and every evaluation is skipped.

These APIs are Kotlin-only: supplying context or a model means implementing a suspend function, which Java can't express usefully.

Properties

Link copied to clipboard
abstract val defaultModel: ModelAdapter?

The SDK's built-in default model, or null when none is registered.

Functions

Link copied to clipboard
abstract fun model(usage: Usage<*>): ModelAdapter?

Returns the model resolved for usage, or null when none is configured.

Link copied to clipboard

Registers the context provider for a usage.

Link copied to clipboard

Registers a fallback provider for usages with no provider of their own.

Link copied to clipboard
abstract fun setEvaluationObserver(observer: EvaluationObserver?)

Registers an observer called once per evaluation, whatever the outcome — including evaluations skipped before a model was consulted, such as when none is configured.

Link copied to clipboard
abstract fun setModelResolver(resolver: ModelResolver?)

Registers a resolver that routes each usage to a model backend.