interface CompletionCallback { (data: { token: string; completed: boolean; }): void; } interface ILLM { readonly instance: Instance; load(config: LoadConfig): Promise; createCompletion(params: LLMInferenceArguments, callback: CompletionCallback, abortSignal?: AbortSignal): Promise; getEmbedding?(params: LLMEmbeddingArguments): Promise; getDefaultEmbedding?(text: string): Promise; tokenize?(content: LLMTokenizeArguments): Promise; } interface LLMResult { tokens: string[]; completed: boolean; } declare enum LLMErrorType { Aborted = "Aborted", Generic = "Generic" } declare class LLMError extends Error { readonly tokens: string[]; readonly completed: boolean; readonly type: LLMErrorType; constructor({ message, tokens, completed, type, }: { message: string; tokens: string[]; completed: boolean; type: LLMErrorType; }); } export { CompletionCallback, ILLM, LLMError, LLMErrorType, LLMResult };