Skip to documentation
Documentation navigation

Documentation navigation

Documentation / guides

System instructions

Set per-call system instruction separately from conversation history.

developer

Request.System is the per-agent system instruction string. It is separate from Request.Messages, so a caller can change the instruction for one invocation without rewriting the history thread.

API surface

request := inference.Request{
	System: "You are a careful release engineer. Cite evidence.",
	Messages: content.AgenticMessages{
		&content.UserMessage{Message: content.Message{
			Role: content.RoleUser,
			Blocks: []content.Block{&content.TextBlock{Text: "Review the change."}},
		}},
	},
}

The field is a plain string with no inference-layer constructor or validation beyond whatever provider codec policy applies. A system instruction is not automatically converted into a SystemMessage; choose the representation deliberately.

Separation from history

Use Request.System for request-scoped behavior. Use SystemMessage when a system turn is part of the ordered AgenticMessages conversation and must survive as history. This distinction matters for caching and provider codecs that treat system content specially.

Proof

Related: Conversation input, SystemMessage.

← back to documentation