Fix recursive split producing repeating chunks

This commit is contained in:
Cohee 2024-04-20 01:29:43 +03:00
parent 2a2a63c52c
commit d93379fbd4
1 changed files with 1 additions and 1 deletions

View File

@ -690,7 +690,7 @@ export function splitRecursive(input, length, delimiters = ['\n\n', '\n', ' ', '
const flatParts = parts.flatMap(p => {
if (p.length < length) return p;
return splitRecursive(input, length, delimiters.slice(1));
return splitRecursive(p, length, delimiters.slice(1));
});
// Merge short chunks