Skip to main content

//clika-runtime/io.clika.modelverse/ChatMessage

ChatMessage

[common]
data class ChatMessage(val role: String, val content: String, val images: List<ByteArray> = emptyList(), val toolCalls: List<ToolCall> = emptyList(), val toolCallId: String = "", val name: String = "")

One turn of a conversation. role is system, user or assistant; content the text; images the encoded image files (PNG or JPEG bytes) the turn carries, decoded by the library and placed in the turn where the model's template puts them. A model that takes no images refuses a turn with one, and a request carrying more than Capabilities.maxImagesPerRequest across its turns is refused; either request ends in GenerationListener.onError. An assistant turn that called tools carries them as toolCalls; a tool's result is a ROLE_TOOL turn naming the call it answers (toolCallId).

Constructors​

ChatMessage[common]
constructor(role: String, content: String, images: List<ByteArray> = emptyList(), toolCalls: List<ToolCall> = emptyList(), toolCallId: String = "", name: String = "")

Types​

NameSummary
Companion[common]
object Companion

Properties​

NameSummary
content[common]
val content: String
images[common]
val images: List<ByteArray>
name[common]
val name: String
On a tool turn, the tool's name when known.
role[common]
val role: String
toolCallId[common]
val toolCallId: String
On a tool turn, the id of the call this result answers.
toolCalls[common]
val toolCalls: List<ToolCall>
The calls an assistant turn made (ChatSession records them); empty on every other turn.