pub struct SessionHookClosures {
pub should_stop_after_turn: Arc<dyn Fn(&ShouldStopAfterTurnContext) -> bool + Send + Sync>,
pub get_steering_messages: Arc<dyn Fn() -> Vec<Message> + Send + Sync>,
pub get_follow_up_messages: Arc<dyn Fn() -> Vec<Message> + Send + Sync>,
pub tool_execution: ToolExecutionMode,
}Expand description
Closures owned by the cli (or any product) that participate in the
agent hook chain. Passed into AgentBuilder::with_session_hooks so
they are composed into the same AgentHooks that the middleware
pipeline produces. The single-set_hooks invariant (only
AgentBuilder::build calls set_hooks) is what keeps the
before/after_tool_call slots alive across the cli session boot.
Fields§
§should_stop_after_turn: Arc<dyn Fn(&ShouldStopAfterTurnContext) -> bool + Send + Sync>Stop signal consulted at the end of every turn.
get_steering_messages: Arc<dyn Fn() -> Vec<Message> + Send + Sync>Drain the steering queue on demand.
get_follow_up_messages: Arc<dyn Fn() -> Vec<Message> + Send + Sync>Drain the follow-up queue on demand.
tool_execution: ToolExecutionModeTool-execution mode (Sequential is the cli default).
Auto Trait Implementations§
impl !RefUnwindSafe for SessionHookClosures
impl !UnwindSafe for SessionHookClosures
impl Freeze for SessionHookClosures
impl Send for SessionHookClosures
impl Sync for SessionHookClosures
impl Unpin for SessionHookClosures
impl UnsafeUnpin for SessionHookClosures
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