LiteRTConversation

Host bridge for one LiteRT conversation/session.

send performs one non-streaming model turn. stream returns a cold flow of LiteRT snapshots or deltas. Implement cancel and close when the underlying engine supports aborting work or owns native resources.

Since

0.3.0-beta01

Functions

Link copied to clipboard
open fun cancel()

Cancel in-flight generation. The default is a no-op for simple engines; implementations that can abort on-device work must override this so LanguageModelCallParams.abortSignal stops generation promptly.

Link copied to clipboard
open fun close()

Release engine resources owned by this conversation. The default is a no-op for stateless engines; implementations that allocate sessions, handles, or native resources must override it.

Link copied to clipboard
abstract suspend fun send(message: LiteRTMessage, extraContext: Map<String, JsonElement> = emptyMap()): LiteRTMessage
Link copied to clipboard
abstract fun stream(message: LiteRTMessage, extraContext: Map<String, JsonElement> = emptyMap()): Flow<LiteRTMessage>