InvocationInput

sealed interface InvocationInput(source)

Structured input handed to the unified invocation handler.

The plugin auto-dispatches based on the request's Content-Type and Content-Length:

Handlers pattern-match on the variant they expect; raise an AgentCoreInvocationException for unsupported shapes.

Inheritors

Types

Link copied to clipboard
class Binary(val bytes: ByteArray, val contentType: ContentType) : InvocationInput

Request body materialised as raw bytes plus the original Content-Type.

Link copied to clipboard

multipart/form-data request — handler iterates over MultiPartData to read individual file/field parts (PartData.FormItem, PartData.FileItem, etc.). Useful for file uploads where metadata fields accompany binary blobs.

Link copied to clipboard
class Stream(val channel: ByteReadChannel, val contentType: ContentType) : InvocationInput

Request body as a ByteReadChannel for incremental reads. Use this for large uploads (audio/video/large PDF) where allocating the full payload as a ByteArray is undesirable.

Link copied to clipboard
data class Text(val body: String) : InvocationInput

Request body decoded as a UTF-8 string (used for JSON/text content types).