import { Chat, type ModelInput, s, type TransportOrFactory } from '@hashbrownai/core';
/**
* Options for the `useStructuredCompletion` hook.
*
* @public
* @typeParam Input - The type of the input to predict from.
* @typeParam Schema - The schema to use for the chat.
*/
export interface UseStructuredCompletionOptions {
/**
* The input string to predict from.
*/
input: Input | null | undefined;
/**
* The LLM model to use for the chat.
*/
model: ModelInput;
/**
* The system message to use for the chat.
*/
system: string;
/**
* The schema to use for the chat.
*/
schema: Schema;
/**
* The tools to make available for the chat.
* default: []
*/
tools?: Chat.AnyTool[];
/**
* The debounce time between sends to the endpoint.
* default: 150
*/
debounceTime?: number;
/**
* The name of the hook, useful for debugging.
*/
debugName?: string;
/**
* Number of retries if an error is received.
* default: 0
*/
retries?: number;
/**
* Optional transport override for this hook.
*/
transport?: TransportOrFactory;
/**
* Controls how the provider is asked to produce structured output.
*/
structuredOutput?: Chat.Api.StructuredOutputOptions;
/**
* Whether this completion should be treated as UI-generating.
*/
ui?: boolean;
/**
* Optional thread identifier used to load or continue an existing conversation.
*/
threadId?: string;
}
/**
* The result object-type returned by the `useStructuredCompletion` hook that provides the structured output and state for the completion.
*
* @public
* @typeParam Output - The type of the output from the chat.
*/
export interface UseStructuredCompletionResult