import { M as Message, C as CreateMessage, U as UseChatOptions } from './types-f862f74a.js'; type UseChatHelpers = { /** Current messages in the chat */ messages: Message[]; /** The error object of the API request */ error: undefined | Error; /** * Append a user message to the chat list. This triggers the API call to fetch * the assistant's response. */ append: (message: Message | CreateMessage) => Promise; /** * Reload the last AI chat response for the given chat history. If the last * message isn't from the assistant, it will request the API to generate a * new response. */ reload: () => Promise; /** * Abort the current request immediately, keep the generated tokens if any. */ stop: () => void; /** * Update the `messages` state locally. This is useful when you want to * edit the messages on the client, and then trigger the `reload` method * manually to regenerate the AI response. */ setMessages: (messages: Message[]) => void; /** The current value of the input */ input: string; /** setState-powered method to update the input value */ setInput: React.Dispatch>; /** An input/textarea-ready onChange handler to control the value of the input */ handleInputChange: (e: any) => void; /** Form submission handler to automattically reset input and append a user message */ handleSubmit: (e: React.FormEvent) => void; /** Whether the API request is in progress */ isLoading: boolean; }; declare function useChat({ api, id, initialMessages, initialInput, sendExtraMessageFields, onResponse, onFinish, onError, headers, body }?: UseChatOptions): UseChatHelpers; export { CreateMessage, Message, UseChatHelpers, UseChatOptions, useChat };