The community member is encountering a TypeError when trying to create a VectorStoreIndex from a set of nodes. The error suggests that the nodes parameter is not a list, but rather a dict_values object, which is not subscriptable. Several community members suggest that the issue is not related to the number of documents, but rather a type issue with the nodes parameter. The solution provided is to explicitly convert the nodes to a list using list(nodes) before passing it to the VectorStoreIndex constructor.
File ~/anaconda3/lib/python3.9/site-packages/llama_index/indices/base.py:51, in BaseIndex.init(self, nodes, index_struct, storage_context, service_context, show_progress, **kwargs) 49 raise ValueError("Only one of nodes or index_struct can be provided.") 50 # This is to explicitly make sure that the old UX is not used ---> 51 if nodes is not None and len(nodes) >= 1 and not isinstance(nodes[0], BaseNode): 52 if isinstance(nodes[0], Document): 53 raise ValueError( 54 "The constructor now takes in a list of Node objects. " 55 "Since you are passing in a list of Document objects, " 56 "please use from_documents instead." 57 )
TypeError: 'dict_values' object is not subscriptable