pub struct AgentTool { /* private fields */ }Expand description
Wraps an Agent as a ToolFunction for “agent as a tool” dispatch.
When the live model calls this tool, the wrapped agent runs in an isolated context (no live WebSocket). The agent’s text output is collected and returned as the tool result.
Implementations§
Source§impl AgentTool
impl AgentTool
Sourcepub fn new(agent: impl Agent + 'static) -> Self
pub fn new(agent: impl Agent + 'static) -> Self
Create a new AgentTool wrapping the given agent.
Sourcepub fn with_description(self, desc: impl Into<String>) -> Self
pub fn with_description(self, desc: impl Into<String>) -> Self
Override the tool description.
Sourcepub fn with_parameters(self, params: Value) -> Self
pub fn with_parameters(self, params: Value) -> Self
Override the tool parameters schema.
Trait Implementations§
Source§impl ToolFunction for AgentTool
impl ToolFunction for AgentTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable description of what this tool does.
Source§fn parameters(&self) -> Option<Value>
fn parameters(&self) -> Option<Value>
JSON Schema for the tool’s input parameters, or
None if parameterless.Auto Trait Implementations§
impl Freeze for AgentTool
impl !RefUnwindSafe for AgentTool
impl Send for AgentTool
impl Sync for AgentTool
impl Unpin for AgentTool
impl UnsafeUnpin for AgentTool
impl !UnwindSafe for AgentTool
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