SystemMessage

@Serializable
@SerialName(value = "system")
class SystemMessage(val content: String, val name: String? = null) : ChatMessage

System-role message — sets the assistant's behavior for the rest of the conversation.

Example:

val messages = listOf(
SystemMessage("You are a concise Kotlin expert."),
UserMessage("Explain extension functions."),
)

Constructors

Link copied to clipboard
constructor(content: String, name: String? = null)

Properties

Link copied to clipboard
open override val content: String

Instructions for the assistant.

Link copied to clipboard
val name: String?

Optional participant name forwarded to the model.

Functions

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open override fun toString(): String