pub struct DispatchEvent<'a> {
pub id: EffectId,
pub kind: &'a EffectKind,
pub turn: usize,
pub call_id: Option<&'a CallId>,
pub context: Option<&'a ToolContext>,
}Expand description
An effect about to be dispatched: what on_dispatch sees.
Fields§
§id: EffectIdThe dispatch’s id, minted before the hook runs so an observation can be correlated with its recorded effect.
kind: &'a EffectKindThe effect, after any earlier hook’s patch.
turn: usizeThe turn the effect belongs to.
call_id: Option<&'a CallId>The call the effect answers, for a tool call the model emitted.
context: Option<&'a ToolContext>Tool invocation context, carried separately from the effect.
Implementations§
Source§impl<'a> DispatchEvent<'a>
impl<'a> DispatchEvent<'a>
Sourcepub fn tool_args(&self) -> Option<&'a str>
pub fn tool_args(&self) -> Option<&'a str>
The JSON arguments (after earlier patches), for a tool-call effect.
Sourcepub fn tool_context(&self) -> Option<&'a ToolContext>
pub fn tool_context(&self) -> Option<&'a ToolContext>
The dispatch context, for a tool-call effect.
Sourcepub fn completion_request(&self) -> Option<&'a CompletionRequest>
pub fn completion_request(&self) -> Option<&'a CompletionRequest>
The request about to be sent, for a completion effect.
Trait Implementations§
Source§impl<'a> Clone for DispatchEvent<'a>
impl<'a> Clone for DispatchEvent<'a>
impl<'a> Copy for DispatchEvent<'a>
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for DispatchEvent<'a>
impl<'a> !UnwindSafe for DispatchEvent<'a>
impl<'a> Freeze for DispatchEvent<'a>
impl<'a> Send for DispatchEvent<'a>
impl<'a> Sync for DispatchEvent<'a>
impl<'a> Unpin for DispatchEvent<'a>
impl<'a> UnsafeUnpin for DispatchEvent<'a>
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
Mutably borrows from an owned value. Read more