InvocationResult

sealed interface InvocationResult(source)

Structured result of an invocation. Each variant maps to a specific HTTP response shape.

  • Text → plain text / JSON / single-event SSE depending on Accept.

  • Binary → raw bytes with the supplied Content-Type and known length.

  • TextStreamtext/event-stream with each chunk written as its own data: event.

  • BinaryStream → chunked binary with the supplied Content-Type.

Inheritors

Types

Link copied to clipboard
data class Binary(val bytes: ByteArray, val contentType: ContentType) : InvocationResult
Link copied to clipboard
class BinaryStream(val chunks: Flow<ByteArray>, val contentType: ContentType) : InvocationResult

Streaming binary result (HTTP chunked transfer-encoding).

Link copied to clipboard
data class Text(val value: String) : InvocationResult
Link copied to clipboard
class TextStream(val chunks: Flow<String>) : InvocationResult

Streaming text result (SSE data: events per chunk).