generate a message model for the chat