pub struct ToolNode {
pub name: String,
pub executor: ToolExecutor,
pub config: ToolUseConfig,
}Expand description
工具执行节点。
Fields§
§name: String§executor: ToolExecutor§config: ToolUseConfigImplementations§
Source§impl ToolNode
impl ToolNode
pub fn new( name: impl Into<String>, executor: ToolExecutor, config: ToolUseConfig, ) -> Self
Trait Implementations§
Source§impl LeafNode<AgentState> for ToolNode
impl LeafNode<AgentState> for ToolNode
Source§fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut LeafContext<'life2, AgentState>,
) -> Pin<Box<dyn Future<Output = Result<(), GraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
ctx: &'life1 mut LeafContext<'life2, AgentState>,
) -> Pin<Box<dyn Future<Output = Result<(), GraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
执行节点逻辑。
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