@@ -952,11 +952,11 @@ async def _insert_done(self) -> None:
952
952
pipeline_status ["latest_message" ] = log_message
953
953
pipeline_status ["history_messages" ].append (log_message )
954
954
955
- def insert_custom_kg (self , custom_kg : dict [str , Any ]) -> None :
955
+ def insert_custom_kg (self , custom_kg : dict [str , Any ], full_doc_id : str = None ) -> None :
956
956
loop = always_get_an_event_loop ()
957
- loop .run_until_complete (self .ainsert_custom_kg (custom_kg ))
957
+ loop .run_until_complete (self .ainsert_custom_kg (custom_kg , full_doc_id ))
958
958
959
- async def ainsert_custom_kg (self , custom_kg : dict [str , Any ]) -> None :
959
+ async def ainsert_custom_kg (self , custom_kg : dict [str , Any ], full_doc_id : str = None ) -> None :
960
960
update_storage = False
961
961
try :
962
962
# Insert chunks into vector storage
@@ -982,7 +982,7 @@ async def ainsert_custom_kg(self, custom_kg: dict[str, Any]) -> None:
982
982
"source_id" : source_id ,
983
983
"tokens" : tokens ,
984
984
"chunk_order_index" : chunk_order_index ,
985
- "full_doc_id" : source_id ,
985
+ "full_doc_id" : full_doc_id if full_doc_id is not None else source_id ,
986
986
"status" : DocStatus .PROCESSED ,
987
987
}
988
988
all_chunks_data [chunk_id ] = chunk_entry
0 commit comments