pub struct ToolSchema {
pub schema_type: String,
pub properties: Option<HashMap<String, JsonSchema>>,
pub required: Option<Vec<String>>,
pub additional: HashMap<String, Value>,
}
Expand description
JSON Schema definition for tool input/output (matches TypeScript spec exactly) Must be an object with type: “object”, properties, and required fields
Fields§
§schema_type: String
The schema type (must be “object” for tools)
properties: Option<HashMap<String, JsonSchema>>
Property definitions
required: Option<Vec<String>>
Required property names
additional: HashMap<String, Value>
Additional schema properties
Implementations§
Source§impl ToolSchema
impl ToolSchema
pub fn object() -> ToolSchema
pub fn with_properties( self, properties: HashMap<String, JsonSchema>, ) -> ToolSchema
pub fn with_required(self, required: Vec<String>) -> ToolSchema
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<'de> Deserialize<'de> for ToolSchema
impl<'de> Deserialize<'de> for ToolSchema
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolSchema, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolSchema, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ToolSchema
impl Serialize for ToolSchema
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. 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 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