pub struct DangerousTool;Expand description
A mock “dangerous” tool for testing hook-based interception.
Named "dangerous_operation" so that hook tests can identify and
intercept it by name before execution.
§Example
use traitclaw_test_utils::tools::DangerousTool;
use traitclaw_core::traits::tool::Tool;
assert_eq!(DangerousTool.name(), "dangerous_operation");Trait Implementations§
Source§impl Tool for DangerousTool
impl Tool for DangerousTool
Source§type Input = DangerousInput
type Input = DangerousInput
Input type — must be deserializable from JSON and have a JSON Schema.
Source§type Output = DangerousOutput
type Output = DangerousOutput
Output type — must be serializable to JSON.
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 DangerousTool
impl RefUnwindSafe for DangerousTool
impl Send for DangerousTool
impl Sync for DangerousTool
impl Unpin for DangerousTool
impl UnsafeUnpin for DangerousTool
impl UnwindSafe for DangerousTool
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.