(content: string)
| 127 | } |
| 128 | |
| 129 | async chunk(content: string): Promise<Chunk[]> { |
| 130 | if (!content?.trim()) { |
| 131 | return [] |
| 132 | } |
| 133 | |
| 134 | const cleaned = cleanText(content) |
| 135 | let chunks = this.splitRecursively(cleaned) |
| 136 | |
| 137 | if (this.chunkOverlap > 0) { |
| 138 | const overlapChars = tokensToChars(this.chunkOverlap) |
| 139 | chunks = addOverlap(chunks, overlapChars) |
| 140 | } |
| 141 | |
| 142 | logger.info(`Chunked into ${chunks.length} recursive chunks`) |
| 143 | return buildChunks(chunks, this.chunkOverlap) |
| 144 | } |
| 145 | } |
nothing calls this directly
no test coverage detected