-
Notifications
You must be signed in to change notification settings - Fork 6.4k
Closed
Labels
bugSomething isn't workingSomething isn't workingtriageIssue needs to be triaged/prioritizedIssue needs to be triaged/prioritized
Description
Bug Description
In operations adelete_document or async_add_documents, RefDocInfo is initialised by unpacking ref_doc_info_dict. This results in an exception, if there are additional fields. The expected behaviour is the ignorance of the additional fields. For this, one could from_dict instead to initialise RefDocInfo by unpacking and using a constructore.
This is needed when there are additional fields added for other purposes like time to live policies on nodes and ref docs.
adelete_document :
File "/usr/local/lib/python3.12/site-packages/llama_index/core/storage/docstore/keyval_docstore.py", line 542, in adelete_document
_, delete_success, _ = await asyncio.gather(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/llama_index/core/storage/docstore/keyval_docstore.py", line 508, in _aremove_from_ref_doc_node
ref_doc_id, ref_doc_info = await asyncio.gather(
^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/llama_index/core/storage/docstore/keyval_docstore.py", line 415, in aget_ref_doc_info
return self._remove_legacy_info(ref_doc_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/llama_index/core/storage/docstore/keyval_docstore.py", line 393, in _remove_legacy_info
return RefDocInfo(**ref_doc_info_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: RefDocInfo.__init__() got an unexpected keyword argument 'time_to_live'
async_add_documents:
File "/usr/local/lib/python3.12/site-packages/llama_index/core/storage/docstore/keyval_docstore.py", line 329, in async_add_documents
) = await self._async_prepare_kv_pairs(docs, allow_update, store_text)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/llama_index/core/storage/docstore/keyval_docstore.py", line 284, in _async_prepare_kv_pairs
await self.aget_ref_doc_info(node.ref_doc_id) or RefDocInfo()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/llama_index/core/storage/docstore/keyval_docstore.py", line 415, in aget_ref_doc_info
return self._remove_legacy_info(ref_doc_info)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/llama_index/core/storage/docstore/keyval_docstore.py", line 393, in _remove_legacy_info
return RefDocInfo(**ref_doc_info_dict)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: RefDocInfo.__init__() got an unexpected keyword argument 'time_to_live'
Version
0.12.44
Steps to Reproduce
- Add docs to a vector store with document store capabilities, e.g., firestore
- Add one additional field to all added documents, e.g., time_to_live
- Try to delete or update the documents with docstore.adelete_document or docstore.async_add_documents
Relevant Logs/Tracbacks
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingtriageIssue needs to be triaged/prioritizedIssue needs to be triaged/prioritized