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
Link copied to clipboard
data class Assistant @JvmOverloads constructor(val parts: List<MessagePart.ResponsePart>, val metaInfo: ResponseMetaInfo, val finishReason: String? = null, val rawResponse: JsonObject? = null, val id: String? = null) : Message
An assistant-role message returned by the LLM. May contain text, reasoning, and/or tool calls.
Link copied to clipboard
Defines the role of the message in the chat (e.g., system, user, assistant).
Link copied to clipboard
data class System @JvmOverloads constructor(val parts: List<MessagePart.Text>, val metaInfo: RequestMetaInfo, val id: String? = null) : Message
A system-role message used to set the behaviour or persona of the assistant. Only MessagePart.Text parts are supported.
Link copied to clipboard
data class User @JvmOverloads constructor(val parts: List<MessagePart.RequestPart>, val metaInfo: RequestMetaInfo, val id: String? = null) : Message
A user-role message sent to the LLM. May contain text, attachments, or tool results.