Message
Represents a message exchanged in a chat with LLM. Messages can be categorized by their type and role, denoting the purpose and source of the message.
Represents both a message from LLM and a message to LLM from user or environment.
Inheritors
Types
Represents a message generated by the assistant as a response.
Represents a reasoning message exchanged in a chat system, encapsulating the content, role, and associated metadata, with an optional reference to the original thinking process.
Represents a request message in the chat.
Represents a response message in the chat.
Defines the role of the message in the chat (e.g., system, user, assistant, tool).
Represents a system-generated message.
Represents messages exchanged with tools, either as calls or results.
Represents a message sent by the user as a request.
Properties
The textual content of the message aggregated from all ContentPart.Text parts joined to String separated by newlines.
Stores metadata information for the current message instance, such as token count and timestamp.
The content parts of the message. By default, if the message is a single text message, it will contain a single ContentPart.Text part. If the message contains multiple parts, it will contain an ordered list of ContentPart.Text and ContentPart.Attachment instances.
The role associated with the message.