Skip to content

Function: decodeConversationMessage()

@kortexya/reasoninglayer


@kortexya/reasoninglayer / decodeConversationMessage

decodeConversationMessage(payload): ConversationMessageResponse | null

Defined in: src/normalizers/conversation.ts:618

Decode a raw conversation-message payload exactly as sendMessage does.

unknown

A parsed JSON value: the body of POST /api/v1/conversation/message, or the data of a done event of the streaming route.

ConversationMessageResponse | null

The camelCase response, or null when the payload lacks a required field of the wire DTO.

Use this, not a generic key re-casing, to decode a payload the SDK did not fetch: queryResults rows keep their keys verbatim (they are the query’s variable names), which a blanket snake→camel transform would re-case.

const response = decodeConversationMessage(JSON.parse(frameData));
if (response !== null) console.log(response.assistantMessage);