/** * Chat Service * * Handles API interactions for the LLM Chat feature including * sending messages, retrieving history, and clearing history. * * @module services/chatService */ import type { ChatRequest, ChatResponse, ChatHistoryMessage } from '../types/chat.js'; /** * Chat Service class * * Provides methods to interact with the chat API endpoints * for LLM-powered workflow building assistance. */ export declare class ChatService { private static instance; private constructor(); /** * Get the singleton instance of ChatService * * @returns The ChatService singleton instance */ static getInstance(): ChatService; /** * Get the endpoint configuration * * @throws Error if endpoint configuration is not set * @returns The endpoint configuration */ private getConfig; /** * Generic API request helper * * @param url - The URL to fetch * @param options - Fetch options * @returns The parsed JSON response */ private request; /** * Send a message to the chat endpoint * * @param workflowId - The workflow ID * @param request - The chat request payload * @returns The chat response from the LLM */ sendMessage(workflowId: string, request: ChatRequest): Promise; /** * Get conversation history for a workflow * * @param workflowId - The workflow ID * @returns Array of chat history messages */ getHistory(workflowId: string): Promise; /** * Clear conversation history for a workflow * * @param workflowId - The workflow ID */ clearHistory(workflowId: string): Promise; } /** * Pre-instantiated ChatService singleton */ export declare const chatService: ChatService;