1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! # serdes-ai-toolsets
//!
//! Toolset abstractions for grouping and managing tools.
//!
//! This crate provides the infrastructure for organizing tools into logical
//! groups with shared configuration, lifecycle management, and composition.
//!
//! ## Core Concepts
//!
//! - **[`AbstractToolset`]**: Base trait for all toolsets
//! - **[`FunctionToolset`]**: Wrap function-based tools
//! - **[`CombinedToolset`]**: Merge multiple toolsets
//! - **[`DynamicToolset`]**: Runtime tool management
//!
//! ## Toolset Wrappers
//!
//! - **[`FilteredToolset`]**: Filter tools by predicate
//! - **[`PrefixedToolset`]**: Add name prefixes
//! - **[`RenamedToolset`]**: Rename specific tools
//! - **[`PreparedToolset`]**: Runtime tool modification
//! - **[`ApprovalRequiredToolset`]**: Require approval
//! - **[`WrapperToolset`]**: Pre/post processing hooks
//! - **[`ExternalToolset`]**: External tool execution
//!
//! ## Example
//!
//! ```rust
//! use serdes_ai_toolsets::{FunctionToolset, CombinedToolset, PrefixedToolset, AbstractToolset};
//! use serdes_ai_tools::{Tool, ToolDefinition, RunContext, ToolReturn, ToolError};
//! use async_trait::async_trait;
//!
//! struct SearchTool;
//!
//! #[async_trait]
//! impl Tool for SearchTool {
//! fn definition(&self) -> ToolDefinition {
//! ToolDefinition::new("search", "Search for items")
//! }
//!
//! async fn call(&self, _ctx: &RunContext, _args: serde_json::Value) -> Result<ToolReturn, ToolError> {
//! Ok(ToolReturn::text("results"))
//! }
//! }
//!
//! // Create toolsets
//! let web_tools = FunctionToolset::new().with_id("web").tool(SearchTool);
//! let local_tools = FunctionToolset::new().with_id("local").tool(SearchTool);
//!
//! // Prefix to avoid conflicts
//! let prefixed_web = PrefixedToolset::new(web_tools, "web");
//! let prefixed_local = PrefixedToolset::new(local_tools, "local");
//!
//! // Combine into one
//! let all_tools = CombinedToolset::new()
//! .with_toolset(prefixed_web)
//! .with_toolset(prefixed_local);
//! ```
// Re-exports
pub use ;
pub use ;
pub use CombinedToolset;
pub use DynamicToolset;
pub use ExternalToolset;
pub use ;
pub use ;
pub use PrefixedToolset;
pub use ;
pub use RenamedToolset;
pub use ;
/// Prelude for common imports.