Macro message_formatter

Source
macro_rules! message_formatter {
    ($($item:expr),* $(,)?) => { ... };
}
Expand description

§Example

// Create an AI message prompt template
let ai_message_prompt = AIMessagePromptTemplate::new(
template_fstring!(
    "AI response: {content} {test}",
    "content",
    "test"
));


let human_msg = Message::new_human_message("Hello from user");

// Use the `message_formatter` macro to construct the formatter.
let formatter = message_formatter![
    fmt_message!(human_msg),
    fmt_template!(ai_message_prompt),
    fmt_placeholder!("history")
];