llm_tool/lib.rs
1#![cfg_attr(not(feature = "std"), no_std)]
2#![doc = include_str!("../README.md")]
3
4extern crate alloc;
5
6// Allow `::llm_tool::` paths (generated by the `#[llm_tool]` proc macro) to
7// resolve when compiling tests within this crate.
8extern crate self as llm_tool;
9
10mod compat;
11mod registry;
12mod rust_tool;
13mod types;
14
15/// Re-export `md_tmpl` so generated code can
16/// reference `::llm_tool::__md_tmpl::` without requiring the user
17/// to add `md-tmpl` as a direct dependency.
18#[cfg(feature = "md-tmpl")]
19#[doc(hidden)]
20pub use md_tmpl as __md_tmpl;
21/// Public re-export of `md_tmpl` for use in `context = fn` functions.
22///
23/// Use `llm_tool::md_tmpl::Context` when writing a context function
24/// for `#[llm_tool(prompt_file = "...", context = my_fn)]`.
25#[cfg(feature = "md-tmpl")]
26pub use md_tmpl;
27/// Re-export `md_tmpl_macros` so `response_file` generated code can
28/// auto-generate response types via `::llm_tool::__md_tmpl_macros::include_types!`
29/// without requiring the user to add `md-tmpl-macros` as a direct dependency.
30#[cfg(feature = "md-tmpl")]
31#[doc(hidden)]
32pub use md_tmpl_macros as __md_tmpl_macros;
33pub use registry::*;
34pub use rust_tool::*;
35pub use types::*;