Skip to main content

rig_core/tool/
mod.rs

1//! Tool authoring contracts, dispatch context, and canonical execution values.
2//! [`Tool`] is the tool trait; each call gets a [`ToolContext`].
3//!
4//! ```
5//! use rig_core::tool::ToolOutput;
6//!
7//! let output = ToolOutput::json(serde_json::json!({"count": 3}));
8//! assert!(output.as_json().is_some());
9//! ```
10
11pub mod builtin;
12pub mod context;
13pub mod contextual;
14mod facts;
15pub mod feedback;
16mod footprint;
17pub mod managed;
18mod output;
19mod result;
20pub mod schema;
21pub mod validate;
22pub use context::{
23    ContextValue, PublishedContext, ToolContext, ToolContextError, ToolResultContext,
24};
25pub use contextual::{DynamicTool, LivenessFn, Tool, ToolEmbedding, tool_definition, tool_name};
26pub use facts::{
27    ChangeKind, ContentHash, ExitStatus, FileChange, FileRead, FileState, FilesChanged, FilesRead,
28    Hunk, HunkLine, KeptEnd, Lines, LinesShown, OutputCut, content_hash,
29};
30pub use footprint::{Scope, Touches};
31pub use managed::{ManagedToolSink, ManagedToolToken};
32pub use output::{IntoToolOutput, ToolOutput};
33pub use result::{ToolErrorKind, ToolExecutionError, ToolResult};
34pub use schema::args_schema;