UNPKG

@forge-ml/rag

Version:

A RAG (Retrieval-Augmented Generation) package for Forge ML

22 lines (21 loc) 619 B
import { Chunk, ChunkingStrategy, DocumentClass } from "../types"; /** * TODO: * - [ ] Fix chunking strategies * - [ ] Generate unique document IDs and chunk IDs * - [ ] Actually add metadata to chunks */ /** * Splits text into chunks suitable for RAG. * @param text The input text to be chunked. * @param options Chunking options. * @returns An array of Chunk objects. */ declare const chunkText: (document: DocumentClass, options?: { strategy?: ChunkingStrategy; delimiter?: string; chunkSize?: number; chunkOverlap?: number; wordCount?: number; }) => Chunk[]; export default chunkText;