The result object-type returned by the useStructuredCompletion hook that provides the structured output and state for the completion.
API
interface UseStructuredCompletionResult<Output, State = unknown> {error: Error | undefined;exhaustedRetries: boolean;generatingError: Error | undefined;isGenerating: boolean;isLoading: boolean;isReceiving: boolean;readonly isResuming: boolean;isRunningToolCalls: boolean;isSending: boolean;output: Output | null;readonly pendingInterrupts: PendingInterruptBatch | undefined;reload: () => void;resume(options: ResumeOptions): void;sendingError: Error | undefined;setState(state: State): void;readonly state: State | undefined;stop(clearStreamingMessage?: boolean): void;}@typeOutput@typeStateError | undefinedThe error encountered during chat operations, if any.
booleanWhether the current request has exhausted retries.
Error | undefinedError emitted during generation events.
booleanWhether the chat is currently generating.
booleanAggregate loading flag across transport, generation, and tool calls.
booleanWhether the chat is receiving a response.
booleanWhether the whole resumed interaction is executing.
booleanWhether the chat is running tool calls.
booleanWhether the chat is sending a response.
Output | nullThe output of the chat.
PendingInterruptBatch | undefinedThe current interrupt batch, retained until resume is acknowledged.
() => voidReload the chat, useful for retrying when an error occurs.
Error | undefinedTransport/request failure before generation events arrive.
State | undefinedThe currently visible shared agent state.