pub trait AbstractToolset<Deps = ()>: Send + Sync {
// Required methods
fn id(&self) -> Option<&str>;
fn get_tools<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 RunContext<Deps>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, ToolsetTool>, ToolError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait;
fn call_tool<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
name: &'life1 str,
args: Value,
ctx: &'life2 RunContext<Deps>,
tool: &'life3 ToolsetTool,
) -> Pin<Box<dyn Future<Output = Result<ToolReturn, ToolError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait;
// Provided methods
fn label(&self) -> String { ... }
fn type_name(&self) -> &'static str { ... }
fn tool_name_conflict_hint(&self) -> String { ... }
fn enter<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ToolError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
fn exit<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<(), ToolError>> + Send + 'async_trait>>
where 'life0: 'async_trait,
Self: 'async_trait { ... }
}Expand description
Abstract toolset trait - collection of tools with shared management.
Toolsets group related tools together and can provide:
- Shared lifecycle management (enter/exit)
- Common configuration
- Tool filtering and transformation
§Type Parameters
Deps: The type of dependencies available to tools.
Required Methods§
Sourcefn get_tools<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 RunContext<Deps>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, ToolsetTool>, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn get_tools<'life0, 'life1, 'async_trait>(
&'life0 self,
ctx: &'life1 RunContext<Deps>,
) -> Pin<Box<dyn Future<Output = Result<HashMap<String, ToolsetTool>, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Get all available tools.
Returns a map of tool names to their definitions.
Sourcefn call_tool<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
name: &'life1 str,
args: Value,
ctx: &'life2 RunContext<Deps>,
tool: &'life3 ToolsetTool,
) -> Pin<Box<dyn Future<Output = Result<ToolReturn, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn call_tool<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
name: &'life1 str,
args: Value,
ctx: &'life2 RunContext<Deps>,
tool: &'life3 ToolsetTool,
) -> Pin<Box<dyn Future<Output = Result<ToolReturn, ToolError>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Call a tool by name.
Provided Methods§
Sourcefn tool_name_conflict_hint(&self) -> String
fn tool_name_conflict_hint(&self) -> String
Hint for resolving name conflicts.