Struct HookedOutput
pub struct HookedOutput {
pub output: ToolOutput,
pub hooks: Vec<HookDecision>,
pub args: Option<Value>,
pub events: Vec<RecordedEvent>,
pub approval: Option<String>,
}Expand description
What the journaled step tool:<call id> records: what the call answered, beside what the hooks
decided about it (ADR 0050, decision 2).
The output is flattened, so a record written before hooks existed is exactly a
ToolOutput and reads here as one with no decision and no rewritten arguments. An older build
reads a record written now as the output, ignoring the members it does not know. The verdict is
in the record, so a replay that finds the step recorded calls no hook again.
Fields§
§output: ToolOutputWhat the call answered.
hooks: Vec<HookDecision>What the hooks decided, in the order they decided. Empty when none did, and absent from a record written before hooks existed.
args: Option<Value>The arguments the call ran with, when a before_tool hook rewrote them. Absent when the model’s
arguments are the ones that ran, and from a record written before hooks existed.
events: Vec<RecordedEvent>The custom events the call emitted, in the order it emitted them (ADR 0050, decision 6). Delivery reads them from here, after the step, so a replay that finds the step recorded delivers them again with the same keys. Absent when the call emitted none, and from a record written before custom events existed.
approval: Option<String>The question a before_tool hook asked a person to approve, when the call waits for that
approval (ADR 0050, decision 12, slice H8): the run parks on it, and on yes the call runs in
the step tool:<call id>:approved with the arguments recorded here (args,
or the model’s own). Absent when no hook asked, from a record written before H8 (whose ask
left the call unrun) and from a run that cannot ask a person (its ask is recorded as a
deny). The output beside it is the error awaiting approval: <question>,
so a build that predates H8 reads the call as unrun.
Breaking: a new public field of a struct that is not #[non_exhaustive]: a literal
outside the crate names it (approval: None).
Implementations§
§impl HookedOutput
impl HookedOutput
pub fn plain(output: ToolOutput) -> HookedOutput
pub fn plain(output: ToolOutput) -> HookedOutput
A call no hook touched.
pub fn awaits_approval(&self) -> Option<&str>
pub fn awaits_approval(&self) -> Option<&str>
The question the call waits on, when a hook asked a person to approve it (slice H8).
Trait Implementations§
§impl Clone for HookedOutput
impl Clone for HookedOutput
§fn clone(&self) -> HookedOutput
fn clone(&self) -> HookedOutput
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more§impl Debug for HookedOutput
impl Debug for HookedOutput
§impl<'de> Deserialize<'de> for HookedOutput
impl<'de> Deserialize<'de> for HookedOutput
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<HookedOutput, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<HookedOutput, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl PartialEq for HookedOutput
impl PartialEq for HookedOutput
§impl Serialize for HookedOutput
impl Serialize for HookedOutput
§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 HookedOutput
Auto Trait Implementations§
impl Freeze for HookedOutput
impl RefUnwindSafe for HookedOutput
impl Send for HookedOutput
impl Sync for HookedOutput
impl Unpin for HookedOutput
impl UnsafeUnpin for HookedOutput
impl UnwindSafe for HookedOutput
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>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].