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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ArgTransform
impl Debug for ArgTransform
Source§impl Default for ArgTransform
impl Default for ArgTransform
Source§fn default() -> ArgTransform
fn default() -> ArgTransform
Auto Trait Implementations§
impl Freeze for ArgTransform
impl RefUnwindSafe for ArgTransform
impl Send for ArgTransform
impl Sync for ArgTransform
impl Unpin for ArgTransform
impl UnsafeUnpin for ArgTransform
impl UnwindSafe for ArgTransform
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more