@yk1028-test/ai-chat-supporter
Version:
AI Chat Supporter - TypeScript library for intelligent chat processing with LangChain integration
58 lines • 1.95 kB
TypeScript
import { Document as LangChainDocument } from "@langchain/core/documents";
export interface Document {
id: string;
title: string;
content: string;
filePath: string;
metadata: Record<string, any>;
lastModified: Date;
}
export interface LangChainRAGConfig {
chunkSize?: number;
chunkOverlap?: number;
maxDocuments?: number;
similarityThreshold?: number;
}
export interface IDocumentProcessor {
supportedExtensions: string[];
process(filePath: string): Promise<Document>;
}
export declare class TextDocumentProcessor implements IDocumentProcessor {
readonly supportedExtensions: string[];
process(filePath: string): Promise<Document>;
private generateId;
}
export declare class SimpleTextSplitter {
private chunkSize;
private chunkOverlap;
constructor(options: {
chunkSize: number;
chunkOverlap: number;
});
splitText(text: string): string[];
}
export declare class SimpleDocumentStore {
private documents;
addDocuments(documents: LangChainDocument[]): Promise<void>;
searchSimilar(query: string, k?: number): Promise<LangChainDocument[]>;
getDocumentCount(): number;
}
export declare class LangChainRAGManager {
private documentStore;
private textSplitter;
private processors;
private config;
constructor(config?: LangChainRAGConfig);
registerProcessor(processor: IDocumentProcessor): void;
addDocument(filePath: string): Promise<Document>;
addDocuments(filePaths: string[]): Promise<Document[]>;
addTextDocument(text: string, metadata?: Record<string, any>): Promise<void>;
buildContext(query: string, maxResults?: number): Promise<string[]>;
updateConfig(newConfig: Partial<LangChainRAGConfig>): void;
getSupportedExtensions(): string[];
getStats(): Promise<{
documentsCount: number;
supportedExtensions: string[];
}>;
}
//# sourceMappingURL=LangChainRAGManager.d.ts.map