Skip to main content

daimon/prompt/
mod.rs

1//! Composable prompt construction with variable interpolation.
2//!
3//! [`PromptTemplate`] supports `{variable}` placeholders and composable
4//! sections (persona, instructions, examples, constraints). Use
5//! [`PromptBuilder`] for fluent construction.
6//!
7//! ```ignore
8//! use daimon::prompt::PromptTemplate;
9//!
10//! let tpl = PromptTemplate::new("You are {role}. Today is {date}.")
11//!     .var("role", "a helpful assistant")
12//!     .var("date", "2026-03-03");
13//!
14//! assert_eq!(tpl.render_static(), "You are a helpful assistant. Today is 2026-03-03.");
15//! ```
16
17mod template;
18mod builder;
19mod dynamic;
20mod few_shot;
21
22pub use template::PromptTemplate;
23pub use builder::PromptBuilder;
24pub use dynamic::{DynamicContext, ErasedDynamicContext};
25pub use few_shot::FewShotTemplate;