pub struct Tool { /* private fields */ }Expand description
A tool that can be used by agents
Implementations§
Source§impl Tool
impl Tool
Sourcepub fn new(
name: impl Into<String>,
description: impl Into<String>,
protocol: Arc<dyn ToolProtocol>,
) -> Self
pub fn new( name: impl Into<String>, description: impl Into<String>, protocol: Arc<dyn ToolProtocol>, ) -> Self
Create a new tool bound to the supplied protocol implementation.
Sourcepub fn with_parameter(self, param: ToolParameter) -> Self
pub fn with_parameter(self, param: ToolParameter) -> Self
Add a parameter definition to the tool builder.
Sourcepub fn with_protocol_metadata(
self,
key: impl Into<String>,
value: Value,
) -> Self
pub fn with_protocol_metadata( self, key: impl Into<String>, value: Value, ) -> Self
Attach protocol specific metadata to the tool builder.
Sourcepub fn metadata(&self) -> &ToolMetadata
pub fn metadata(&self) -> &ToolMetadata
Borrow the static metadata for the tool.
Auto Trait Implementations§
impl Freeze for Tool
impl !RefUnwindSafe for Tool
impl Send for Tool
impl Sync for Tool
impl Unpin for Tool
impl UnsafeUnpin for Tool
impl !UnwindSafe for Tool
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