pub struct ToolNode { /* private fields */ }Expand description
Calls one tool from the ToolRegistry service.
Implementations§
Trait Implementations§
Source§impl Node for ToolNode
impl Node for ToolNode
Source§fn run(&self, ctx: NodeContext) -> BoxFuture<'_, NodeResult>
fn run(&self, ctx: NodeContext) -> BoxFuture<'_, NodeResult>
Execute the node. Dropping the returned future cancels the node.
Source§fn inputs(&self) -> Vec<Selector>
fn inputs(&self) -> Vec<Selector>
Selectors this node reads.
crate::graph::Graph::build rejects selectors
whose namespace is neither a node id nor sys / env / conversation
(catching typos at load time) and warns about references into other
container bodies. Return every selector the node may read, including
placeholders inside templates.Source§fn branch_handles(&self) -> Option<Vec<String>>
fn branch_handles(&self) -> Option<Vec<String>>
Every handle a
NodeRole::Branch node may select, when known from its
configuration (if-else case ids, classifier class ids…). Graph building
rejects edges with other handles. None (the default) falls back to the
kind’s catalog descriptor: Fixed handles are checked, Dynamic ones are
not, and non-branch nodes have the single handle source.Source§fn tracks_turns(&self) -> bool
fn tracks_turns(&self) -> bool
Whether the node charges the run’s budget itself after each model
response, with its cost, and may keep checkpoints
(
NodeContext::charge, NodeContext::checkpoint). The engine then
charges it nothing when it completes, and gives it a checkpoint that
lasts across its attempts. Other nodes are charged the tokens of their
usage when they complete.Auto Trait Implementations§
impl Forget for ToolNode
impl Freeze for ToolNodewhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<(String, ArgSource)>: Freeze,
impl Move for ToolNode
impl RefUnwindSafe for ToolNode
impl Send for ToolNode
impl Sync for ToolNode
impl Unpin for ToolNode
impl UnsafeUnpin for ToolNodewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<(String, ArgSource)>: UnsafeUnpin,
impl UnwindSafe for ToolNodewhere
RawVecInner: UnwindSafe,
Arc<[Arc<str>]>: UnwindSafe,
Arc<str>: UnwindSafe,
Arc<Vec<Value>>: UnwindSafe,
Arc<IndexMap<String, Value>>: UnwindSafe,
Arc<File>: 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