CompletionStreamEvent

sealed interface CompletionStreamEvent

Event emitted by LlmBroker.generateStreamEvents for a single turn.

Zero or more Content events arrive in order, then exactly one terminal event: Completed or Error. Nothing follows the terminal event.

Content that arrived before an Error is evidence of what the provider sent, not a result. Treat the turn as failed.

Inheritors

Types

Link copied to clipboard

Terminal success: the provider reported a normal stop and ended the stream.

Link copied to clipboard
data class Content(val text: String) : CompletionStreamEvent

Visible assistant content, in arrival order.

Link copied to clipboard

Terminal failure. See StreamErrorReason for the causes.