Skip to Content
Anuma SDKReactInternalType AliasesSendMessageWithStorageResult

SendMessageWithStorageResult

SendMessageWithStorageResult = { assistantMessage: StoredMessage; autoExecutedToolResults?: object[]; data: ApiResponse; error: null; toolResultsMessage?: StoredMessage; userMessage: StoredMessage; } | { assistantMessage?: undefined; autoExecutedToolResults?: object[]; data: ApiResponse; error: null; skipped: true; userMessage?: undefined; } | { assistantMessage?: undefined; data: null; error: string; userMessage?: StoredMessage; } | { assistantMessage?: undefined; data: null; detached: true; error: "Request detached"; resume: StreamResumeHandle; userMessage: StoredMessage; }

Defined in: src/react/useChatStorage.ts:737 

Result from sendMessage with storage (React version) The data field contains the raw server response which includes tools_checksum.

Type Declaration

{ assistantMessage: StoredMessage; autoExecutedToolResults?: object[]; data: ApiResponse; error: null; toolResultsMessage?: StoredMessage; userMessage: StoredMessage; }

assistantMessage

assistantMessage: StoredMessage

autoExecutedToolResults?

optional autoExecutedToolResults: object[]

Results from tools that were auto-executed by the SDK (e.g. display tools)

data

data: ApiResponse

error

error: null

toolResultsMessage?

optional toolResultsMessage: StoredMessage

The synthetic [Tool Execution Results] row those results were persisted as, so a caller can key its transient overlay on the id the SDK actually wrote instead of deriving one (#5519). Absent when no tool ran, or when that (non-fatal) write failed.

userMessage

userMessage: StoredMessage

{ assistantMessage?: undefined; autoExecutedToolResults?: object[]; data: ApiResponse; error: null; skipped: true; userMessage?: undefined; }

assistantMessage?

optional assistantMessage: undefined

autoExecutedToolResults?

optional autoExecutedToolResults: object[]

Client-tool output remains available even when no private history is written.

data

data: ApiResponse

error

error: null

skipped

skipped: true

Indicates this was a skipStorage request - no messages were persisted

userMessage?

optional userMessage: undefined

{ assistantMessage?: undefined; data: null; error: string; userMessage?: StoredMessage; }

assistantMessage?

optional assistantMessage: undefined

data

data: null

error

error: string

userMessage?

optional userMessage: StoredMessage

{ assistantMessage?: undefined; data: null; detached: true; error: "Request detached"; resume: StreamResumeHandle; userMessage: StoredMessage; }

assistantMessage?

optional assistantMessage: undefined

data

data: null

detached

detached: true

error

error: "Request detached"

resume

resume: StreamResumeHandle

The generation keeps running; watch it with watchStream.

userMessage

userMessage: StoredMessage

Last updated on