The result of the useCompletion hook.
API
interface UseCompletionResult {error: Error | undefined;exhaustedRetries: boolean;generatingError: Error | undefined;isGenerating: boolean;isLoading: boolean;isLoadingThread: boolean;isReceiving: boolean;isRunningToolCalls: boolean;isSavingThread: boolean;isSending: boolean;output: string | null;reload: () => void;sendingError: Error | undefined;threadLoadError: {
error: string;
stacktrace?: string;
} | undefined;threadSaveError: {
error: string;
stacktrace?: string;
} | undefined;}error
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, tool-calls, and thread load/save.
isLoadingThread
booleanWhether a thread load request is in flight.
isReceiving
booleanWhether the chat is receiving a response.
isRunningToolCalls
booleanWhether the chat is running tool calls.
isSavingThread
booleanWhether a thread save request is in flight.
isSending
booleanWhether the chat is sending a response.
output
string | nullThe output from the model.
reload
() => voidReload the chat, useful for retrying when an error occurs.
sendingError
Error | undefinedTransport/request failure before generation frames arrive.
threadLoadError
{
error: string;
stacktrace?: string;
} | undefinedError encountered while loading a thread.
threadSaveError
{
error: string;
stacktrace?: string;
} | undefinedError encountered while saving a thread.