pub struct FunctionToolBuilder<Args = Value> { /* private fields */ }Implementations§
Source§impl<Args> FunctionToolBuilder<Args>
impl<Args> FunctionToolBuilder<Args>
pub fn description(self, description: impl Into<String>) -> Self
pub fn json_schema(self, schema: Value) -> Self
pub fn handler<NextArgs, F, Fut>(
self,
handler: F,
) -> FunctionToolBuilder<NextArgs>where
NextArgs: DeserializeOwned + Send + Sync + 'static,
F: Fn(ToolCallContext, NextArgs) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<ToolOutput, String>> + Send + 'static,
pub fn build(self) -> Result<FunctionTool<Args>, String>
Auto Trait Implementations§
impl<Args = Value> !RefUnwindSafe for FunctionToolBuilder<Args>
impl<Args = Value> !UnwindSafe for FunctionToolBuilder<Args>
impl<Args> Freeze for FunctionToolBuilder<Args>
impl<Args> Send for FunctionToolBuilder<Args>
impl<Args> Sync for FunctionToolBuilder<Args>
impl<Args> Unpin for FunctionToolBuilder<Args>
impl<Args> UnsafeUnpin for FunctionToolBuilder<Args>
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 moreCreates a shared type from an unshared type.