pub struct ToolBuilder { /* private fields */ }Expand description
Builder for creating tools with a fluent API
Implementations§
Source§impl ToolBuilder
impl ToolBuilder
Sourcepub fn param_string(self, name: &str, description: &str, required: bool) -> Self
pub fn param_string(self, name: &str, description: &str, required: bool) -> Self
Add a string parameter
§Arguments
name- Parameter namedescription- Parameter descriptionrequired- Whether the parameter is required
Sourcepub fn param_i64(self, name: &str, description: &str, required: bool) -> Self
pub fn param_i64(self, name: &str, description: &str, required: bool) -> Self
Add an integer parameter (i64)
Sourcepub fn param_f64(self, name: &str, description: &str, required: bool) -> Self
pub fn param_f64(self, name: &str, description: &str, required: bool) -> Self
Add a number parameter (f64)
Sourcepub fn param_bool(self, name: &str, description: &str, required: bool) -> Self
pub fn param_bool(self, name: &str, description: &str, required: bool) -> Self
Add a boolean parameter
Sourcepub fn param_object(self, name: &str, description: &str, required: bool) -> Self
pub fn param_object(self, name: &str, description: &str, required: bool) -> Self
Add an object parameter
Sourcepub fn param_array(self, name: &str, description: &str, required: bool) -> Self
pub fn param_array(self, name: &str, description: &str, required: bool) -> Self
Add an array parameter
Sourcepub fn handler(self, handler: ToolHandler) -> Tool
pub fn handler(self, handler: ToolHandler) -> Tool
Set the handler function and finalize the tool
This consumes the builder and returns the completed Tool.
Auto Trait Implementations§
impl Freeze for ToolBuilder
impl RefUnwindSafe for ToolBuilder
impl Send for ToolBuilder
impl Sync for ToolBuilder
impl Unpin for ToolBuilder
impl UnsafeUnpin for ToolBuilder
impl UnwindSafe for ToolBuilder
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