pub struct ToolExecutor { /* private fields */ }Expand description
工具执行器
调用现有的 Tools 系统执行任务节点。
Implementations§
Source§impl ToolExecutor
impl ToolExecutor
Sourcepub fn with_config(
tools: Vec<Box<dyn Tool>>,
config: ToolExecutorConfig,
) -> Self
pub fn with_config( tools: Vec<Box<dyn Tool>>, config: ToolExecutorConfig, ) -> Self
使用配置创建工具执行器
Sourcepub fn register_tool(&mut self, tool: Box<dyn Tool>)
pub fn register_tool(&mut self, tool: Box<dyn Tool>)
注册单个工具
Sourcepub fn render_params(
&self,
params: &HashMap<String, Value>,
context: &WorkflowContext,
) -> Result<Value>
pub fn render_params( &self, params: &HashMap<String, Value>, context: &WorkflowContext, ) -> Result<Value>
渲染参数
Sourcepub fn get_tool_definition(&self, name: &str) -> Option<ToolDefinition>
pub fn get_tool_definition(&self, name: &str) -> Option<ToolDefinition>
获取工具定义
Sourcepub fn get_all_tool_definitions(&self) -> Vec<ToolDefinition>
pub fn get_all_tool_definitions(&self) -> Vec<ToolDefinition>
获取所有工具定义
Trait Implementations§
Source§impl NodeExecutor for ToolExecutor
impl NodeExecutor for ToolExecutor
Auto Trait Implementations§
impl Freeze for ToolExecutor
impl !RefUnwindSafe for ToolExecutor
impl Send for ToolExecutor
impl Sync for ToolExecutor
impl Unpin for ToolExecutor
impl UnsafeUnpin for ToolExecutor
impl !UnwindSafe for ToolExecutor
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