Demonstration

@Serializable
data class Demonstration(val input: String, val output: String, val intermediateMessages: List<Message>? = null)

A unified demonstration representing an input-output example for few-shot learning.

Demonstrations can represent either compact I/O pairs (labeled examples) or full execution traces with intermediate reasoning steps (bootstrapped examples). The intermediateMessages field distinguishes these: when present, it contains the full conversation trace from a successful subgraph execution (tool calls, assistant responses, etc.).

Constructors

Link copied to clipboard
constructor(input: String, output: String, intermediateMessages: List<Message>? = null)

Properties

Link copied to clipboard

The example input, stringified at the subgraph boundary.

Link copied to clipboard
val intermediateMessages: List<Message>? = null

Optional intermediate conversation messages from the subgraph execution. When present, includes tool calls, tool results, and assistant responses that produced the output. Absent for labeled (non-bootstrapped) demonstrations.

Link copied to clipboard

The example output, stringified at the subgraph boundary.