The result object-type returned by the useStructuredCompletion hook that provides the structured output and state for the completion.
API
interface UseStructuredCompletionResult<Output> {error: Error | undefined;exhaustedRetries: boolean;generatingError: Error | undefined;isGenerating: boolean;isLoading: boolean;isReceiving: boolean;isRunningToolCalls: boolean;isSending: boolean;output: Output | null;reload: () => void;sendingError: Error | undefined;}UseStructuredCompletionResult
@typeOutputerror
Error | undefinedThe error encountered during chat operations, if any.
exhaustedRetries
booleanWhether the current request has exhausted retries.
generatingError
Error | undefinedError emitted during generation frames.
isGenerating
booleanWhether the chat is currently generating.
isLoading
booleanAggregate loading flag across transport, generation, and tool calls.
isReceiving
booleanWhether the chat is receiving a response.
isRunningToolCalls
booleanWhether the chat is running tool calls.
isSending
booleanWhether the chat is sending a response.
output
Output | nullThe output of the chat.
reload
() => voidReload the chat, useful for retrying when an error occurs.
sendingError
Error | undefinedTransport/request failure before generation frames arrive.