import { ChatMessage, AIProviderConfig, StreamEvent, TestConnectionResult } from '../types';
export declare abstract class BaseAIProvider {
    protected config: AIProviderConfig;
    constructor(config: AIProviderConfig);
    /**
     * 发送聊天消息（流式输出）
     */
    abstract chat(messages: ChatMessage[], onEvent: (event: StreamEvent) => void, signal?: AbortSignal): Promise<void>;
    /**
     * 测试连接
     */
    abstract testConnection(): Promise<TestConnectionResult>;
    /**
     * 验证配置
     */
    validateConfig(): boolean;
    /**
     * 更新配置
     */
    updateConfig(config: Partial<AIProviderConfig>): void;
    /**
     * 构建请求头
     */
    protected abstract buildHeaders(): Record<string, string>;
    /**
     * 构建请求体
     */
    protected abstract buildRequestBody(messages: ChatMessage[]): unknown;
    /**
     * 解析流式响应
     */
    protected abstract parseStreamChunk(chunk: string, onEvent: (event: StreamEvent) => void): void;
    /**
     * 生成消息ID
     */
    protected generateId(): string;
    /**
     * 格式化消息（移除不必要的字段）
     */
    protected formatMessages(messages: ChatMessage[]): Array<{
        role: string;
        content: string;
    }>;
    /**
     * 发起HTTP请求
     */
    protected makeRequest(url: string, body: unknown, headers: Record<string, string>, signal?: AbortSignal): Promise<Response>;
    /**
     * 读取流式响应
     */
    protected readStream(response: Response, _onEvent: (event: StreamEvent) => void, parseChunk: (chunk: string) => void): Promise<void>;
}
//# sourceMappingURL=base.d.ts.map