Skip to documentation
Documentation navigation

Documentation navigation

Documentation / guides

SystemMessage

Represent system instructions as a typed conversation turn.

developer

SystemMessage is the typed system turn. The provider-neutral Request.System field is a separate request-level instruction; use SystemMessage when the conversation itself needs a system turn.

API surface

type SystemMessage struct{ Message }
system := &content.SystemMessage{Message: content.Message{
	Role: content.RoleSystem,
	Blocks: []content.Block{
		&content.TextBlock{Text: "Use short, factual answers."},
	},
}}

The type has no additional fields. A system turn can contain the same block slice as the other message types, although provider codecs may restrict which blocks they accept in a system position.

Proof

Related: System instructions, UserMessage.

← back to documentation