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//! - `HostedSearchTool`: hosted search backends (Tavily / Serper / Exa), see [`hosted_search`]
12//! - `URLFetchTool`: Web page fetching and parsing
13//! - `WikipediaTool`: Wikipedia search
14//! - `FileTool`: Sandboxed file operations
15//! - `HTTPTool`: HTTP requests with SSRF protection
16//! - `SQLTool`: Read-only SQL queries (feature-gated)
17//! - `ComputerUseTool`: Screen interaction via Anthropic API
18//! - `SandboxTool` / `LocalSandbox`: Code execution sandbox
19
20#[cfg(feature = "browser-cdp")]
21pub mod browser;
22mod calculator;
23mod datetime;
24mod expr_eval;
25pub mod extended;
26pub mod hosted_search;
27mod math;
28mod python_repl;
29pub mod sandbox;
30mod search;
31mod skills;
32mod ssrf;
33mod url_fetch;
34mod wikipedia;
35
36pub use calculator::{Calculator, CalculatorInput, CalculatorOutput};
37pub use datetime::{DateTimeInput, DateTimeOutput, DateTimeTool};
38pub use extended::{
39    ComputerMode, ComputerUseInput, ComputerUseOutput, ComputerUseTool, FileTool, HTTPTool,
40};
41pub use hosted_search::HostedSearchTool;
42pub use math::{MathInput, MathOutput, SimpleMathTool};
43pub use python_repl::{PythonREPLInput, PythonREPLOutput, PythonREPLTool};
44pub use sandbox::{CodeSandbox, Language, LocalSandbox, RunResult, SandboxError, SandboxTool};
45pub use search::{DuckDuckGoSearchTool, SearchInput, SearchOutput};
46pub use skills::{Skill, SkillError, SkillFrontmatter};
47pub use url_fetch::{URLFetchInput, URLFetchOutput, URLFetchTool};
48pub use wikipedia::{WikipediaInput, WikipediaOutput, WikipediaTool};
49
50// Re-export core tool types for convenience
51pub use lc_core::tools::{BaseTool, Tool, ToolError};
52
53// Re-export #[tool] procedural macro
54pub use lc_tools_derive::tool;