pub struct ToolNode { /* private fields */ }Expand description
A node that executes tool calls from the AI’s response.
ToolNode reads tool calls from the last AI message and executes them in parallel, returning the results as tool messages.
Implementations§
Source§impl ToolNode
impl ToolNode
Sourcepub fn with_error_handling(self, handle: bool) -> Self
pub fn with_error_handling(self, handle: bool) -> Self
Set whether to handle tool errors gracefully (returning error messages instead of propagating).
Sourcepub fn tool_names(&self) -> Vec<&str>
pub fn tool_names(&self) -> Vec<&str>
Get the list of available tool names.
Trait Implementations§
Source§impl Runnable for ToolNode
impl Runnable for ToolNode
Source§fn invoke(
&self,
input: &JsonValue,
config: &RunnableConfig,
) -> Result<JsonValue, RunnableError>
fn invoke( &self, input: &JsonValue, config: &RunnableConfig, ) -> Result<JsonValue, RunnableError>
Execute synchronously.
Source§fn ainvoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 JsonValue,
config: &'life2 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Result<JsonValue, RunnableError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn ainvoke<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
input: &'life1 JsonValue,
config: &'life2 RunnableConfig,
) -> Pin<Box<dyn Future<Output = Result<JsonValue, RunnableError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Execute asynchronously.
Auto Trait Implementations§
impl !RefUnwindSafe for ToolNode
impl !UnwindSafe for ToolNode
impl Freeze for ToolNode
impl Send for ToolNode
impl Sync for ToolNode
impl Unpin for ToolNode
impl UnsafeUnpin for ToolNode
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