pub struct ToolNode {
pub name: String,
/* private fields */
}Expand description
Fields§
§name: StringImplementations§
Source§impl ToolNode
impl ToolNode
Sourcepub fn all(executor: ToolExecutor) -> Self
pub fn all(executor: ToolExecutor) -> Self
创建包含所有注册工具的 ToolNode。
Sourcepub fn new(name: impl Into<String>, executor: ToolExecutor) -> Self
pub fn new(name: impl Into<String>, executor: ToolExecutor) -> Self
创建指定名称的 ToolNode。
Sourcepub fn with_messages_key(self, key: impl Into<String>) -> Self
pub fn with_messages_key(self, key: impl Into<String>) -> Self
设置 State 中消息的 key(默认 “messages”)。
Trait Implementations§
Source§impl GraphNode for ToolNode
impl GraphNode for ToolNode
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 mut State,
) -> Pin<Box<dyn Future<Output = Result<NextStep, GraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 mut State,
) -> Pin<Box<dyn Future<Output = Result<NextStep, GraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
执行节点逻辑(阻塞模式)。
Source§fn execute_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 mut State,
_sink: &'life2 Sender<GraphEvent>,
span_id: SpanId,
) -> Pin<Box<dyn Future<Output = Result<StreamNodeResult, GraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_stream<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
state: &'life1 mut State,
_sink: &'life2 Sender<GraphEvent>,
span_id: SpanId,
) -> Pin<Box<dyn Future<Output = Result<StreamNodeResult, GraphError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
执行节点逻辑(流式模式),将内部事件转发到 channel。 Read more
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