#[non_exhaustive]pub enum RunEvent<'a> {
ModelRequestReady {
request: &'a ModelRequest,
},
ModelDelta {
invocation_id: &'a InvocationId,
delta: &'a StreamDelta,
},
ModelOutput {
invocation_id: &'a InvocationId,
output: &'a ModelOutput,
},
BlocksCommitted {
invocation_id: &'a InvocationId,
blocks: &'a [ContextBlock],
},
ToolBatchReady {
invocation_id: &'a InvocationId,
batch: &'a ToolBatch,
},
ToolBatchReturned {
invocation_id: &'a InvocationId,
batch: &'a ToolBatch,
result: Result<(), &'a ToolProcessingError>,
},
}Expand description
Borrowed execution observations. Callbacks must return promptly.
No event history is retained by the runner. ModelDelta excludes Done
and Error; a committed notification describes only the actual append.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ModelRequestReady
A complete logical request, immediately before gateway entry.
Fields
request: &'a ModelRequestThe request to be sent.
ModelDelta
A nonterminal streaming observation.
Fields
invocation_id: &'a InvocationIdThe logical invocation.
delta: &'a StreamDeltaText, reasoning, tool-call or usage observation.
ModelOutput
A complete model output, before material conversion.
Fields
invocation_id: &'a InvocationIdThe logical invocation.
output: &'a ModelOutputThe accepted complete output.
BlocksCommitted
An atomic append succeeded, including an empty append.
Fields
invocation_id: &'a InvocationIdThe logical invocation.
blocks: &'a [ContextBlock]Actual appended blocks borrowed from the context.
ToolBatchReady
Newly committed declarations are about to enter tool processing.
Fields
invocation_id: &'a InvocationIdThe logical invocation.
ToolBatchReturned
Tool processing actually returned; results are not yet committed.
Fields
invocation_id: &'a InvocationIdThe logical invocation.
result: Result<(), &'a ToolProcessingError>The module’s return status, independent of subsequent commit.