#[non_exhaustive]pub enum HookPoint {
PreTurn,
PostTurn,
PreToolCallDecide,
PostToolCall,
OnCompaction,
OnSessionStart,
OnSessionEnd,
OnToolError,
OnInteraction,
}Expand description
Identifies the point in the agent lifecycle where a hook fires.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
PreTurn
Before the model processes a turn (receives the user prompt).
PostTurn
After the model completes a turn (receives the model response).
PreToolCallDecide
Before a tool call is executed — can approve or deny.
PostToolCall
After a tool call completes (receives the tool result).
OnCompaction
Fires when the context window is compacted (trimmed to fit limits).
OnSessionStart
Fires when a new agent session begins.
OnSessionEnd
Fires when an agent session ends.
OnToolError
Fires when a tool call returns an error.
OnInteraction
Fires on each user interaction (message received from user).
Implementations§
Trait Implementations§
impl Copy for HookPoint
Source§impl<'de> Deserialize<'de> for HookPoint
impl<'de> Deserialize<'de> for HookPoint
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for HookPoint
impl StructuralPartialEq for HookPoint
Auto Trait Implementations§
impl Freeze for HookPoint
impl RefUnwindSafe for HookPoint
impl Send for HookPoint
impl Sync for HookPoint
impl Unpin for HookPoint
impl UnsafeUnpin for HookPoint
impl UnwindSafe for HookPoint
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