GenStream is a minimal callback interface used by streaming generation functions.
interface GenStream {
fun onDelta(text: String)
fun onComplete()
fun onError(message: String)
}Typical usage#
- Append
onDeltachunks to your UI buffer. - Use
onCompleteto re-enable UI actions. - Surface
onErrorto logs and/or a snackbar/toast.