saveSession

suspend fun saveSession(): ByteArray(source)

Serializes the session (token history + KV cache of the conversation) after all queued work.

Return

an opaque blob for restoreSession on an engine with the same model and a context at least as large.