UNPKG

@juspay/neurolink

Version:

Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applicatio

38 lines (37 loc) 1.4 kB
/** * Markdown Chunker * * Splits markdown content by headers and structural elements. * Preserves markdown tables by detecting table boundaries and splitting * on row boundaries when a table exceeds the max chunk size. */ import type { Chunk, ChunkerConfig, ChunkingStrategy } from "../../types/index.js"; import { BaseChunker } from "./BaseChunker.js"; /** * Markdown Chunker */ export declare class MarkdownChunker extends BaseChunker { readonly strategy: ChunkingStrategy; getDefaultConfig(): ChunkerConfig; protected doChunk(content: string, config: ChunkerConfig): Promise<Chunk[]>; /** * Split content while preserving markdown tables. * * Strategy: * 1. Identify table blocks in the content. * 2. Split content into segments: non-table text and table blocks. * 3. Non-table text is split using paragraph/sentence boundaries (existing logic). * 4. Tables that fit in a chunk are kept intact. * 5. Oversized tables are split on row boundaries, repeating the header row. */ private splitContentTableAware; /** * Split a table on row boundaries, repeating header + separator in each chunk. */ private splitTableByRows; /** * Split non-table text using paragraph and sentence boundaries. * This is the original splitContent logic extracted for reuse. */ private splitPlainContent; }