UNPKG

@forge-ml/rag

Version:

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

21 lines (20 loc) 598 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; }) => Chunk[]; export default chunkText;