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 new() -> ArgTransform
pub fn new() -> ArgTransform
Creates a new empty argument transform.
Sourcepub fn name(self, name: impl Into<String>) -> ArgTransform
pub fn name(self, name: impl Into<String>) -> ArgTransform
Sets the new name for this argument.
Sourcepub fn description(self, desc: impl Into<String>) -> ArgTransform
pub fn description(self, desc: impl Into<String>) -> ArgTransform
Sets the new description for this argument.
Sourcepub fn default(self, value: impl Into<Value>) -> ArgTransform
pub fn default(self, value: impl Into<Value>) -> ArgTransform
Sets the default value for this argument.
Sourcepub fn default_str(self, value: impl Into<String>) -> ArgTransform
pub fn default_str(self, value: impl Into<String>) -> ArgTransform
Sets a string default value.
Sourcepub fn default_int(self, value: i64) -> ArgTransform
pub fn default_int(self, value: i64) -> ArgTransform
Sets an integer default value.
Sourcepub fn default_bool(self, value: bool) -> ArgTransform
pub fn default_bool(self, value: bool) -> ArgTransform
Sets a boolean default value.
Sourcepub fn hide(self) -> ArgTransform
pub fn hide(self) -> ArgTransform
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 required(self) -> ArgTransform
pub fn required(self) -> ArgTransform
Makes this argument required (even if it was optional).
Sourcepub fn type_schema(self, schema: Value) -> ArgTransform
pub fn type_schema(self, schema: Value) -> ArgTransform
Sets the JSON Schema type for this argument.
Sourcepub fn drop_with_default(value: impl Into<Value>) -> ArgTransform
pub fn drop_with_default(value: impl Into<Value>) -> ArgTransform
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