Interface: RawMessage
Plain input object supplied to Message at construction time.
Remarks
Validated against rawMessageSchema before the Message instance is created. Temporal fields accept any value that Luxon can parse — ISO strings, Unix timestamps, Date objects, or existing DateTime instances.
At least one of content or attachments (non-empty) must be present — a message with neither throws @nhtio/adk!E_INVALID_INITIAL_MESSAGE_VALUE.
Properties
| Property | Type | Description |
|---|---|---|
attachments? | Media[] | Media attachments carried by this message — images, audio, video, documents. Remarks Optional and symmetric across roles: both user and assistant messages may carry attachments. Each attachment carries its own trustTier and modalityHazard, which the renderer uses to wrap the asset in its own trust envelope independent of the message envelope. How a renderer orders text vs attachments in the on-the-wire content array is a renderer-policy concern, not a contract of Message. |
content? | string | Tokenizable | The message content as a plain string or an existing @nhtio/adk!Tokenizable instance. Remarks Optional — but required when attachments is absent or empty. The cross-field rule on rawMessageSchema enforces that at least one of content or attachments is present. |
createdAt | string | number | Date | DateTime<boolean> | When this message was created. |
id | string | Stable unique identifier for this message. |
identity? | | string | Identity | RawIdentity | The identity of the participant who authored this message. Remarks Optional. When omitted, the role value is used as both the system-facing identifier and the model-facing representation. Three accepted forms when provided: - A plain string — used as both identifier and representation. - A @nhtio/adk!RawIdentity object — validated and wrapped into an @nhtio/adk!Identity. - An existing @nhtio/adk!Identity instance — passed through unchanged. |
role | MessageRole | Whether this message is from the human participant or the model. |
updatedAt | string | number | Date | DateTime<boolean> | When this message was last modified. |