FunctionResponse

@Serializable(with = FunctionResponseSerializer::class)
sealed interface FunctionResponse

The response to a callRendererFunction or callAgentFunction invocation.

The schema's "exactly one of value or error" is expressed as the two variants, so a response carrying both or neither cannot be constructed, only rejected while decoding.

Inheritors

Types

Link copied to clipboard
data class Failure(val functionCallId: CallId, val error: FunctionError) : FunctionResponse

The function failed with error.

Link copied to clipboard
data class Success(val functionCallId: CallId, val value: JsonElement) : FunctionResponse

The function returned value.

Properties

Link copied to clipboard
abstract val functionCallId: CallId

The id of the invocation this responds to.