pub struct ToolSchema { /* private fields */ }Expand description
Schema describing tool parameters as JSON Schema.
Implementations§
Source§impl ToolSchema
impl ToolSchema
Sourcepub fn builder() -> ToolSchemaBuilder
pub fn builder() -> ToolSchemaBuilder
Creates a new schema builder.
Sourcepub fn has_property(&self, name: &str) -> bool
pub fn has_property(&self, name: &str) -> bool
Returns true if the schema has the given property.
Sourcepub fn is_required(&self, name: &str) -> bool
pub fn is_required(&self, name: &str) -> bool
Returns true if the given property is required.
Sourcepub fn property_count(&self) -> usize
pub fn property_count(&self) -> usize
Returns the number of properties in the schema.
Sourcepub fn to_json_schema(&self) -> Value
pub fn to_json_schema(&self) -> Value
Converts the schema to a JSON Schema object.
Trait Implementations§
Source§impl Clone for ToolSchema
impl Clone for ToolSchema
Source§fn clone(&self) -> ToolSchema
fn clone(&self) -> ToolSchema
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 ToolSchema
impl Debug for ToolSchema
Source§impl Default for ToolSchema
impl Default for ToolSchema
Source§fn default() -> ToolSchema
fn default() -> ToolSchema
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ToolSchema
impl RefUnwindSafe for ToolSchema
impl Send for ToolSchema
impl Sync for ToolSchema
impl Unpin for ToolSchema
impl UnsafeUnpin for ToolSchema
impl UnwindSafe for ToolSchema
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