Messages
Messages represent individual turns in a conversation. Each message has a role and content. The order is automatically inferred from the message’s position in the array.
Structure
Required Fields
role
The role of the message sender. Must be one of:
content
The text content of the message. This field is required.
Optional Fields
steps
Array of processing steps. See Steps for details. Typically used for assistant messages to capture reasoning and tool usage.
Custom metadata for the message.
Role Examples
User Messages
Assistant Messages
System Messages
Best Practices
Message order is automatic: The order of messages is automatically inferred from their position in the array. Keep messages in chronological order.
Use steps for assistant messages: Capturing the reasoning process enables more detailed evaluation of agent behavior.
Store raw content: Keep the original message content even if you also use steps, for easier human review.