#[non_exhaustive]pub struct AfterInvocationEvent<'a> { /* private fields */ }Expand description
The request ended, successfully or not (AfterInvocationEvent). Callbacks with the same order
run in reverse registration order.
Implementations§
Source§impl<'a> AfterInvocationEvent<'a>
impl<'a> AfterInvocationEvent<'a>
Sourcepub fn agent(&self) -> &LocalAgent
pub fn agent(&self) -> &LocalAgent
The agent.
Sourcepub fn agent_mut(&mut self) -> &mut LocalAgent
pub fn agent_mut(&mut self) -> &mut LocalAgent
The agent, mutably: hooks may change its messages, system prompt, tools and state.
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<'a> AfterInvocationEvent<'a>
impl<'a> AfterInvocationEvent<'a>
Sourcepub fn resume(&self) -> Option<&InvokeArgs>
pub fn resume(&self) -> Option<&InvokeArgs>
The input of the follow-up invocation, if a hook requested one.
Sourcepub fn set_resume(&mut self, args: impl Into<InvokeArgs>)
pub fn set_resume(&mut self, args: impl Into<InvokeArgs>)
Re-enters the loop with args once the callbacks finish, with a fresh pair of invocation
events. Ignored when the invocation failed or a limit was reached; the last callback to set
it wins.
Sourcepub fn clear_resume(&mut self)
pub fn clear_resume(&mut self)
Clears a requested follow-up invocation.
Trait Implementations§
Source§impl Debug for AfterInvocationEvent<'_>
impl Debug for AfterInvocationEvent<'_>
Source§impl From<&AfterInvocationEvent<'_>> for AfterInvocationEventData
impl From<&AfterInvocationEvent<'_>> for AfterInvocationEventData
Source§fn from(_: &AfterInvocationEvent<'_>) -> Self
fn from(_: &AfterInvocationEvent<'_>) -> Self
Converts to this type from the input type.
Source§impl From<&AfterInvocationEvent<'_>> for AgentStreamEvent
impl From<&AfterInvocationEvent<'_>> for AgentStreamEvent
Source§fn from(event: &AfterInvocationEvent<'_>) -> Self
fn from(event: &AfterInvocationEvent<'_>) -> Self
Converts to this type from the input type.
Source§impl HookEvent for AfterInvocationEvent<'static>
impl HookEvent for AfterInvocationEvent<'static>
Source§type Event<'a> = AfterInvocationEvent<'a>
type Event<'a> = AfterInvocationEvent<'a>
The event type for an agent borrow of lifetime
'a.impl<H> IntoHookImpl<AfterInvocationEvent<'static>> for Hwhere
H: for<'a> Hook<AfterInvocationEvent<'a>>,
impl<F, R> IntoSyncHook<AfterInvocationEvent<'static>> for Fwhere
F: for<'a, 'b> Fn(&'b mut AfterInvocationEvent<'a>) -> R + Send + Sync + 'static,
R: HookOutput,
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for AfterInvocationEvent<'a>
impl<'a> !UnwindSafe for AfterInvocationEvent<'a>
impl<'a> Freeze for AfterInvocationEvent<'a>
impl<'a> Send for AfterInvocationEvent<'a>
impl<'a> Sync for AfterInvocationEvent<'a>
impl<'a> Unpin for AfterInvocationEvent<'a>
impl<'a> UnsafeUnpin for AfterInvocationEvent<'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
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.