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;
20mod expr_eval;
21pub mod extended;
22mod math;
23mod python_repl;
24pub mod sandbox;
25mod search;
26mod ssrf;
27mod url_fetch;
28mod wikipedia;
29
30pub use calculator::{Calculator, CalculatorInput, CalculatorOutput};
31pub use datetime::{DateTimeInput, DateTimeOutput, DateTimeTool};
32pub use extended::{
33    ComputerMode, ComputerUseInput, ComputerUseOutput, ComputerUseTool, FileTool, HTTPTool,
34};
35pub use math::{MathInput, MathOutput, SimpleMathTool};
36pub use python_repl::{PythonREPLInput, PythonREPLOutput, PythonREPLTool};
37pub use sandbox::{CodeSandbox, Language, LocalSandbox, RunResult, SandboxError, SandboxTool};
38pub use search::{DuckDuckGoSearchTool, SearchInput, SearchOutput};
39pub use url_fetch::{URLFetchInput, URLFetchOutput, URLFetchTool};
40pub use wikipedia::{WikipediaInput, WikipediaOutput, WikipediaTool};
41
42// Re-export core tool types for convenience
43pub use lc_core::tools::{BaseTool, Tool, ToolError};
44
45// Re-export #[tool] procedural macro
46pub use lc_tools_derive::tool;