pub struct ToolParameterSchema {
pub schema_type: String,
pub description: Option<String>,
pub properties: Option<HashMap<String, ToolParameterSchema>>,
pub required: Option<Vec<String>>,
pub items: Option<Box<ToolParameterSchema>>,
pub enum_values: Option<Vec<Value>>,
pub default: Option<Value>,
pub additional: HashMap<String, Value>,
}
Expand description
JSON Schema definition for tool parameters
Fields§
§schema_type: String
JSON Schema type (object, string, number, boolean, array, null)
description: Option<String>
Description of this parameter
properties: Option<HashMap<String, ToolParameterSchema>>
Properties for object types (nested schemas)
required: Option<Vec<String>>
Required property names for object types
items: Option<Box<ToolParameterSchema>>
Items schema for array types
enum_values: Option<Vec<Value>>
Enum values for restricted choices
default: Option<Value>
Default value
additional: HashMap<String, Value>
Additional schema properties (min, max, pattern, etc.)
Implementations§
Source§impl ToolParameterSchema
impl ToolParameterSchema
Sourcepub fn string(description: impl Into<String>) -> ToolParameterSchema
pub fn string(description: impl Into<String>) -> ToolParameterSchema
Create a simple string parameter
Sourcepub fn number(description: impl Into<String>) -> ToolParameterSchema
pub fn number(description: impl Into<String>) -> ToolParameterSchema
Create a number parameter
Sourcepub fn integer(description: impl Into<String>) -> ToolParameterSchema
pub fn integer(description: impl Into<String>) -> ToolParameterSchema
Create an integer parameter
Sourcepub fn boolean(description: impl Into<String>) -> ToolParameterSchema
pub fn boolean(description: impl Into<String>) -> ToolParameterSchema
Create a boolean parameter
Sourcepub fn object(
description: impl Into<String>,
properties: HashMap<String, ToolParameterSchema>,
required: Vec<String>,
) -> ToolParameterSchema
pub fn object( description: impl Into<String>, properties: HashMap<String, ToolParameterSchema>, required: Vec<String>, ) -> ToolParameterSchema
Create an object parameter with properties
Sourcepub fn array(
description: impl Into<String>,
items: ToolParameterSchema,
) -> ToolParameterSchema
pub fn array( description: impl Into<String>, items: ToolParameterSchema, ) -> ToolParameterSchema
Create an array parameter
Trait Implementations§
Source§impl Clone for ToolParameterSchema
impl Clone for ToolParameterSchema
Source§fn clone(&self) -> ToolParameterSchema
fn clone(&self) -> ToolParameterSchema
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 ToolParameterSchema
impl Debug for ToolParameterSchema
Source§impl<'de> Deserialize<'de> for ToolParameterSchema
impl<'de> Deserialize<'de> for ToolParameterSchema
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolParameterSchema, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolParameterSchema, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Serialize for ToolParameterSchema
impl Serialize for ToolParameterSchema
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 ToolParameterSchema
impl RefUnwindSafe for ToolParameterSchema
impl Send for ToolParameterSchema
impl Sync for ToolParameterSchema
impl Unpin for ToolParameterSchema
impl UnwindSafe for ToolParameterSchema
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