pub enum Message {
System {
content: String,
cache_markers: Vec<SystemCacheMarker>,
},
Context {
content: String,
},
User {
content: String,
},
Multimodal {
parts: Vec<ContentPart>,
},
Assistant {
content: String,
tool_calls: Vec<ToolCall>,
reasoning: Option<AssistantReasoning>,
},
Tool {
result: MessageToolResult,
},
}Expand description
A message in the conversation.
Variants§
System
System-level instruction (identity, rules, tool guide).
Fields
cache_markers: Vec<SystemCacheMarker>Stable prompt ranges suitable for provider-side caching.
Context
Workspace context (AGENTS.md, history summary, retrieved files).
User
Message from the user.
Multimodal
Multimodal user message with ordered text and image parts (ADR-050).
The existing User { content: String } variant is preserved for
text-only backward compatibility. This variant is additive and requires
a pre-1.0 minor release for exhaustive match migration.
Fields
parts: Vec<ContentPart>Ordered content parts — text and image interleaved in the order the user composed them.
Assistant
Response from the assistant.
Fields
reasoning: Option<AssistantReasoning>Provider-native reasoning blocks attached to this message.
Request-history metadata only — never display content. See ADR-034.
Tool
Result of a tool execution.
Fields
result: MessageToolResultThe tool result.