#[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: InterruptionFinished
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Event
impl<'de> Deserialize<'de> for Event
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Event, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Event, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Serialize for Event
impl Serialize for Event
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Forget for Event
impl Freeze for Eventwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<String>: Freeze,
PhantomData<Value>: Freeze,
*const LeafNode<String, Value> is !null: Freeze,
PhantomData<(Owned, LeafOrInternal)>: Freeze,
PhantomData<Box<(String, Value)>>: Freeze,
PhantomData<EffectKey>: Freeze,
*const ApprovalCard is !null: Freeze,
PhantomData<ApprovalCard>: Freeze,
impl Move for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Eventwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<String>: UnsafeUnpin,
PhantomData<Value>: UnsafeUnpin,
*const LeafNode<String, Value> is !null: UnsafeUnpin,
PhantomData<(Owned, LeafOrInternal)>: UnsafeUnpin,
PhantomData<Box<(String, Value)>>: UnsafeUnpin,
PhantomData<EffectKey>: UnsafeUnpin,
*const ApprovalCard is !null: UnsafeUnpin,
PhantomData<ApprovalCard>: UnsafeUnpin,
impl UnwindSafe for Eventwhere
RawVecInner: UnwindSafe,
BTreeMap<String, Value>: UnwindSafe,
BoxRaw<ApprovalCard>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more