AiChunk

sealed interface AiChunk(source)

One increment of a AiProvider.completeStream reply.

Inheritors

Types

Link copied to clipboard
data class Failed(val reason: AiFailure, val detail: String? = null, val retryAfterSeconds: Int? = null) : AiChunk

The stream ended in failure — before, or after, some Tokens already emitted.

Link copied to clipboard
data class Token(val text: String) : AiChunk

A piece of the model's reply text, in generation order.