pub struct PropertySchema {
pub schema_type: String,
pub description: Option<String>,
pub enum_values: Option<Vec<String>>,
pub default: Option<Value>,
pub minimum: Option<f64>,
pub maximum: Option<f64>,
pub items: Option<Box<PropertySchema>>,
pub enriched: Option<bool>,
}Expand description
JSON Schema property definition for a tool parameter.
Fields§
§schema_type: StringJSON Schema type: “string”, “number”, “integer”, “boolean”, “array”, “object”
description: Option<String>Human-readable description of this parameter.
enum_values: Option<Vec<String>>Allowed values (enum constraint).
default: Option<Value>§minimum: Option<f64>Minimum value (for number/integer).
maximum: Option<f64>Maximum value (for number/integer).
items: Option<Box<PropertySchema>>Items schema (for array type).
enriched: Option<bool>Marker that this field was added/modified by an enricher.
Implementations§
Source§impl PropertySchema
impl PropertySchema
Sourcepub fn string_enum(values: &[&str], description: &str) -> Self
pub fn string_enum(values: &[&str], description: &str) -> Self
Create a string property with enum values.
Sourcepub fn integer(description: &str, min: Option<f64>, max: Option<f64>) -> Self
pub fn integer(description: &str, min: Option<f64>, max: Option<f64>) -> Self
Create an integer property with optional min/max.
Sourcepub fn array(items: PropertySchema, description: &str) -> Self
pub fn array(items: PropertySchema, description: &str) -> Self
Create an array property with items schema.
Trait Implementations§
Source§impl Clone for PropertySchema
impl Clone for PropertySchema
Source§fn clone(&self) -> PropertySchema
fn clone(&self) -> PropertySchema
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 PropertySchema
impl Debug for PropertySchema
Source§impl Default for PropertySchema
impl Default for PropertySchema
Source§impl<'de> Deserialize<'de> for PropertySchema
impl<'de> Deserialize<'de> for PropertySchema
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for PropertySchema
impl RefUnwindSafe for PropertySchema
impl Send for PropertySchema
impl Sync for PropertySchema
impl Unpin for PropertySchema
impl UnsafeUnpin for PropertySchema
impl UnwindSafe for PropertySchema
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