AILocalModel

interface AILocalModel

A language model on the device, for answering when your AI agent can't: the person is offline, or the agent reached its usage limit.

AIOnDeviceModel is Gemini Nano through ML Kit. Implement this interface to use another model.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun isAvailable(): Boolean

Whether the model can answer now.

Link copied to clipboard
abstract fun reply(instructions: String, turns: List<AIConversationTurn>): Flow<String>

Streams the answer to the last of turns, the person's question.