Represents the message stream in a conversation. Typically this will be a sequence of system prompt, then a series of user message and assistant responses. After the system message we have a user message. The next message is the assistant response. If the conversation is ongoing, the next message will be a user message, or if the previous AssistantMessage requested one or more tool calls it will be followed by ToolMessages in response to each requested tool.
Build one with Conversation.apply or a factory such as Conversation.fromPrompts, and change it with withMessages, addMessage and addMessages; the constructor and copy are private, so a new field never breaks callers.