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