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

export interface CoreExtraBodyMessage {
    extraBody?: any;
}
export interface CoreErrorMessage extends AICoreAssistantMessage {
    error?: string;
}
export interface CoreWarnMessage extends AICoreAssistantMessage {
    warn?: string;
}
export type CoreAssistantMessage = AICoreAssistantMessage & CoreErrorMessage & CoreWarnMessage & CoreExtraBodyMessage;
export type CoreUserMessage = AICoreUserMessage & CoreExtraBodyMessage;
export type CoreSystemMessage = AICoreSystemMessage & CoreExtraBodyMessage;
export type CoreToolMessage = AICoreToolMessage & CoreExtraBodyMessage;
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
}
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;
        extraBody?: any;
    }>;
    init: (initConfig?: UseLazyLLMInitConfig) => void;
    append: (message: CoreMessage, options?: {
        requirement: string;
        extraBody?: {
            sourceFile?: string;
            targetLine?: number;
            targetColumn?: number;
        };
    }) => void;
    abort: () => void;
    regenerate: () => void;
    onStreamFinished: (fn: (message: CoreAssistantMessage) => Promise<void>) => void;
};
export {};
