pub struct ToolMetadata { /* private fields */ }Expand description
Metadata used to identify, describe, and categorize a tool.
Implementations§
Source§impl ToolMetadata
impl ToolMetadata
Sourcepub fn new(
name: impl Into<String>,
description: impl Into<String>,
) -> ToolResult<Self>
pub fn new( name: impl Into<String>, description: impl Into<String>, ) -> ToolResult<Self>
Create new metadata with validation
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
Human-readable description presented to the model.
Optional tool author.
Category tags attached to the tool.
Sourcepub fn is_enabled(&self) -> bool
pub fn is_enabled(&self) -> bool
Whether the executor may run and export this tool.
Sourcepub fn additional_metadata(&self) -> &HashMap<Cow<'static, str>, Value>
pub fn additional_metadata(&self) -> &HashMap<Cow<'static, str>, Value>
Additional application-defined metadata.
Sourcepub fn with_version(self, version: impl Into<Cow<'static, str>>) -> Self
pub fn with_version(self, version: impl Into<Cow<'static, str>>) -> Self
Set the tool version.
Set the tool author.
Set the tool’s category tags.
Sourcepub fn with_enabled(self, enabled: bool) -> Self
pub fn with_enabled(self, enabled: bool) -> Self
Enable or disable the tool.
Trait Implementations§
Source§impl Clone for ToolMetadata
impl Clone for ToolMetadata
Source§fn clone(&self) -> ToolMetadata
fn clone(&self) -> ToolMetadata
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToolMetadata
impl Debug for ToolMetadata
Auto Trait Implementations§
impl Freeze for ToolMetadata
impl RefUnwindSafe for ToolMetadata
impl Send for ToolMetadata
impl Sync for ToolMetadata
impl Unpin for ToolMetadata
impl UnsafeUnpin for ToolMetadata
impl UnwindSafe for ToolMetadata
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