pub struct ToolCallbackContext {
pub execution_id: ExecutionId,
pub step_id: Option<StepId>,
pub tool_name: String,
pub tool_description: Option<String>,
pub requires_network: bool,
pub args_preview: Option<String>,
pub trace_id: Option<String>,
}Expand description
Context passed to tool callbacks
Contains information about a tool execution.
Fields§
§execution_id: ExecutionIdExecution ID
step_id: Option<StepId>Step ID
tool_name: StringTool name
tool_description: Option<String>Tool description
requires_network: boolWhether tool requires network access
args_preview: Option<String>Arguments preview (truncated if needed)
trace_id: Option<String>Trace context
Implementations§
Source§impl ToolCallbackContext
impl ToolCallbackContext
Sourcepub fn new(execution_id: ExecutionId, tool_name: impl Into<String>) -> Self
pub fn new(execution_id: ExecutionId, tool_name: impl Into<String>) -> Self
Create a new tool callback context
Sourcepub fn with_tool_info(
self,
description: Option<String>,
requires_network: bool,
) -> Self
pub fn with_tool_info( self, description: Option<String>, requires_network: bool, ) -> Self
Add tool info
Sourcepub fn with_args_preview(self, args: impl Into<String>) -> Self
pub fn with_args_preview(self, args: impl Into<String>) -> Self
Add arguments preview
Sourcepub fn with_trace(self, trace_id: impl Into<String>) -> Self
pub fn with_trace(self, trace_id: impl Into<String>) -> Self
Add trace context
Trait Implementations§
Source§impl Clone for ToolCallbackContext
impl Clone for ToolCallbackContext
Source§fn clone(&self) -> ToolCallbackContext
fn clone(&self) -> ToolCallbackContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToolCallbackContext
impl Debug for ToolCallbackContext
Source§impl<'de> Deserialize<'de> for ToolCallbackContext
impl<'de> Deserialize<'de> for ToolCallbackContext
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
Auto Trait Implementations§
impl Freeze for ToolCallbackContext
impl RefUnwindSafe for ToolCallbackContext
impl Send for ToolCallbackContext
impl Sync for ToolCallbackContext
impl Unpin for ToolCallbackContext
impl UnsafeUnpin for ToolCallbackContext
impl UnwindSafe for ToolCallbackContext
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