pub struct ToolComposition { /* private fields */ }Expand description
Tool wrapper - wraps a Tool into a Composition
This adapter allows individual tools to be used within composition workflows. Optionally stores the result in a context variable for use by subsequent steps.
§Example
ⓘ
let tool_comp = ToolComposition::new(tool, json!({"path": "/src/main.rs"}))
.with_output_variable("file_content");Implementations§
Source§impl ToolComposition
impl ToolComposition
Sourcepub fn new(tool: Arc<dyn Tool>, args: Value) -> Self
pub fn new(tool: Arc<dyn Tool>, args: Value) -> Self
Creates a new tool composition
§Arguments
tool- The tool to wrapargs- Arguments to pass to the tool (JSON value)
Sourcepub fn with_output_variable(self, var_name: impl Into<String>) -> Self
pub fn with_output_variable(self, var_name: impl Into<String>) -> Self
Sets the variable name to store the result in the context
Subsequent steps can access this result via ctx.get_variable(var_name)
Trait Implementations§
Source§impl Composition for ToolComposition
impl Composition for ToolComposition
Auto Trait Implementations§
impl Freeze for ToolComposition
impl !RefUnwindSafe for ToolComposition
impl Send for ToolComposition
impl Sync for ToolComposition
impl Unpin for ToolComposition
impl UnsafeUnpin for ToolComposition
impl !UnwindSafe for ToolComposition
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