Skip to main content

lc_tools/
lib.rs

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