import type { AIUsageInfo } from '../../types';
import type { StreamingCallback } from '../../types';
export declare class AIResponseParseError extends Error {
    usage?: AIUsageInfo;
    rawResponse: string;
    constructor(message: string, rawResponse: string, usage?: AIUsageInfo);
}
import { type IModelConfig, type TModelFamily } from '@midscene/shared/env';
import type { ChatCompletionMessageParam } from 'openai/resources/index';
import type { AIArgs } from '../../common';
export declare function callAI(messages: ChatCompletionMessageParam[], modelConfig: IModelConfig, options?: {
    stream?: boolean;
    onChunk?: StreamingCallback;
    abortSignal?: AbortSignal;
}): Promise<{
    content: string;
    reasoning_content?: string;
    usage?: AIUsageInfo;
    isStreamed: boolean;
}>;
export declare function callAIWithObjectResponse<T>(messages: ChatCompletionMessageParam[], modelConfig: IModelConfig, options?: {
    abortSignal?: AbortSignal;
}): Promise<{
    content: T;
    contentString: string;
    usage?: AIUsageInfo;
    reasoning_content?: string;
}>;
export declare function callAIWithStringResponse(msgs: AIArgs, modelConfig: IModelConfig, options?: {
    abortSignal?: AbortSignal;
}): Promise<{
    content: string;
    usage?: AIUsageInfo;
}>;
export declare function extractJSONFromCodeBlock(response: string): string;
export declare function preprocessDoubaoBboxJson(input: string): string;
export declare function resolveReasoningConfig({ reasoningEnabled, reasoningEffort, reasoningBudget, modelFamily, }: {
    reasoningEnabled?: boolean;
    reasoningEffort?: string;
    reasoningBudget?: number;
    modelFamily?: TModelFamily;
}): {
    config: Record<string, unknown>;
    debugMessage?: string;
};
export declare function safeParseJson(input: string, modelFamily: TModelFamily | undefined): any;
