/**
 * useStreamingResponse Hook - Real-time streaming AI responses
 * Features: Server-sent events, backpressure handling, response reconstruction
 */
import type { Message } from '../components/ai-native/AIConversationCanvas';
export interface StreamingRequest {
    messages: Message[];
    provider: string;
    model: string;
    temperature?: number;
    maxTokens?: number;
    stream?: boolean;
    stopSequences?: string[];
    metadata?: Record<string, any>;
}
export interface StreamingChunk {
    id: string;
    object: 'chat.completion.chunk';
    created: number;
    model: string;
    choices: Array<{
        index: number;
        delta: {
            role?: string;
            content?: string;
            function_call?: {
                name?: string;
                arguments?: string;
            };
        };
        finish_reason?: 'stop' | 'length' | 'function_call' | 'content_filter' | null;
    }>;
    usage?: {
        prompt_tokens: number;
        completion_tokens: number;
        total_tokens: number;
    };
}
export interface UseStreamingResponseOptions {
    apiUrl?: string;
    enableBackpressure?: boolean;
    maxConcurrentStreams?: number;
    bufferSize?: number;
    retryAttempts?: number;
    retryDelay?: number;
    onChunkReceived?: (chunk: StreamingChunk) => void;
    onStreamComplete?: (fullResponse: string, metadata: Record<string, any>) => void;
    onStreamError?: (error: Error) => void;
    onConnectionStatusChange?: (status: 'connecting' | 'connected' | 'disconnected' | 'error') => void;
}
export interface UseStreamingResponseReturn {
    streamingMessage: string;
    isStreaming: boolean;
    streamProgress: number;
    connectionStatus: 'connecting' | 'connected' | 'disconnected' | 'error';
    activeStreams: number;
    latency: number;
    tokensPerSecond: number;
    streamResponse: (request: StreamingRequest) => Promise<Message>;
    abortStream: () => void;
    pauseStream: () => void;
    resumeStream: () => void;
    getStreamStats: () => StreamStats;
}
export interface StreamStats {
    totalStreams: number;
    successfulStreams: number;
    failedStreams: number;
    avgLatency: number;
    avgTokensPerSecond: number;
    totalTokensStreamed: number;
    totalBytesReceived: number;
    uptime: number;
}
export declare const useStreamingResponse: ({ apiUrl, enableBackpressure, maxConcurrentStreams, bufferSize, retryAttempts, retryDelay, onChunkReceived, onStreamComplete, onStreamError, onConnectionStatusChange }?: UseStreamingResponseOptions) => UseStreamingResponseReturn;
export default useStreamingResponse;
//# sourceMappingURL=useStreamingResponse.d.ts.map