pub struct EchoTool;Expand description
A simple tool that echoes its text input.
Useful for testing that the agent runtime correctly routes tool calls and processes tool output.
§Example
use traitclaw_test_utils::tools::EchoTool;
use traitclaw_core::traits::tool::Tool;
let result = EchoTool.execute(traitclaw_test_utils::tools::EchoInput {
text: "hello".into(),
}).await.unwrap();
assert_eq!(result.echo, "hello");Trait Implementations§
Source§impl Tool for EchoTool
impl Tool for EchoTool
Source§type Output = EchoOutput
type Output = EchoOutput
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 EchoTool
impl RefUnwindSafe for EchoTool
impl Send for EchoTool
impl Sync for EchoTool
impl Unpin for EchoTool
impl UnsafeUnpin for EchoTool
impl UnwindSafe for EchoTool
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.