pub struct ExecutorRegistry { /* private fields */ }Expand description
Registry of executors and config-defined tools.
Routes tool calls to the appropriate executor based on configuration.
Implementations§
Source§impl ExecutorRegistry
impl ExecutorRegistry
pub fn new() -> Self
Sourcepub fn register_executor(&mut self, executor: Arc<dyn ToolExecutor>)
pub fn register_executor(&mut self, executor: Arc<dyn ToolExecutor>)
Register an executor by name.
Sourcepub fn register_config_tool(&mut self, tool: ConfigTool)
pub fn register_config_tool(&mut self, tool: ConfigTool)
Register a config-defined tool.
Sourcepub fn set_fallback(&mut self, executor: Arc<dyn ToolExecutor>)
pub fn set_fallback(&mut self, executor: Arc<dyn ToolExecutor>)
Set a fallback executor for tools not found in config.
Sourcepub async fn execute(
&self,
tool_name: &str,
call_id: &str,
arguments: Value,
partial_tx: Option<UnboundedSender<String>>,
) -> SoulResult<ToolOutput>
pub async fn execute( &self, tool_name: &str, call_id: &str, arguments: Value, partial_tx: Option<UnboundedSender<String>>, ) -> SoulResult<ToolOutput>
Execute a tool by name, routing to the appropriate executor.
Sourcepub fn definitions(&self) -> Vec<ToolDefinition>
pub fn definitions(&self) -> Vec<ToolDefinition>
Get all tool definitions from config tools.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ExecutorRegistry
impl !RefUnwindSafe for ExecutorRegistry
impl Send for ExecutorRegistry
impl Sync for ExecutorRegistry
impl Unpin for ExecutorRegistry
impl !UnwindSafe for ExecutorRegistry
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