Traceback (most recent call last): File "/home/shawn/llamaindex/2_read_documents_from_db.py", line 21, in <module> index = VectorStoreIndex.from_documents( File "/home/shawn/llamaindex/venv/lib/python3.10/site-packages/llama_index/core/indices/base.py", line 136, in from_documents docstore.set_document_hash(doc.get_doc_id(), doc.hash) AttributeError: 'tuple' object has no attribute 'get_doc_id'
import chromadb from llama_index.core import VectorStoreIndex from llama_index.vector_stores.chroma import ChromaVectorStore from llama_index.core import StorageContext # initialize client, setting path to save data db = chromadb.PersistentClient(path="./talents_db") # create collection chroma_collection = db.get_or_create_collection("business_analyst") # assign chroma as the vector_store to the context vector_store = ChromaVectorStore(chroma_collection=chroma_collection) storage_context = StorageContext.from_defaults(vector_store=vector_store) # create your index index = VectorStoreIndex.from_documents( vector_store, storage_context=storage_context ) # create a query engine and query query_engine = index.as_query_engine() response = query_engine.query("What are the main steps for requirements engineering?") print(response)