Skip to main content

Interface: ChatMessage

A single chat message in a conversation.

Properties​

answerContract?​

optional answerContract?: AnswerContract

Canonical fact/governance manifest shared with MCP and first-party UI.


chart?​

optional chart?: Record<string, unknown>


confidence?​

optional confidence?: number

Headline confidence, 0–100 (the API's integer confidence_score) — render as ${Math.round(confidence)}%, never multiply by 100.


content​

content: string


conversationId?​

optional conversationId?: string

The conversation this message belongs to. Threaded back into the next sendMessage so multi-turn context is preserved. Distinct from id (the message id) — sending the message id as a conversation id makes the backend reject the 2nd turn with 400 "Conversation not found".


coreEvidence?​

optional coreEvidence?: CoreEvidence

The answer engine's trust account (undefined when absent). Render it with coreTrustLabel and coreCheckNote.


data?​

optional data?: Record<string, unknown>


governance?​

optional governance?: Governance

Governance attestation for a governed answer (undefined when absent).


id​

id: string


refusal?​

optional refusal?: Refusal

Set when the platform withheld this answer on governance grounds. Check it before rendering data — when it is present, sql, data and chart are all undefined by construction.


role​

role: "user" | "assistant"


sources?​

optional sources?: Record<string, unknown>


sql?​

optional sql?: string

The query behind the answer. Always undefined with an embed token (nxe_…): the API does not send it.


timestamp​

timestamp: string