service_context = ServiceContext.from_defaults(chunk_size=1024)
from llama_index import SimpleDirectoryReader, ServiceContext, VectorStoreIndex documents = SimpleDirectoryReader("./data").load_data() # here you can adjust the chunk size service_context = ServiceContext.from_defaults(chunk_size=1024) index = VectorStoreIndex.from_documents(documents, service_context=service_context)
SimpleNodeParser().get_nodes_from_documents(documents)
from_documents()
that transforms documents into nodes. The service context is just slightly modifying how it does that