Skip to main content

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_prompt;
13mod rust_resource;
14mod rust_tool;
15mod types;
16
17/// Re-export `md_tmpl` so generated code can
18/// reference `::llm_tool::__md_tmpl::` without requiring the user
19/// to add `md-tmpl` as a direct dependency.
20#[cfg(feature = "md-tmpl")]
21#[doc(hidden)]
22pub use md_tmpl as __md_tmpl;
23/// Public re-export of `md_tmpl` for use in `context = fn` functions.
24///
25/// Use `llm_tool::md_tmpl::Context` when writing a context function
26/// for `#[llm_tool(prompt_file = "...", context = my_fn)]`.
27#[cfg(feature = "md-tmpl")]
28pub use md_tmpl;
29/// Re-export `md_tmpl_macros` so `response_file` generated code can
30/// auto-generate response types via `::llm_tool::__md_tmpl_macros::include_types!`
31/// without requiring the user to add `md-tmpl-macros` as a direct dependency.
32#[cfg(feature = "md-tmpl")]
33#[doc(hidden)]
34pub use md_tmpl_macros as __md_tmpl_macros;
35pub use registry::*;
36pub use rust_prompt::*;
37pub use rust_resource::*;
38pub use rust_tool::*;
39pub use types::*;