from langchain.text_splitter import RecursiveCharacterTextSplitter from llama_index.node_parser import LangchainNodeParser python_splitter = RecursiveCharacterTextSplitter.from_language( 'python', chunk_size=50, chunk_overlap=0 ) parser = LangchainNodeParser(python_splitter) nodes = parser.get_nodes_from_documents(documents)