Documentation / guides
SystemMessage
Represent system instructions as a typed conversation turn.
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
- Source:
core/content/message.go - Tests:
core/content/message_test.go,core/content/message_json_test.go
Related: System instructions, UserMessage.