#[non_exhaustive]pub struct AfterModelCallEvent<'a> { /* private fields */ }Expand description
A model call finished, successfully or not (AfterModelCallEvent). Callbacks with the same
order run in reverse registration order.
Implementations§
Source§impl<'a> AfterModelCallEvent<'a>
impl<'a> AfterModelCallEvent<'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> AfterModelCallEvent<'a>
impl<'a> AfterModelCallEvent<'a>
Sourcepub fn attempt_count(&self) -> u32
pub fn attempt_count(&self) -> u32
The 1-based model attempt within this turn, counting the one that just finished. A fresh turn always starts at 1.
Sourcepub fn stop_data(&self) -> Option<&ModelStopResponse>
pub fn stop_data(&self) -> Option<&ModelStopResponse>
The model’s response; None when the call failed.
Trait Implementations§
Source§impl Debug for AfterModelCallEvent<'_>
impl Debug for AfterModelCallEvent<'_>
Source§impl From<&AfterModelCallEvent<'_>> for AfterModelCallEventData
impl From<&AfterModelCallEvent<'_>> for AfterModelCallEventData
Source§fn from(event: &AfterModelCallEvent<'_>) -> Self
fn from(event: &AfterModelCallEvent<'_>) -> Self
Converts to this type from the input type.
Source§impl From<&AfterModelCallEvent<'_>> for AgentStreamEvent
impl From<&AfterModelCallEvent<'_>> for AgentStreamEvent
Source§fn from(event: &AfterModelCallEvent<'_>) -> Self
fn from(event: &AfterModelCallEvent<'_>) -> Self
Converts to this type from the input type.
Source§impl HookEvent for AfterModelCallEvent<'static>
impl HookEvent for AfterModelCallEvent<'static>
Source§type Event<'a> = AfterModelCallEvent<'a>
type Event<'a> = AfterModelCallEvent<'a>
The event type for an agent borrow of lifetime
'a.impl<H> IntoHookImpl<AfterModelCallEvent<'static>> for Hwhere
H: for<'a> Hook<AfterModelCallEvent<'a>>,
impl<F, R> IntoSyncHook<AfterModelCallEvent<'static>> for Fwhere
F: for<'a, 'b> Fn(&'b mut AfterModelCallEvent<'a>) -> R + Send + Sync + 'static,
R: HookOutput,
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for AfterModelCallEvent<'a>
impl<'a> !UnwindSafe for AfterModelCallEvent<'a>
impl<'a> Freeze for AfterModelCallEvent<'a>
impl<'a> Send for AfterModelCallEvent<'a>
impl<'a> Sync for AfterModelCallEvent<'a>
impl<'a> Unpin for AfterModelCallEvent<'a>
impl<'a> UnsafeUnpin for AfterModelCallEvent<'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.