pub struct UserMessage {
pub kind: String,
pub message: UserMessageBody,
pub parent_tool_use_id: Option<String>,
pub uuid: String,
pub priority: Option<Priority>,
pub should_query: Option<bool>,
pub timestamp: Option<String>,
pub client_composed: Option<bool>,
}Expand description
A user turn. Source: _internal/client.py:126–131
Fields§
§kind: StringAlways "user".
message: UserMessageBodyRole and content blocks.
parent_tool_use_id: Option<String>Tool call this message belongs to; None for a top-level prompt.
uuid: StringEchoed back (isReplay: true) when the CLI starts this message’s turn,
because the session runs with --replay-user-messages.
priority: Option<Priority>When the CLI takes the message in during a running turn; None = CLI default.
should_query: Option<bool>Some(false): append to the conversation without starting a turn.
timestamp: Option<String>ISO 8601 time the message was created. Part of the wire schema, but CLI 2.1.329 records its own receive time in the echo and transcript.
client_composed: Option<bool>Some(true): the host composed this text (the user did not type it).
The CLI delivers it as written: no @path expansion, no slash-command
dispatch, and no turn-start context attachments.
Implementations§
Source§impl UserMessage
impl UserMessage
Sourcepub fn blocks(content: Vec<ContentBlock>) -> Self
pub fn blocks(content: Vec<ContentBlock>) -> Self
A message with several blocks, e.g. text plus images.
Sourcepub fn with_timestamp(self, timestamp: impl Into<String>) -> Self
pub fn with_timestamp(self, timestamp: impl Into<String>) -> Self
Creation time as an ISO 8601 string, e.g. “2026-11-20T07:03:32.670Z”.
Sourcepub fn client_composed(self) -> Self
pub fn client_composed(self) -> Self
Mark the text as host-composed: delivered verbatim, with no @path
expansion, slash-command dispatch or turn-start attachments.
Sourcepub fn with_priority(self, priority: Priority) -> Self
pub fn with_priority(self, priority: Priority) -> Self
Set when the prompt is taken in during a running turn.
Sourcepub fn context_only(self) -> Self
pub fn context_only(self) -> Self
Add the message to the conversation without starting a turn. Its content is seen by the model on the next prompt.