pub struct BuiltinToolExecutor { /* private fields */ }Expand description
Built-in tool executor that uses ToolRegistry for dynamic dispatch
Implementations§
Source§impl BuiltinToolExecutor
impl BuiltinToolExecutor
Sourcepub fn new_with_permissions(
permission_checker: Arc<dyn PermissionChecker>,
) -> Self
pub fn new_with_permissions( permission_checker: Arc<dyn PermissionChecker>, ) -> Self
Creates a new executor with a permission checker
Sourcepub fn new_with_config(config: Arc<RwLock<Config>>) -> Self
pub fn new_with_config(config: Arc<RwLock<Config>>) -> Self
Creates a new executor that can read the shared, hot-reloadable config.
Use this when running inside the Bamboo server so tools (notably
http_request) honor proxy settings from config.json.
Sourcepub fn new_with_config_and_permissions(
config: Arc<RwLock<Config>>,
permission_checker: Arc<dyn PermissionChecker>,
) -> Self
pub fn new_with_config_and_permissions( config: Arc<RwLock<Config>>, permission_checker: Arc<dyn PermissionChecker>, ) -> Self
Creates a new executor with both shared config and a permission checker.
Sourcepub fn with_registry(registry: ToolRegistry) -> Self
pub fn with_registry(registry: ToolRegistry) -> Self
Creates a new executor from an existing registry
Sourcepub fn registry(&self) -> &ToolRegistry
pub fn registry(&self) -> &ToolRegistry
Returns a reference to the internal registry
Sourcepub fn tool_schemas() -> Vec<ToolSchema>
pub fn tool_schemas() -> Vec<ToolSchema>
Returns all built-in tool schemas
Sourcepub fn register_tool<T: Tool + 'static>(&self, tool: T) -> Result<(), ToolError>
pub fn register_tool<T: Tool + 'static>(&self, tool: T) -> Result<(), ToolError>
Registers a custom tool to this executor
Sourcepub fn register_tool_with_guide<T, G>(
&self,
tool: T,
guide: G,
) -> Result<(), ToolError>
pub fn register_tool_with_guide<T, G>( &self, tool: T, guide: G, ) -> Result<(), ToolError>
Register a tool with its guide
Sourcepub fn build_enhanced_prompt(&self, context: GuideBuildContext) -> String
pub fn build_enhanced_prompt(&self, context: GuideBuildContext) -> String
Build enhanced prompt for all registered tools
Trait Implementations§
Source§impl Default for BuiltinToolExecutor
impl Default for BuiltinToolExecutor
Source§impl ToolExecutor for BuiltinToolExecutor
impl ToolExecutor for BuiltinToolExecutor
Source§fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute<'life0, 'life1, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Executes a tool call Read more
Source§fn execute_with_context<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
ctx: ToolExecutionContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_with_context<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
call: &'life1 ToolCall,
ctx: ToolExecutionContext<'life2>,
) -> Pin<Box<dyn Future<Output = Result<ToolResult, ToolError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Executes a tool call with streaming-capable context. Read more
Source§fn list_tools(&self) -> Vec<ToolSchema>
fn list_tools(&self) -> Vec<ToolSchema>
Lists all available tools and their schemas Read more
Auto Trait Implementations§
impl Freeze for BuiltinToolExecutor
impl !RefUnwindSafe for BuiltinToolExecutor
impl Send for BuiltinToolExecutor
impl Sync for BuiltinToolExecutor
impl Unpin for BuiltinToolExecutor
impl UnsafeUnpin for BuiltinToolExecutor
impl !UnwindSafe for BuiltinToolExecutor
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