diff --git a/lightrag/kg/json_doc_status_impl.py b/lightrag/kg/json_doc_status_impl.py index aecb8713..404dc260 100644 --- a/lightrag/kg/json_doc_status_impl.py +++ b/lightrag/kg/json_doc_status_impl.py @@ -95,6 +95,8 @@ class JsonDocStatusStorage(DocStatusStorage): try: # Make a copy of the data to avoid modifying the original data = v.copy() + # Remove deprecated content field if it exists + data.pop("content", None) # If file_path is not in data, use document id as file path if "file_path" not in data: data["file_path"] = "no-file-path" @@ -120,6 +122,8 @@ class JsonDocStatusStorage(DocStatusStorage): try: # Make a copy of the data to avoid modifying the original data = v.copy() + # Remove deprecated content field if it exists + data.pop("content", None) # If file_path is not in data, use document id as file path if "file_path" not in data: data["file_path"] = "no-file-path" diff --git a/lightrag/kg/mongo_impl.py b/lightrag/kg/mongo_impl.py index f15576a9..1f9ce5e1 100644 --- a/lightrag/kg/mongo_impl.py +++ b/lightrag/kg/mongo_impl.py @@ -381,6 +381,8 @@ class MongoDocStatusStorage(DocStatusStorage): try: # Make a copy of the data to avoid modifying the original data = doc.copy() + # Remove deprecated content field if it exists + data.pop("content", None) # If file_path is not in data, use document id as file path if "file_path" not in data: data["file_path"] = "no-file-path" @@ -406,6 +408,8 @@ class MongoDocStatusStorage(DocStatusStorage): try: # Make a copy of the data to avoid modifying the original data = doc.copy() + # Remove deprecated content field if it exists + data.pop("content", None) # If file_path is not in data, use document id as file path if "file_path" not in data: data["file_path"] = "no-file-path" diff --git a/lightrag/kg/redis_impl.py b/lightrag/kg/redis_impl.py index e5a59c80..536f1a85 100644 --- a/lightrag/kg/redis_impl.py +++ b/lightrag/kg/redis_impl.py @@ -786,6 +786,8 @@ class RedisDocStatusStorage(DocStatusStorage): # Make a copy of the data to avoid modifying the original data = doc_data.copy() + # Remove deprecated content field if it exists + data.pop("content", None) # If file_path is not in data, use document id as file path if "file_path" not in data: data["file_path"] = "no-file-path" @@ -840,6 +842,8 @@ class RedisDocStatusStorage(DocStatusStorage): # Make a copy of the data to avoid modifying the original data = doc_data.copy() + # Remove deprecated content field if it exists + data.pop("content", None) # If file_path is not in data, use document id as file path if "file_path" not in data: data["file_path"] = "no-file-path"