export interface OpenAiToolCall {
    id: string;
    type: "function";
    function: {
        name: string;
        arguments: string;
    };
}
export interface OpenAiChatToolCallRef {
    id?: string;
    function?: {
        name?: string;
        arguments?: string;
    };
    name?: string;
    [key: string]: unknown;
}
export interface OpenAiChatMessageLike {
    role: string;
    content?: unknown;
    tool_calls?: OpenAiChatToolCallRef[];
    tool_call_id?: string;
    [key: string]: unknown;
}
export interface OpenAiResponsesItemLike {
    type: string;
    id?: string;
    call_id?: string;
    role?: string;
    content?: unknown;
    status?: string;
    [key: string]: unknown;
}
export interface ConversationRepairOptions {
    stopReason?: string;
    placeholderToolResult?: string;
    placeholderFunctionCallOutput?: string;
    forcedStopReasons?: readonly string[];
}
type ContentPart = {
    type: string;
    text?: string;
    [key: string]: unknown;
};
export type { ContentPart };
export declare function sanitizeOpenAiChatMessages<T extends OpenAiChatMessageLike>(messages: readonly T[]): T[];
export declare function ensureAssistantReasoningContent<T extends Record<string, unknown>>(messages: readonly T[], defaultValue?: string): T[];
export declare function stripForcedStopAssistantToolMetadata<T extends OpenAiChatMessageLike>(messages: readonly T[], options?: ConversationRepairOptions): T[];
export declare function injectDanglingToolCallPlaceholders<T extends OpenAiChatMessageLike>(messages: readonly T[], options?: ConversationRepairOptions): T[];
export declare function repairOpenAiChatConversation<T extends OpenAiChatMessageLike>(messages: readonly T[], options?: ConversationRepairOptions): T[];
export declare function downgradeOpenAiFunctionCallReasoningPairs<T extends {
    role?: unknown;
    content?: unknown;
    toolCallId?: unknown;
    toolUseId?: unknown;
}>(messages: readonly T[]): T[];
export declare function downgradeOpenAiReasoningBlocks<T extends {
    role?: unknown;
    content?: unknown;
}>(messages: readonly T[]): T[];
export declare function repairOpenAiResponsesItems<T extends OpenAiResponsesItemLike>(items: readonly T[], options?: ConversationRepairOptions): T[];
