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
//! Ferrin tool system.
//!
//! Tool definitions ([`Tool`], [`ToolKind`], [`ToolSet`]), the execution
//! contract ([`ToolExecute`], [`ToolOutput`], [`ToolContext`], [`ToolError`]),
//! approval declarations ([`NeedsApproval`]), model-output normalisation,
//! caller restrictions, tool fingerprints and (feature `sandbox`) the
//! [`Sandbox`] trait with a local-process implementation.
//!
//! Tool call parsing, approval resolution, execution scheduling and repair
//! live in the core crate; this crate only describes tools and runs one
//! execution when asked.
//!
//! Design: `docs/01-architecture/06-tool-system.md`, ADR 0012.
//!
//! # Attribution
//!
//! Portions of this crate are derived from the Vercel AI SDK (Apache-2.0,
//! Copyright 2023 Vercel, Inc.), translated from TypeScript to Rust and
//! modified. See the `NOTICE` file in the crate root.
pub use ToolBuilder;
pub use PreparedToolCallers;
pub use ToolCaller;
pub use ToolCallerDefinition;
pub use ToolCallers;
pub use DuplicateToolError;
pub use ToolError;
pub use ToolContext;
pub use ToolExecute;
pub use ToolOutput;
pub use ToolOutputStream;
pub use execute_to_completion;
pub use JsonSchema;
pub use Schema;
pub use ToolDrift;
pub use ErrorMode;
pub use LocalProcessSandbox;
pub use Sandbox;
pub use SandboxProcess;
pub use ToolSet;
pub use ApprovalFn;
pub use Description;
pub use DescriptionContext;
pub use DescriptionFn;
pub use InputAvailableHook;
pub use InputDeltaHook;
pub use InputStartHook;
pub use ModelOutputArgs;
pub use NeedsApproval;
pub use ToModelOutputFn;
pub use Tool;
pub use ToolHooks;
pub use ToolKind;