pub struct ToolGuideSpec {
pub tool_name: String,
pub when_to_use: String,
pub when_not_to_use: String,
pub examples: Vec<ToolExample>,
pub related_tools: Vec<String>,
pub category: ToolCategory,
}Expand description
Serializable specification for a tool guide
This struct can be loaded from JSON or YAML files and implements
the ToolGuide trait for use in the prompt building system.
Fields§
§tool_name: StringUnique tool identifier
when_to_use: StringWhen to use this tool
when_not_to_use: StringWhen NOT to use this tool
examples: Vec<ToolExample>Usage examples
Related tool names
category: ToolCategoryTool category
Implementations§
Source§impl ToolGuideSpec
impl ToolGuideSpec
Sourcepub fn from_guide(guide: &dyn ToolGuide) -> Self
pub fn from_guide(guide: &dyn ToolGuide) -> Self
Creates a spec from a ToolGuide implementation
§Arguments
guide- Reference to any type implementingToolGuide
Trait Implementations§
Source§impl Clone for ToolGuideSpec
impl Clone for ToolGuideSpec
Source§fn clone(&self) -> ToolGuideSpec
fn clone(&self) -> ToolGuideSpec
Returns a duplicate of the value. Read more
1.0.0 · 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 ToolGuideSpec
impl Debug for ToolGuideSpec
Source§impl<'de> Deserialize<'de> for ToolGuideSpec
impl<'de> Deserialize<'de> for ToolGuideSpec
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ToolGuideSpec
impl PartialEq for ToolGuideSpec
Source§impl Serialize for ToolGuideSpec
impl Serialize for ToolGuideSpec
Source§impl ToolGuide for ToolGuideSpec
impl ToolGuide for ToolGuideSpec
Source§fn when_to_use(&self) -> &str
fn when_to_use(&self) -> &str
Returns guidance on when this tool should be used
Source§fn when_not_to_use(&self) -> &str
fn when_not_to_use(&self) -> &str
Returns guidance on when this tool should NOT be used
Source§fn examples(&self) -> Vec<ToolExample>
fn examples(&self) -> Vec<ToolExample>
Returns usage examples for this tool
Returns names of related tools that complement this one
Source§fn category(&self) -> ToolCategory
fn category(&self) -> ToolCategory
Returns the category this tool belongs to
impl StructuralPartialEq for ToolGuideSpec
Auto Trait Implementations§
impl Freeze for ToolGuideSpec
impl RefUnwindSafe for ToolGuideSpec
impl Send for ToolGuideSpec
impl Sync for ToolGuideSpec
impl Unpin for ToolGuideSpec
impl UnsafeUnpin for ToolGuideSpec
impl UnwindSafe for ToolGuideSpec
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