@restnfeel/agentc-starter-kit
Version:
한국어 기업용 CMS 모듈 - Task Master AI와 함께 빠르게 웹사이트를 구현할 수 있는 재사용 가능한 컴포넌트 시스템
85 lines • 2.68 kB
TypeScript
/**
* @fileoverview Unified API wrapper for the RAG chatbot system
* @module core/api/ChatbotAPI
*/
import type { ChatbotConfig, Document, ConversationMessage, LLMConfig, VectorStoreConfig, StorageConfig, ChatbotError } from "../contexts/ChatbotContext";
import type { ApiResponse, InitializationOptions, SearchOptions, FileUploadConstraints } from "../../types/api";
/**
* Extended configuration interface for API initialization
*/
export interface ChatbotAPIConfig extends Partial<ChatbotConfig> {
vectorStore?: VectorStoreConfig;
llm?: LLMConfig;
storage?: StorageConfig;
}
/**
* Unified API class for the RAG chatbot system
* Provides a clean, consistent interface for all chatbot operations
*/
export declare class ChatbotAPI {
private initialized;
private config;
private errorHandlers;
/**
* Initialize the chatbot system
*/
initialize(config: ChatbotAPIConfig, options?: InitializationOptions): Promise<ApiResponse<void>>;
/**
* Reset the chatbot system
*/
reset(): Promise<ApiResponse<void>>;
/**
* Send a message and get response
*/
sendMessage(content: string, conversationId: string, options?: {
useRAG?: boolean;
context?: any;
}): Promise<ApiResponse<ConversationMessage>>;
/**
* Upload documents to the knowledge base
*/
uploadDocuments(files: File[], constraints?: FileUploadConstraints, onProgress?: (progress: number) => void): Promise<ApiResponse<Document[]>>;
/**
* Search documents in the knowledge base
*/
searchDocuments(query: string, options?: SearchOptions): Promise<ApiResponse<Document[]>>;
/**
* Get system health status
*/
getHealthStatus(): Promise<ApiResponse<any>>;
/**
* Add error handler
*/
onError(handler: (error: ChatbotError) => void): () => void;
/**
* Get current configuration
*/
getConfig(): ChatbotAPIConfig | null;
/**
* Check if system is initialized
*/
isInitialized(): boolean;
private ensureInitialized;
private validateConfig;
private validateFiles;
private createError;
private handleError;
private generateId;
private initializeVectorStore;
private initializeLLM;
private initializeStorage;
private resetVectorStore;
private resetLLM;
private resetStorage;
private processRAGMessage;
private processDirectMessage;
private processFileUpload;
private performSearch;
private checkSystemHealth;
}
/**
* Default singleton instance
*/
export declare const chatbotAPI: ChatbotAPI;
export default ChatbotAPI;
//# sourceMappingURL=ChatbotAPI.d.ts.map