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;isLoadingThread: boolean;isReceiving: boolean;isRunningToolCalls: boolean;isSavingThread: boolean;isSending: boolean;output: Output | null;reload: () => void;sendingError: Error | undefined;threadLoadError: {
error: string;
stacktrace?: string;
} | undefined;threadSaveError: {
error: string;
stacktrace?: string;
} | undefined;}@typeOutputError | undefinedThe error encountered during chat operations, if any.
booleanWhether the current request has exhausted retries.
Error | undefinedError emitted during generation frames.
booleanWhether the chat is currently generating.
booleanAggregate loading flag across transport, generation, tool-calls, and thread load/save.
booleanWhether a thread load request is in flight.
booleanWhether the chat is receiving a response.
booleanWhether the chat is running tool calls.
booleanWhether a thread save request is in flight.
booleanWhether the chat is sending a response.
Output | nullThe output of the chat.
() => voidReload the chat, useful for retrying when an error occurs.
Error | undefinedTransport/request failure before generation frames arrive.
{
error: string;
stacktrace?: string;
} | undefinedError encountered while loading a thread.
{
error: string;
stacktrace?: string;
} | undefinedError encountered while saving a thread.