import { CoreAssistantMessage as AICoreAssistantMessage, CoreSystemMessage as AICoreSystemMessage, CoreToolMessage as AICoreToolMessage, CoreUserMessage as AICoreUserMessage, UserContent } from 'ai';
import { MaybeRefOrGetter } from 'vue';

export interface CoreErrorMessage extends AICoreAssistantMessage {
    error?: string;
}
export interface CoreWarnMessage extends AICoreAssistantMessage {
    warn?: string;
}
export interface CoreUserModifyMessage {
    role: 'user';
    content: UserContent;
    code: string;
    selection: {
        sourceFile?: string;
        targetLine?: number;
        targetColumn?: number;
    };
}
export type CoreAssistantMessage = AICoreAssistantMessage & CoreErrorMessage & CoreWarnMessage;
export type CoreUserMessage = AICoreUserMessage | CoreUserModifyMessage;
export type CoreSystemMessage = AICoreSystemMessage;
export type CoreToolMessage = AICoreToolMessage;
export type CoreMessage = CoreSystemMessage | CoreUserMessage | CoreAssistantMessage | CoreToolMessage;
interface UseLazyLLMConfig {
    baseUrl?: string;
    authorizationBearerToken?: string;
    initialMessages?: MaybeRefOrGetter<CoreMessage[]>;
}
export interface UseLazyLLMInitConfig {
    baseUrl?: string;
    authorizationBearerToken?: string;
}
declare enum ErrorType {
    Unknown = 0,
    Network = 1,
    BackendAPI = 2,
    Abort = 3
}
export declare function handleFetchError(err: any): {
    type: ErrorType;
    title: string;
    message: string;
    source?: {
        pointer: string;
    };
    id?: string;
    rawError: any;
};
export declare function useLazyChat(config: UseLazyLLMConfig): {
    initially: import('vue').Ref<boolean>;
    messages: import('vue').ComputedRef<CoreMessage[]>;
    isLoading: import('vue').Ref<boolean | undefined>;
    isError: import('vue').Ref<boolean>;
    streamingMessage: import('vue').Ref<{
        role: "assistant";
        content: string | ({
            type: "text";
            text: string;
        } | {
            type: "tool-call";
            toolCallId: string;
            toolName: string;
            args: unknown;
        })[];
        error?: string | undefined;
        warn?: string | undefined;
    }>;
    chatScope: import('vue').EffectScope;
    currentModel: import('@vueuse/core').RemovableRef<string>;
    init: (initConfig?: UseLazyLLMInitConfig) => void;
    stop: () => void;
    append: (message: CoreMessage) => void;
    abort: () => void;
    regenerate: () => void;
    onStreamFinished: (fn: (message: CoreAssistantMessage) => Promise<void>) => void;
};
export declare const useLazyChatInstance: () => {
    initially: import('vue').Ref<boolean>;
    messages: import('vue').ComputedRef<CoreMessage[]>;
    isLoading: import('vue').Ref<boolean | undefined>;
    isError: import('vue').Ref<boolean>;
    streamingMessage: import('vue').Ref<{
        role: "assistant";
        content: string | ({
            type: "text";
            text: string;
        } | {
            type: "tool-call";
            toolCallId: string;
            toolName: string;
            args: unknown;
        })[];
        error?: string | undefined;
        warn?: string | undefined;
    }>;
    chatScope: import('vue').EffectScope;
    currentModel: import('@vueuse/core').RemovableRef<string>;
    init: (initConfig?: UseLazyLLMInitConfig) => void;
    stop: () => void;
    append: (message: CoreMessage) => void;
    abort: () => void;
    regenerate: () => void;
    onStreamFinished: (fn: (message: CoreAssistantMessage) => Promise<void>) => void;
};
export {};
