pub struct RunnableTool<T> { /* private fields */ }
Expand description
A tool that can be used as a runnable
Implementations§
Trait Implementations§
Source§impl<T> Runnable<HashMap<String, Value>, ToolResult> for RunnableTool<T>where
T: Tool,
impl<T> Runnable<HashMap<String, Value>, ToolResult> for RunnableTool<T>where
T: Tool,
Source§fn invoke<'life0, 'async_trait>(
&'life0 self,
input: HashMap<String, Value>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<ToolResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn invoke<'life0, 'async_trait>(
&'life0 self,
input: HashMap<String, Value>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<ToolResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Invoke the runnable with a single input
Source§fn invoke_simple<'life0, 'async_trait>(
&'life0 self,
input: Input,
) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn invoke_simple<'life0, 'async_trait>(
&'life0 self,
input: Input,
) -> Pin<Box<dyn Future<Output = Result<Output>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Invoke the runnable with a single input (convenience method with default config)
Source§fn batch<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<Input>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Output>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn batch<'life0, 'async_trait>(
&'life0 self,
inputs: Vec<Input>,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Output>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Batch invoke the runnable with multiple inputs
Source§fn stream<'life0, 'async_trait>(
&'life0 self,
input: Input,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Output>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn stream<'life0, 'async_trait>(
&'life0 self,
input: Input,
config: Option<RunnableConfig>,
) -> Pin<Box<dyn Future<Output = Result<Pin<Box<dyn Stream<Item = Result<Output>> + Send>>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stream the output of the runnable
Source§fn input_schema(&self) -> Option<Value>
fn input_schema(&self) -> Option<Value>
Get the input schema for this runnable
Source§fn output_schema(&self) -> Option<Value>
fn output_schema(&self) -> Option<Value>
Get the output schema for this runnable
Source§fn config_schema(&self) -> Option<Value>
fn config_schema(&self) -> Option<Value>
Get the configuration schema for this runnable
Auto Trait Implementations§
impl<T> Freeze for RunnableTool<T>where
T: Freeze,
impl<T> RefUnwindSafe for RunnableTool<T>where
T: RefUnwindSafe,
impl<T> Send for RunnableTool<T>where
T: Send,
impl<T> Sync for RunnableTool<T>where
T: Sync,
impl<T> Unpin for RunnableTool<T>where
T: Unpin,
impl<T> UnwindSafe for RunnableTool<T>where
T: UnwindSafe,
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