/**
 * Real Chat Service
 * Integrates with LLM Gateway and manages real chat conversations
 */
import { ChatMessage } from '../components/ai/AiChatInterface';
export interface ChatServiceConfig {
    apiBaseUrl: string;
    apiKey?: string;
    timeout: number;
    enableStreaming: boolean;
    defaultModel?: string;
}
export interface ModelInfo {
    id: string;
    name: string;
    provider: string;
    capabilities: string[];
    maxTokens: number;
    pricing?: {
        input: number;
        output: number;
    };
}
export interface ChatResponse {
    id: string;
    message: ChatMessage;
    usage?: {
        inputTokens: number;
        outputTokens: number;
        totalTokens: number;
        cost: number;
    };
    model: string;
    provider: string;
    finishReason: string;
}
export interface ConversationSession {
    id: string;
    title: string;
    messages: ChatMessage[];
    model: string;
    createdAt: Date;
    updatedAt: Date;
    metadata?: Record<string, any>;
}
export declare class ChatService {
    private config;
    private conversations;
    private currentConversationId;
    constructor(config?: Partial<ChatServiceConfig>);
    /**
     * Send a message to the AI model
     */
    sendMessage(content: string, model?: string, conversationId?: string): Promise<ChatResponse>;
    /**
     * Send a streaming message
     */
    sendStreamingMessage(content: string, model?: string, conversationId?: string): AsyncGenerator<{
        content: string;
        done: boolean;
    }, void, unknown>;
    /**
     * Get available models
     */
    getAvailableModels(): Promise<ModelInfo[]>;
    /**
     * Create a new conversation
     */
    createConversation(model: string, title?: string): string;
    /**
     * Get a conversation by ID
     */
    getConversation(id: string): ConversationSession | null;
    /**
     * Get all conversations
     */
    getAllConversations(): ConversationSession[];
    /**
     * Set current conversation
     */
    setCurrentConversation(id: string): void;
    /**
     * Delete a conversation
     */
    deleteConversation(id: string): boolean;
    /**
     * Clear all conversations
     */
    clearConversations(): void;
    /**
     * Export conversation to various formats
     */
    exportConversation(id: string, format?: 'json' | 'markdown' | 'txt'): string;
    /**
     * Get conversation statistics
     */
    getConversationStats(id: string): {
        messageCount: number;
        totalTokens: number;
        estimatedCost: number;
        duration: number;
    } | null;
    /**
     * Private helper methods
     */
    private addMessageToConversation;
    private generateId;
    private getProviderFromModel;
    private calculateCost;
    private calculateConversationCost;
    private getModelInputCost;
    private getModelOutputCost;
    private exportToMarkdown;
    private exportToText;
}
export declare const chatService: ChatService;
export default chatService;
//# sourceMappingURL=ChatService.d.ts.map