Function: decodeConversationMessage()
@kortexya/reasoninglayer / decodeConversationMessage
Function: decodeConversationMessage()
Section titled “Function: decodeConversationMessage()”decodeConversationMessage(
payload):ConversationMessageResponse|null
Defined in: src/normalizers/conversation.ts:618
Decode a raw conversation-message payload exactly as sendMessage does.
Parameters
Section titled “Parameters”payload
Section titled “payload”unknown
A parsed JSON value: the body of POST /api/v1/conversation/message, or the data of a done event of the
streaming route.
Returns
Section titled “Returns”ConversationMessageResponse | null
The camelCase response, or null when the payload lacks a required
field of the wire DTO.
Remarks
Section titled “Remarks”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.
Example
Section titled “Example”const response = decodeConversationMessage(JSON.parse(frameData));if (response !== null) console.log(response.assistantMessage);