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