The agent engineering platform.
Python agentsaiai-agentsanthropicchatgptdeepagentsenterpriseframeworkgeminigenerative-ailangchainlanggraphllmmultiagentopen-sourceopenaipydanticpythonragtypescript
fix bug with length function (#1257)
Harrison Chase938100509817
diff --git a/langchain/text_splitter.py b/langchain/text_splitter.pyindex 76f82f14e7..6012b8389a 100644--- a/langchain/text_splitter.py+++ b/langchain/text_splitter.py@@ -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: