pub struct Tool {
pub name: String,
pub description: String,
pub parameters: Schema,
}Expand description
A function the model may ask for.
Fields§
§name: String§description: StringWhat it does, in prose. This is the only thing the model has to go on when deciding whether to reach for it, so it earns its length.
parameters: SchemaImplementations§
Source§impl Tool
impl Tool
pub fn new(name: impl Into<String>, description: impl Into<String>) -> Tool
pub fn parameters(self, schema: Schema) -> Tool
pub fn string(self, name: &str, description: &str) -> Tool
pub fn integer(self, name: &str, description: &str) -> Tool
pub fn number(self, name: &str, description: &str) -> Tool
pub fn boolean(self, name: &str, description: &str) -> Tool
pub fn one_of(self, name: &str, description: &str, values: &[&str]) -> Tool
pub fn array_of(self, name: &str, description: &str, item_type: &str) -> Tool
pub fn schema_json(&self) -> Json
Trait Implementations§
impl StructuralPartialEq for Tool
Auto Trait Implementations§
impl Freeze for Tool
impl RefUnwindSafe for Tool
impl Send for Tool
impl Sync for Tool
impl Unpin for Tool
impl UnsafeUnpin for Tool
impl UnwindSafe for Tool
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