ChatMessage

data class ChatMessage @JvmOverloads constructor(var role: ChatUser, var content: String?, var toolCalls: List<ToolCall>? = null, var toolCallId: String? = null)

ChatGPT's biggest innovation is its conversation memory. To remember the conversation, we need to map each message to who sent it. This data class wraps a message with the user who sent the message.

See also

Constructors

Link copied to clipboard
constructor(role: ChatUser, content: String?, toolCalls: List<ToolCall>? = null, toolCallId: String? = null)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Returns true if this message has tool calls.

Properties

Link copied to clipboard

The string content of the message.

Link copied to clipboard

The user who sent this message.

Link copied to clipboard
Link copied to clipboard