Skip to main content

ChatMessage

@gravity-rail/sdk


@gravity-rail/sdk / ChatMessage

Interface: ChatMessage

Properties​

audience?​

optional audience: MessageAudience | null

ADR-11 provenance: WHO this message is for. agent_only messages are context the member never said and must never render as member speech.


audioFileUuid?​

optional audioFileUuid: string | null


audioMetadata?​

optional audioMetadata: AudioMessageMetadata | null


childMessageCount?​

optional childMessageCount: number

How many messages hang off this one as a detached background trajectory (a forked tool trajectory that outgrew its turn). Non-zero is the cue to offer a "show work" expander; the thread itself is fetched lazily via getChildThreadMessages. Absent/0 for ordinary messages.


content​

content: string | MessageContentPart[]


created_at?​

optional created_at: string


email_id?​

optional email_id: number


error?​

optional error: object

code​

code: string

message​

message: string


error_details?​

optional error_details: ChatCompletionError


failed?​

optional failed: boolean


id​

id: string


inbox_id?​

optional inbox_id: number


interactionMode?​

optional interactionMode: InteractionSessionResponseMode | null


interactionSessionId?​

optional interactionSessionId: string | null

First-class audio assistant message. audioFileUuid points at a workspace File whose bytes the chat renderer should play. Set together with audioMetadata: an audio message has both fields, a text message has neither.


interactionTurnId?​

optional interactionTurnId: string | null


memberId?​

optional memberId: number | null


origin?​

optional origin: MessageOrigin | null

ADR-11 provenance: WHO authored this message. Null on rows written before the column existed — fall back to role.


originalContent?​

optional originalContent: string | MessageContentPart[]


parentMessageId?​

optional parentMessageId: string | null

The fork point this message hangs off, as the PARENT's message uuid (so it joins against id client-side). Null for ordinary main-thread messages.


reasoning_content?​

optional reasoning_content: string


role​

role: MessageRole


sendAsAssistant?​

optional sendAsAssistant: boolean


smsDeliveryErrorCode?​

optional smsDeliveryErrorCode: string | null


smsDeliveryFailureReason?​

optional smsDeliveryFailureReason: string | null

Friendly failure reason string. Only set when smsDeliveryStatus is failed or undelivered.


smsDeliveryStatus?​

optional smsDeliveryStatus: SMSDeliveryStatus | null

SMS delivery status (queued/sending/sent/delivered/undelivered/failed). Only set for SMS messages.


smsDeliveryUpdatedAt?​

optional smsDeliveryUpdatedAt: string | null


suggestions?​

optional suggestions: string[]


taskId?​

optional taskId: number | null


tokenUsage?​

optional tokenUsage: MessageTokenUsageResponse


tool_call_id?​

optional tool_call_id: string


tool_calls?​

optional tool_calls: ToolCall[]


truncatedAtMs?​

optional truncatedAtMs: number


truncationReason?​

optional truncationReason: TruncationReason


userRating?​

optional userRating: number | null

Viewer's durable thumbs rating for this assistant message (1.0 up / 0.0 down). Loaded from chat_feedback; null/undefined when the viewer has not rated it.


userRatingComment?​

optional userRatingComment: string | null

Free-text details the viewer attached to their rating, if any.


uuid?​

optional uuid: string | null

Canonical persisted Message UUID. id remains the provider correlation id.