pub struct CustomToolDefinition {
pub name: String,
pub description: String,
pub category: CustomToolCategory,
pub parameters: Value,
pub command: ShellCommand,
}Expand description
Definition of a custom tool from the custom-tools config file.
Custom tools are registered alongside built-in tools and can be called by the LLM. They execute shell commands with parameter substitution.
Fields§
§name: StringTool name (must not collide with built-in tool names).
description: StringDescription shown to the LLM.
category: CustomToolCategory"readonly" or "destructive". Readonly tools are auto-executed;
destructive tools require user confirmation.
parameters: ValueJSON Schema for the tool’s parameters. This is sent to the LLM as-is.
command: ShellCommandShell command template with {param} placeholders.
Implementations§
Source§impl CustomToolDefinition
impl CustomToolDefinition
Sourcepub fn build_tool(&self) -> Result<Tool, String>
pub fn build_tool(&self) -> Result<Tool, String>
Convert this definition into a Tool that can be registered in ToolManager.
Trait Implementations§
Source§impl Clone for CustomToolDefinition
impl Clone for CustomToolDefinition
Source§fn clone(&self) -> CustomToolDefinition
fn clone(&self) -> CustomToolDefinition
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 CustomToolDefinition
impl Debug for CustomToolDefinition
Source§impl<'de> Deserialize<'de> for CustomToolDefinition
impl<'de> Deserialize<'de> for CustomToolDefinition
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
Auto Trait Implementations§
impl Freeze for CustomToolDefinition
impl RefUnwindSafe for CustomToolDefinition
impl Send for CustomToolDefinition
impl Sync for CustomToolDefinition
impl Unpin for CustomToolDefinition
impl UnsafeUnpin for CustomToolDefinition
impl UnwindSafe for CustomToolDefinition
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