pub struct CalcTool;Expand description
Evaluates a restricted arithmetic expression (+ - * / ( ) and numbers).
Trait Implementations§
impl Copy for CalcTool
Source§impl DynTool for CalcTool
impl DynTool for CalcTool
Source§fn description(&self) -> &'static str
fn description(&self) -> &'static str
Description.
Source§fn parameters(&self) -> Value
fn parameters(&self) -> Value
JSON schema parameters.
Source§fn metadata(&self) -> ToolMetadata
fn metadata(&self) -> ToolMetadata
Metadata.
Source§fn call<'life0, 'async_trait>(
&'life0 self,
_ctx: ToolCallContext,
arguments: Value,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn call<'life0, 'async_trait>(
&'life0 self,
_ctx: ToolCallContext,
arguments: Value,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Execute with JSON arguments (blocking convenience). Read more
Source§fn definition(&self) -> ToolDefinition
fn definition(&self) -> ToolDefinition
Model-facing definition.
Source§fn execute<'life0, 'async_trait>(
&'life0 self,
ctx: ToolCallContext,
arguments: Value,
) -> Pin<Box<dyn Future<Output = ToolStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn execute<'life0, 'async_trait>(
&'life0 self,
ctx: ToolCallContext,
arguments: Value,
) -> Pin<Box<dyn Future<Output = ToolStream> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Streaming entry point. Default wraps
DynTool::call as a single terminal.Auto Trait Implementations§
impl Freeze for CalcTool
impl RefUnwindSafe for CalcTool
impl Send for CalcTool
impl Sync for CalcTool
impl Unpin for CalcTool
impl UnsafeUnpin for CalcTool
impl UnwindSafe for CalcTool
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