import { Readable, Writable } from 'svelte/store'; import { a as UseCompletionOptions } from './types-f862f74a.js'; type UseCompletionHelpers = { /** The current completion result */ completion: Readable; /** The error object of the API request */ error: Readable; /** * Send a new prompt to the API endpoint and update the completion state. */ complete: (prompt: string) => Promise; /** * Abort the current API request but keep the generated tokens. */ stop: () => void; /** * Update the `completion` state locally. */ setCompletion: (completion: string) => void; /** The current value of the input */ input: Writable; /** * Form submission handler to automattically reset input and append a user message * @example * ```jsx *
* *
* ``` */ handleSubmit: (e: any) => void; /** Whether the API request is in progress */ isLoading: Writable; }; declare function useCompletion({ api, id, initialCompletion, initialInput, headers, body, onResponse, onFinish, onError }?: UseCompletionOptions): UseCompletionHelpers; export { UseCompletionHelpers, useCompletion };