fix bug with length function (#1257)

This commit is contained in:
Harrison Chase 2023-02-23 16:00:15 -08:00 committed by GitHub
parent 10e73a3723
commit 9381005098
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -250,7 +250,7 @@ class RecursiveCharacterTextSplitter(TextSplitter):
# Now go merging things, recursively splitting longer texts.
_good_splits = []
for s in splits:
if len(s) < self._chunk_size:
if self._length_function(s) < self._chunk_size:
_good_splits.append(s)
else:
if _good_splits: