pub struct RunnableTool { /* private fields */ }Expand description
A runnable wrapped with a tool schema for use in tool-calling workflows.
Delegates all execution to the inner runnable while exposing the tool schema for model integration.
Implementations§
Source§impl RunnableTool
impl RunnableTool
Sourcepub fn new(inner: Box<dyn RunnableCore>, schema: ToolSchema) -> Self
pub fn new(inner: Box<dyn RunnableCore>, schema: ToolSchema) -> Self
Create a new tool-wrapped runnable.
Sourcepub const fn schema(&self) -> &ToolSchema
pub const fn schema(&self) -> &ToolSchema
Return a reference to this tool’s schema.
Trait Implementations§
Source§impl RunnableCore for RunnableTool
impl RunnableCore for RunnableTool
Source§fn invoke<'a>(
&'a self,
input: Value,
config: Option<&'a RunnableConfig>,
) -> BoxFuture<'a, Result<Value, SynwireError>>
fn invoke<'a>( &'a self, input: Value, config: Option<&'a RunnableConfig>, ) -> BoxFuture<'a, Result<Value, SynwireError>>
Invoke the runnable with a single input.
Source§fn batch<'a>(
&'a self,
inputs: Vec<Value>,
config: Option<&'a RunnableConfig>,
) -> BoxFuture<'a, Result<Vec<Value>, SynwireError>>
fn batch<'a>( &'a self, inputs: Vec<Value>, config: Option<&'a RunnableConfig>, ) -> BoxFuture<'a, Result<Vec<Value>, SynwireError>>
Invoke on multiple inputs. Default implementation calls
invoke sequentially for each input.Source§fn stream<'a>(
&'a self,
input: Value,
config: Option<&'a RunnableConfig>,
) -> BoxFuture<'a, Result<BoxStream<'a, Result<Value, SynwireError>>, SynwireError>>
fn stream<'a>( &'a self, input: Value, config: Option<&'a RunnableConfig>, ) -> BoxFuture<'a, Result<BoxStream<'a, Result<Value, SynwireError>>, SynwireError>>
Stream results. Default implementation wraps
invoke
as a single-item stream.Auto Trait Implementations§
impl Freeze for RunnableTool
impl !RefUnwindSafe for RunnableTool
impl Send for RunnableTool
impl Sync for RunnableTool
impl Unpin for RunnableTool
impl UnsafeUnpin for RunnableTool
impl !UnwindSafe for RunnableTool
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