#[non_exhaustive]pub struct AfterToolCallEvent { /* private fields */ }Expand description
A tool call finished, successfully or not (AfterToolCallEvent). Callbacks with the same
order run in reverse registration order.
Implementations§
Source§impl AfterToolCallEvent
impl AfterToolCallEvent
Sourcepub fn invocation_state(&self) -> &InvocationState
pub fn invocation_state(&self) -> &InvocationState
The caller’s per-invocation state.
Sourcepub fn invocation_context(&self) -> Option<&InvocationContext>
pub fn invocation_context(&self) -> Option<&InvocationContext>
The request this event belongs to.
Source§impl AfterToolCallEvent
impl AfterToolCallEvent
Sourcepub fn result(&self) -> &ToolResultBlock
pub fn result(&self) -> &ToolResultBlock
The tool result.
Sourcepub fn result_mut(&mut self) -> &mut ToolResultBlock
pub fn result_mut(&mut self) -> &mut ToolResultBlock
The tool result, to edit before it reaches the model (redact, truncate).
Sourcepub fn set_result(&mut self, result: ToolResultBlock)
pub fn set_result(&mut self, result: ToolResultBlock)
Replaces the tool result.
Sourcepub fn error(&self) -> Option<&ToolResultError>
pub fn error(&self) -> Option<&ToolResultError>
The error the tool failed with; it stays the original when a hook replaces the result.
Trait Implementations§
Source§impl Debug for AfterToolCallEvent
impl Debug for AfterToolCallEvent
Source§impl From<&AfterToolCallEvent> for AfterToolCallEventData
impl From<&AfterToolCallEvent> for AfterToolCallEventData
Source§fn from(event: &AfterToolCallEvent) -> Self
fn from(event: &AfterToolCallEvent) -> Self
Converts to this type from the input type.
Source§impl From<&AfterToolCallEvent> for AgentStreamEvent
impl From<&AfterToolCallEvent> for AgentStreamEvent
Source§fn from(event: &AfterToolCallEvent) -> Self
fn from(event: &AfterToolCallEvent) -> Self
Converts to this type from the input type.
Source§impl HookEvent for AfterToolCallEvent
impl HookEvent for AfterToolCallEvent
Source§type Event<'a> = AfterToolCallEvent
type Event<'a> = AfterToolCallEvent
The event type for an agent borrow of lifetime
'a.impl<H> IntoHookImpl<AfterToolCallEvent> for Hwhere
H: Hook<AfterToolCallEvent>,
impl<F, R> IntoSyncHook<AfterToolCallEvent> for F
Auto Trait Implementations§
impl !RefUnwindSafe for AfterToolCallEvent
impl !UnwindSafe for AfterToolCallEvent
impl Freeze for AfterToolCallEvent
impl Send for AfterToolCallEvent
impl Sync for AfterToolCallEvent
impl Unpin for AfterToolCallEvent
impl UnsafeUnpin for AfterToolCallEvent
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
Converts
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> ⓘ
Converts
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 moreCreates a shared type from an unshared type.