Expand description
Composable prompt construction with variable interpolation.
PromptTemplate supports {variable} placeholders and composable
sections (persona, instructions, examples, constraints). Use
PromptBuilder for fluent construction.
ⓘ
use daimon::prompt::PromptTemplate;
let tpl = PromptTemplate::new("You are {role}. Today is {date}.")
.var("role", "a helpful assistant")
.var("date", "2026-03-03");
assert_eq!(tpl.render_static(), "You are a helpful assistant. Today is 2026-03-03.");Structs§
- FewShot
Template - A collection of input/output example pairs injected into a prompt to guide the model’s behaviour through demonstration.
- Prompt
Builder - Fluent builder for composing prompts from sections.
- Prompt
Template - A prompt template with
{variable}interpolation.
Traits§
- Dynamic
Context - Provides a named variable value resolved at runtime (e.g. current date, user profile, database lookup).
- Erased
Dynamic Context - Object-safe wrapper for
DynamicContext.