@@ -237,7 +237,7 @@ def insert(self, document: Document, **insert_kwargs: Any) -> None:
237
237
)
238
238
239
239
self .insert_nodes (nodes , ** insert_kwargs )
240
- self .docstore .set_document_hash (document .get_doc_id () , document .hash )
240
+ self .docstore .set_document_hash (document .id_ , document .hash )
241
241
242
242
async def ainsert (self , document : Document , ** insert_kwargs : Any ) -> None :
243
243
"""Asynchronously insert a document."""
@@ -250,7 +250,7 @@ async def ainsert(self, document: Document, **insert_kwargs: Any) -> None:
250
250
)
251
251
252
252
await self .ainsert_nodes (nodes , ** insert_kwargs )
253
- await self .docstore .aset_document_hash (document .get_doc_id () , document .hash )
253
+ await self .docstore .aset_document_hash (document .id_ , document .hash )
254
254
255
255
@abstractmethod
256
256
def _delete_node (self , node_id : str , ** delete_kwargs : Any ) -> None :
@@ -383,7 +383,7 @@ def update_ref_doc(self, document: Document, **update_kwargs: Any) -> None:
383
383
"""
384
384
with self ._callback_manager .as_trace ("update_ref_doc" ):
385
385
self .delete_ref_doc (
386
- document .get_doc_id () ,
386
+ document .id_ ,
387
387
delete_from_docstore = True ,
388
388
** update_kwargs .pop ("delete_kwargs" , {}),
389
389
)
@@ -403,7 +403,7 @@ async def aupdate_ref_doc(self, document: Document, **update_kwargs: Any) -> Non
403
403
"""
404
404
with self ._callback_manager .as_trace ("aupdate_ref_doc" ):
405
405
await self .adelete_ref_doc (
406
- document .get_doc_id () ,
406
+ document .id_ ,
407
407
delete_from_docstore = True ,
408
408
** update_kwargs .pop ("delete_kwargs" , {}),
409
409
)
@@ -439,9 +439,7 @@ def refresh_ref_docs(
439
439
with self ._callback_manager .as_trace ("refresh_ref_docs" ):
440
440
refreshed_documents = [False ] * len (documents )
441
441
for i , document in enumerate (documents ):
442
- existing_doc_hash = self ._docstore .get_document_hash (
443
- document .get_doc_id ()
444
- )
442
+ existing_doc_hash = self ._docstore .get_document_hash (document .id_ )
445
443
if existing_doc_hash is None :
446
444
self .insert (document , ** update_kwargs .pop ("insert_kwargs" , {}))
447
445
refreshed_documents [i ] = True
@@ -467,7 +465,7 @@ async def arefresh_ref_docs(
467
465
refreshed_documents = [False ] * len (documents )
468
466
for i , document in enumerate (documents ):
469
467
existing_doc_hash = await self ._docstore .aget_document_hash (
470
- document .get_doc_id ()
468
+ document .id_
471
469
)
472
470
if existing_doc_hash is None :
473
471
await self .ainsert (
0 commit comments