Hello Community, today I am trying to refresh my vector index and I'm following this tutorial
https://docs.llamaindex.ai/en/stable/module_guides/indexing/document_management.html# . However, it happened TypeError as the screenshot 1. I understood that keyword argument 'delete_from_docstore' is duplicated in delete_ref_doc() function. I was trying to go to base llama_index/indices/base.py and commented out delete_from_docstore=True as the screenshot 2. And then, it happened KeyError error as screenshot 3, but I dont understand why it refers to def delete(self, doc_id: str) , and I can't find def delete(self, doc_id: str) in base.py, I only see delete_ref_doc function there. What should I do now, guys? Please help me. Thank you.
documents = SimpleDirectoryReader(input_dir="sleep", filename_as_id=True).load_data()
print(f"No of documents: {len(documents)}")
# rebuild storage context
storage_context = StorageContext.from_defaults(persist_dir="storage/sleep")
# load index from storage
index = load_index_from_storage(storage_context=storage_context)
print("Successfully load index from storage!")
# refresh the index
refreshed_docs = index.refresh_ref_docs(documents=documents, update_kwargs={"delete_kwargs": {"delete_from_docstore": True}})
print(refreshed_docs) # true values indicate that the value were refreshed
print(f"No of inserted/refreshed documents: {sum(refreshed_docs)}")