pub struct MockContextProbeTool { /* private fields */ }Available on crate feature
test-utils only.Expand description
A mock tool that records whatever it observed in its per-call
ToolContext, so tests can assert the context reached tool execution.
The single call method records session:<id> (or no-session).
Implementations§
Trait Implementations§
Source§impl Clone for MockContextProbeTool
impl Clone for MockContextProbeTool
Source§fn clone(&self) -> MockContextProbeTool
fn clone(&self) -> MockContextProbeTool
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 moreSource§impl Default for MockContextProbeTool
impl Default for MockContextProbeTool
Source§fn default() -> MockContextProbeTool
fn default() -> MockContextProbeTool
Returns the “default value” for a type. Read more
Source§impl Tool for MockContextProbeTool
impl Tool for MockContextProbeTool
Source§type Error = ToolExecutionError
type Error = ToolExecutionError
Typed error returned by direct calls to this tool. Read more
Source§fn description(&self) -> String
fn description(&self) -> String
Model-facing description.
Source§fn parameters(&self) -> Value
fn parameters(&self) -> Value
JSON Schema for arguments.
Source§async fn call(
&self,
context: &mut ToolContext,
_args: Self::Args,
) -> Result<Self::Output, ToolExecutionError>
async fn call( &self, context: &mut ToolContext, _args: Self::Args, ) -> Result<Self::Output, ToolExecutionError>
Execute the tool.
Auto Trait Implementations§
impl Freeze for MockContextProbeTool
impl RefUnwindSafe for MockContextProbeTool
impl Send for MockContextProbeTool
impl Sync for MockContextProbeTool
impl Unpin for MockContextProbeTool
impl UnsafeUnpin for MockContextProbeTool
impl UnwindSafe for MockContextProbeTool
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