Thrown when the order of the messages role is not alternating between 'user' and 'assistant'.
Example
conversation.addMessage(newMessage("user", "Hello!")); conversation.addMessage(newMessage("user", "How are you?")); // This throws a MessageRoleException
Thrown when the order of the messages role is not alternating between 'user' and 'assistant'.
Example