pub struct FunctionBuilder { /* private fields */ }
Expand description
Builder for function tools
Implementations§
Source§impl FunctionBuilder
impl FunctionBuilder
Sourcepub fn description(self, desc: impl Into<String>) -> Self
pub fn description(self, desc: impl Into<String>) -> Self
Sets the function description
Sourcepub fn param(self, param: ParamBuilder) -> Self
pub fn param(self, param: ParamBuilder) -> Self
Adds a parameter to the function
Sourcepub fn json_schema(self, schema: Value) -> Self
pub fn json_schema(self, schema: Value) -> Self
Provides a full JSON Schema for the parameters. Using this method bypasses the DSL and allows arbitrary complex schemas (nested arrays, objects, oneOf, etc.).
Auto Trait Implementations§
impl Freeze for FunctionBuilder
impl RefUnwindSafe for FunctionBuilder
impl Send for FunctionBuilder
impl Sync for FunctionBuilder
impl Unpin for FunctionBuilder
impl UnwindSafe for FunctionBuilder
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
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>
Converts
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>
Converts
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