pub struct ArgTransform {
pub name: Option<String>,
pub description: Option<String>,
pub default: Option<Value>,
pub hide: bool,
pub required: Option<bool>,
pub type_schema: Option<Value>,
}Expand description
Transformation rules for a single argument.
Use the builder methods to specify which aspects of the argument to transform.
Any field left as None will inherit from the original argument.
Fields§
§name: Option<String>New name for the argument.
description: Option<String>New description for the argument.
default: Option<Value>Default value (as JSON) for the argument.
hide: boolWhether to hide this argument from the schema. Hidden arguments must have a default value.
required: Option<bool>Override the required status.
Only Some(true) is meaningful (to make optional → required).
type_schema: Option<Value>New type annotation for the argument (as JSON Schema).
Implementations§
Source§impl ArgTransform
impl ArgTransform
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Sets the new description for this argument.
Sourcepub fn default(self, value: impl Into<Value>) -> Self
pub fn default(self, value: impl Into<Value>) -> Self
Sets the default value for this argument.
Sourcepub fn default_str(self, value: impl Into<String>) -> Self
pub fn default_str(self, value: impl Into<String>) -> Self
Sets a string default value.
Sourcepub fn default_int(self, value: i64) -> Self
pub fn default_int(self, value: i64) -> Self
Sets an integer default value.
Sourcepub fn default_bool(self, value: bool) -> Self
pub fn default_bool(self, value: bool) -> Self
Sets a boolean default value.
Sourcepub fn hide(self) -> Self
pub fn hide(self) -> Self
Hides this argument from the schema.
Hidden arguments are not exposed to the LLM but must have a default value that will be used when the tool is called.
Sourcepub fn type_schema(self, schema: Value) -> Self
pub fn type_schema(self, schema: Value) -> Self
Sets the JSON Schema type for this argument.
Sourcepub fn drop_with_default(value: impl Into<Value>) -> Self
pub fn drop_with_default(value: impl Into<Value>) -> Self
Creates a transform that drops (hides) this argument with a default value.
Trait Implementations§
Source§impl Clone for ArgTransform
impl Clone for ArgTransform
Source§fn clone(&self) -> ArgTransform
fn clone(&self) -> ArgTransform
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more