pub struct FunctionTool<Deps> { /* private fields */ }Implementations§
Source§impl<Deps> FunctionTool<Deps>
impl<Deps> FunctionTool<Deps>
pub fn new<Args, Output, Func, Fut>(
name: impl Into<String>,
description: impl Into<String>,
func: Func,
) -> Result<Self, ToolError>where
Args: DeserializeOwned + JsonSchema + Send + 'static,
Output: Serialize + Send + 'static,
Func: Fn(RunContext<Deps>, Args) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<Output, ToolError>> + Send + 'static,
pub fn with_kind(self, kind: ToolKind) -> Self
pub fn with_sequential(self, sequential: bool) -> Self
pub fn with_timeout(self, timeout: f64) -> Self
Trait Implementations§
Source§impl<Deps> Tool<Deps> for FunctionTool<Deps>
impl<Deps> Tool<Deps> for FunctionTool<Deps>
Auto Trait Implementations§
impl<Deps> Freeze for FunctionTool<Deps>
impl<Deps> !RefUnwindSafe for FunctionTool<Deps>
impl<Deps> Send for FunctionTool<Deps>
impl<Deps> Sync for FunctionTool<Deps>
impl<Deps> Unpin for FunctionTool<Deps>
impl<Deps> !UnwindSafe for FunctionTool<Deps>
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