pub struct ToolContext<'a> {
pub run: &'a RunContext,
pub state: &'a SharedState,
pub tool_call_id: &'a str,
pub tool_name: &'a str,
}Expand description
Context passed to a tool call.
Fields§
§run: &'a RunContextRun execution context.
state: &'a SharedStateShared cross-tool state.
tool_call_id: &'a strSource model tool-call id.
tool_name: &'a strTool name used for this call.
Implementations§
Source§impl<'a> ToolContext<'a>
impl<'a> ToolContext<'a>
Sourcepub fn new(
run: &'a RunContext,
state: &'a SharedState,
tool_call_id: &'a str,
tool_name: &'a str,
) -> Self
pub fn new( run: &'a RunContext, state: &'a SharedState, tool_call_id: &'a str, tool_name: &'a str, ) -> Self
Constructs tool-call context.
Trait Implementations§
Source§impl<'a> Clone for ToolContext<'a>
impl<'a> Clone for ToolContext<'a>
Source§fn clone(&self) -> ToolContext<'a>
fn clone(&self) -> ToolContext<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl<'a> Copy for ToolContext<'a>
Auto Trait Implementations§
impl<'a> Freeze for ToolContext<'a>
impl<'a> RefUnwindSafe for ToolContext<'a>
impl<'a> Send for ToolContext<'a>
impl<'a> Sync for ToolContext<'a>
impl<'a> Unpin for ToolContext<'a>
impl<'a> UnsafeUnpin for ToolContext<'a>
impl<'a> UnwindSafe for ToolContext<'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