Skip to main content

lc_tools/
lib.rs

1// lc-tools/src/lib.rs
2//! Built-in tools for langchainrust.
3//!
4//! Provides a collection of ready-to-use tools for agents:
5//! - `Calculator`: Math expression evaluation
6//! - `DateTimeTool`: Date/time queries and calculations
7//! - `SimpleMathTool`: Advanced math operations
8//! - `PythonREPLTool`: Python code execution (disabled by default)
9//! - `DuckDuckGoSearchTool`: Web search via DuckDuckGo
10//! - `URLFetchTool`: Web page fetching and parsing
11//! - `WikipediaTool`: Wikipedia search
12//! - `FileTool`: Sandboxed file operations
13//! - `HTTPTool`: HTTP requests with SSRF protection
14//! - `SQLTool`: Read-only SQL queries (feature-gated)
15//! - `ComputerUseTool`: Screen interaction via Anthropic API
16//! - `SandboxTool` / `LocalSandbox`: Code execution sandbox
17
18mod calculator;
19mod datetime;
20pub mod extended;
21mod math;
22mod python_repl;
23pub mod sandbox;
24mod search;
25mod ssrf;
26mod url_fetch;
27mod wikipedia;
28
29pub use calculator::{Calculator, CalculatorInput, CalculatorOutput};
30pub use datetime::{DateTimeInput, DateTimeOutput, DateTimeTool};
31pub use extended::{
32    ComputerMode, ComputerUseInput, ComputerUseOutput, ComputerUseTool, FileTool, HTTPTool,
33};
34pub use math::{MathInput, MathOutput, SimpleMathTool};
35pub use python_repl::{PythonREPLInput, PythonREPLOutput, PythonREPLTool};
36pub use sandbox::{CodeSandbox, Language, LocalSandbox, RunResult, SandboxError, SandboxTool};
37pub use search::{DuckDuckGoSearchTool, SearchInput, SearchOutput};
38pub use url_fetch::{URLFetchInput, URLFetchOutput, URLFetchTool};
39pub use wikipedia::{WikipediaInput, WikipediaOutput, WikipediaTool};
40
41// Re-export core tool types for convenience
42pub use lc_core::tools::{BaseTool, Tool, ToolError};
43
44// Re-export #[tool] procedural macro
45pub use lc_tools_derive::tool;