pub struct AfterToolCallContext<'a> {
pub assistant_message: &'a AgentMessage,
pub tool_call: &'a ToolCall,
pub args: &'a Value,
pub result: &'a ToolResult,
pub is_error: bool,
pub messages: &'a [AgentMessage],
}Expand description
Read-only context handed to an AfterToolCall hook.
Includes the executed result so the hook can override it. The hook cannot re-execute the tool; it can only transform the result the model will see.
Fields§
§assistant_message: &'a AgentMessage§tool_call: &'a ToolCall§args: &'a Value§result: &'a ToolResult§is_error: bool§messages: &'a [AgentMessage]Auto Trait Implementations§
impl<'a> Freeze for AfterToolCallContext<'a>
impl<'a> RefUnwindSafe for AfterToolCallContext<'a>
impl<'a> Send for AfterToolCallContext<'a>
impl<'a> Sync for AfterToolCallContext<'a>
impl<'a> Unpin for AfterToolCallContext<'a>
impl<'a> UnsafeUnpin for AfterToolCallContext<'a>
impl<'a> UnwindSafe for AfterToolCallContext<'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