#[non_exhaustive]pub enum Event {
Show 23 variants
RunStarted {
session_id: String,
},
RunResumed,
RunLinked {
parent_run: RunId,
},
TurnStarted {
turn: u32,
},
TextDelta {
turn: u32,
text: String,
},
Recovered {
reran: Vec<String>,
indeterminate: Vec<String>,
},
ProviderSwitched {
turn: u32,
switch: ProviderSwitch,
},
ModelRequested {
turn: u32,
model: String,
messages: usize,
tools: usize,
},
ModelResponded {
turn: u32,
usage: Usage,
text: String,
tool_calls: usize,
note: Option<String>,
},
ToolStarted {
call_id: String,
tool: String,
},
ToolFinished {
receipt: Receipt,
},
Stuck {
signal: StuckSignal,
},
StopRejected {
message: String,
},
HookDecided {
point: HookPoint,
hook: String,
decision: String,
reason: Option<String>,
},
HookFailed {
point: HookPoint,
hook: String,
failure: HookFailure,
},
ModelAnswered {
turn: u32,
hook: String,
},
ModelRejected {
turn: u32,
message: String,
},
ModelRetried {
turn: u32,
error: String,
after_ms: u64,
},
LimitExtended {
limit: LimitKind,
amount: u64,
},
TranscriptEdited {
turn: u32,
before: usize,
after: usize,
},
TranscriptEditRefused {
turn: u32,
reason: String,
},
Interrupted {
interruption: Interruption,
},
Finished {
status: RunStatus,
usage: Usage,
turns: u32,
elapsed_ms: u64,
},
}Expand description
Everything observable about a run, in order. One stream feeds UIs, tracing exporters, stores and eval assertions.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
RunStarted
RunResumed
RunLinked
This run was started by a tool call of parent_run.
TurnStarted
TextDelta
Streamed model text, before the turn’s ModelResponded.
Recovered
The run continued after a crash or restart.
ProviderSwitched
A crate::Failover chain moved to its next provider during this
turn’s model call.
ModelRequested
The model is about to be called; pairs with ModelResponded, or
with ModelRetried or Finished if the call fails. Content is not
journaled: see EventSink::observe_request.
ModelResponded
Fields
ToolStarted
ToolFinished
Stuck
Fields
signal: StuckSignalStopRejected
HookDecided
A hook made a decision other than letting things proceed. Together
with HookFailed this says which hook did what, and why.
HookFailed
A hook panicked, timed out or was cancelled, and gave no answer.
See crate::Hook for what the run does instead.
ModelAnswered
A hook answered in the model’s place, or supplied the response of a failed call; the model’s own reply was not used.
ModelRejected
An after_model hook rejected this turn’s response.
ModelRetried
The model call failed and an on_model_error hook asked for a retry.
LimitExtended
An on_limit hook raised a limit; amount is in the limit’s unit.
TranscriptEdited
An edit_transcript hook replaced the stored transcript.
TranscriptEditRefused
An edit_transcript hook’s edit was malformed and was not applied.
Interrupted
Fields
interruption: Interruption