pub struct ToolWrapper { /* private fields */ }Expand description
Wraps an agent (broker + tools + behaviour) as an LlmTool
This allows agents to be used as tools by other agents (delegation pattern). The tool’s descriptor has a single “input” parameter (string). When run, it creates initial messages from the agent’s behaviour, appends the input, and calls the agent’s broker.
Implementations§
Source§impl ToolWrapper
impl ToolWrapper
Sourcepub fn new(
broker: Arc<LlmBroker>,
tools: Vec<Box<dyn LlmTool>>,
behaviour: impl Into<String>,
name: impl Into<String>,
description: impl Into<String>,
) -> Self
pub fn new( broker: Arc<LlmBroker>, tools: Vec<Box<dyn LlmTool>>, behaviour: impl Into<String>, name: impl Into<String>, description: impl Into<String>, ) -> Self
Create a new ToolWrapper
§Arguments
broker- The LLM broker for this agenttools- The tools available to this agentbehaviour- The system message defining the agent’s behaviourname- The name of this tool (how other agents will call it)description- Description of what this agent/tool does
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ToolWrapper
impl !RefUnwindSafe for ToolWrapper
impl Send for ToolWrapper
impl Sync for ToolWrapper
impl Unpin for ToolWrapper
impl !UnwindSafe for ToolWrapper
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