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