pub struct FailTool;Expand description
A tool that always fails with an error.
Useful for testing error handling in agent loops, tool budgets, and error recovery strategies.
§Example
use traitclaw_test_utils::tools::FailTool;
use traitclaw_core::traits::tool::Tool;
let result = FailTool.execute(traitclaw_test_utils::tools::FailInput {
message: None,
}).await;
assert!(result.is_err());Trait Implementations§
Source§impl Tool for FailTool
impl Tool for FailTool
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
A description of what this tool does (sent to the LLM).
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
_input: Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
_input: Self::Input,
) -> Pin<Box<dyn Future<Output = Result<Self::Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute this tool with the given input.
Source§fn schema(&self) -> ToolSchema
fn schema(&self) -> ToolSchema
Generate the JSON Schema for this tool’s parameters.
Auto Trait Implementations§
impl Freeze for FailTool
impl RefUnwindSafe for FailTool
impl Send for FailTool
impl Sync for FailTool
impl Unpin for FailTool
impl UnsafeUnpin for FailTool
impl UnwindSafe for FailTool
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
Source§impl<T> ErasedTool for Twhere
T: Tool,
impl<T> ErasedTool for Twhere
T: Tool,
Source§fn description(&self) -> &str
fn description(&self) -> &str
A description of what this tool does.
Source§fn schema(&self) -> ToolSchema
fn schema(&self) -> ToolSchema
Get the JSON Schema for this tool.