import { RateLimitError, TransientError, QuotaExhaustedError, AuthError, FatalError, AIMessage, AIRequest, AIContentBlock } from './index.js';

type AnthropicCreds = {
    apiKey: string;
    baseUrl?: string;
    fetch?: typeof fetch;
};
type AnthropicMessage = {
    role: 'user' | 'assistant';
    content: string | Array<{
        type: string;
        text?: string;
        source?: unknown;
    }>;
};
type AnthropicResponse = {
    model: string;
    content: Array<{
        type: string;
        text?: string;
    }>;
    stop_reason: string | null;
    usage: {
        input_tokens: number;
        output_tokens: number;
    };
};
declare function extractAnthropicSystem(messages: AIMessage[]): string | undefined;
declare function mapMessagesToAnthropic(messages: AIMessage[]): AnthropicMessage[];
declare function mapContentToAnthropic(content: string | AIContentBlock[]): string | Array<{
    type: string;
    text?: string;
    source?: unknown;
}>;
declare function mapAnthropicResponse(body: AnthropicResponse, provider: string, model: string): {
    content: string;
    model: string;
    provider: string;
    usage: {
        promptTokens: number;
        completionTokens: number;
    };
    finishReason: string | undefined;
};
declare function classifyAnthropicError(status: number, message: string, provider: string): RateLimitError | TransientError | QuotaExhaustedError | AuthError | FatalError;
declare function makeAnthropicAdapter(creds: AnthropicCreds): {
    provider: string;
    supportsImage: boolean;
    call(req: AIRequest): Promise<{
        content: string;
        model: string;
        provider: string;
        usage: {
            promptTokens: number;
            completionTokens: number;
        };
        finishReason: string | undefined;
    }>;
};

export { type AnthropicCreds, classifyAnthropicError, extractAnthropicSystem, makeAnthropicAdapter, mapAnthropicResponse, mapContentToAnthropic, mapMessagesToAnthropic };
