Construct a single-block message (back-compat convenience).
Construct a multi-block message (e.g. parallel tool_use/tool_result).
The first (or only) content block, for the common single-block message. Returns an empty text block when there are no blocks. For tool-loop messages (which carry several blocks) iterate contentBlocks.
Set the message to a single content block (back-compat convenience).
All content blocks of the message. The spec models a sampling message's content as a single block OR an array of blocks (SamplingMessageContentBlock | SamplingMessageContentBlock[], schema.ts). A tool-loop follow-up request carries multiple blocks: an assistant message with several tool_use blocks and a user message with several tool_result blocks. This field holds every block so none is dropped. For the common single-block message, use the content accessor.
optional message-level _meta object (schema.ts: SamplingMessage.meta)
"user" or "assistant"
A single message in a sampling conversation. role is "user" or "assistant"; content reuses the SDK's Content block (text/image/audio).