pub enum HookTypes {
BeforeAll,
BeforeCompletion,
AfterCompletion,
BeforeTool,
AfterTool,
AfterEach,
OnNewMessage,
OnStart,
OnStop,
OnStream,
}
Variants§
BeforeAll
Runs only once for the agent when it starts
BeforeCompletion
Runs before every completion, yielding a mutable reference to the completion request
AfterCompletion
Runs after every completion, yielding a mutable reference to the completion response
BeforeTool
Runs before every tool call, yielding a reference to the tool call
AfterTool
Runs after every tool call, yielding a reference to the tool call and a mutable result
AfterEach
Runs after all tools have completed and a single completion has been made
OnNewMessage
Runs when a new message is added to the AgentContext
, yielding a mutable reference to the
message. This is only triggered when the message is added by the agent.
OnStart
Runs when the agent starts, either from pending or stopped
OnStop
Runs when the agent stops
OnStream
Runs when the agent streams a response
Trait Implementations§
impl Copy for HookTypes
impl Eq for HookTypes
impl StructuralPartialEq for HookTypes
Auto Trait Implementations§
impl Freeze for HookTypes
impl RefUnwindSafe for HookTypes
impl Send for HookTypes
impl Sync for HookTypes
impl Unpin for HookTypes
impl UnwindSafe for HookTypes
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
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 more