pub struct BeforeToolCallContext<'a> {
pub assistant_message: &'a AgentMessage,
pub assistant_content: &'a AssistantContent,
pub tool_call: &'a ToolCall,
pub args: &'a Value,
pub messages: &'a [AgentMessage],
}Expand description
Read-only context handed to a BeforeToolCall hook.
Narrow on purpose: the hook gets the assistant message that requested
the call, the call itself, and the validated arguments. It does not
get a fat &mut LoopState.
Fields§
§assistant_message: &'a AgentMessage§assistant_content: &'a AssistantContent§tool_call: &'a ToolCall§args: &'a Value§messages: &'a [AgentMessage]Auto Trait Implementations§
impl<'a> Freeze for BeforeToolCallContext<'a>
impl<'a> RefUnwindSafe for BeforeToolCallContext<'a>
impl<'a> Send for BeforeToolCallContext<'a>
impl<'a> Sync for BeforeToolCallContext<'a>
impl<'a> Unpin for BeforeToolCallContext<'a>
impl<'a> UnsafeUnpin for BeforeToolCallContext<'a>
impl<'a> UnwindSafe for BeforeToolCallContext<'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