pub struct LongRunningFunctionTool { /* private fields */ }Expand description
Wraps a ToolFunction and marks it as long-running.
The wrapper appends the long-running instruction to the inner tool’s description so the LLM knows not to re-invoke it while a previous call is still in progress. All other trait methods delegate directly to the inner tool.
Implementations§
Source§impl LongRunningFunctionTool
impl LongRunningFunctionTool
Sourcepub fn new(inner: Arc<dyn ToolFunction>) -> Self
pub fn new(inner: Arc<dyn ToolFunction>) -> Self
Create a new LongRunningFunctionTool wrapping the given inner tool.
Sourcepub fn is_long_running(&self) -> bool
pub fn is_long_running(&self) -> bool
Returns true — this tool is always considered long-running.
Trait Implementations§
Source§impl ToolFunction for LongRunningFunctionTool
impl ToolFunction for LongRunningFunctionTool
Source§fn description(&self) -> &str
fn description(&self) -> &str
Human-readable description of what this tool does.
Source§fn parameters(&self) -> Option<Value>
fn parameters(&self) -> Option<Value>
JSON Schema for the tool’s input parameters, or
None if parameterless.Auto Trait Implementations§
impl Freeze for LongRunningFunctionTool
impl !RefUnwindSafe for LongRunningFunctionTool
impl Send for LongRunningFunctionTool
impl Sync for LongRunningFunctionTool
impl Unpin for LongRunningFunctionTool
impl !UnwindSafe for LongRunningFunctionTool
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