Manage prompt messages and turn ordering
masterThe LlmPrompt struct uses a builder-like pattern to add messages. It enforces turn-ordering rules and returns a Result if rules are violated (e.g., adding two user messages in a row when the model expects an assistant response).
Supported message types:
add_system_message()add_user_message()add_assistant_message()
// Add system messages
prompt.add_system_message()?.set_content("You are a nice robot")?;
// User messages
prompt.add_user_message()?.set_content("Hello")?;
// LLM responses
prompt.add_assistant_message()?.set_content("Well, how do you do?")?;