pub struct ToolDefinition { /* private fields */ }Expand description
A tool definition: metadata sent to the LLM so it knows what tools are available and how to call them.
Implementations§
Source§impl ToolDefinition
impl ToolDefinition
pub fn new(name: String, description: String, parameters_schema: Value) -> Self
pub fn name(&self) -> &str
pub fn description(&self) -> &str
pub fn parameters_schema(&self) -> &Value
Sourcepub fn to_api_json(&self) -> Value
pub fn to_api_json(&self) -> Value
Format as the JSON structure expected by LLM tool-calling APIs.
Trait Implementations§
Source§impl Clone for ToolDefinition
impl Clone for ToolDefinition
Source§fn clone(&self) -> ToolDefinition
fn clone(&self) -> ToolDefinition
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 moreAuto Trait Implementations§
impl Freeze for ToolDefinition
impl RefUnwindSafe for ToolDefinition
impl Send for ToolDefinition
impl Sync for ToolDefinition
impl Unpin for ToolDefinition
impl UnsafeUnpin for ToolDefinition
impl UnwindSafe for ToolDefinition
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