hashbrown

UseStructuredCompletionResult

The result object-type returned by the useStructuredCompletion hook that provides the structured output and state for the completion.

API

UseStructuredCompletionResult
@typeOutput
error
Error | undefined

The error encountered during chat operations, if any.

exhaustedRetries
boolean

Whether the current request has exhausted retries.

generatingError
Error | undefined

Error emitted during generation frames.

isGenerating
boolean

Whether the chat is currently generating.

isLoading
boolean

Aggregate loading flag across transport, generation, tool-calls, and thread load/save.

isLoadingThread
boolean

Whether a thread load request is in flight.

isReceiving
boolean

Whether the chat is receiving a response.

isRunningToolCalls
boolean

Whether the chat is running tool calls.

isSavingThread
boolean

Whether a thread save request is in flight.

isSending
boolean

Whether the chat is sending a response.

output
Output | null

The output of the chat.

reload
() => void

Reload the chat, useful for retrying when an error occurs.

sendingError
Error | undefined

Transport/request failure before generation frames arrive.

threadLoadError
{
        error: string;
        stacktrace?: string;
    } | undefined

Error encountered while loading a thread.

threadSaveError
{
        error: string;
        stacktrace?: string;
    } | undefined

Error encountered while saving a thread.