Merge pull request #1470 from danielaskdd/bug-fix

Minor bug fixes
This commit is contained in:
Daniel.y
2025-04-26 22:26:58 +08:00
committed by GitHub
3 changed files with 5 additions and 5 deletions

View File

@@ -103,7 +103,7 @@ class FaissVectorDBStorage(BaseVectorStorage):
... ...
} }
""" """
logger.info(f"Inserting {len(data)} to {self.namespace}") logger.debug(f"FAISS: Inserting {len(data)} to {self.namespace}")
if not data: if not data:
return return

View File

@@ -578,8 +578,7 @@ class PGVectorStorage(BaseVectorStorage):
"content": item["content"], "content": item["content"],
"content_vector": json.dumps(item["__vector__"].tolist()), "content_vector": json.dumps(item["__vector__"].tolist()),
"chunk_ids": chunk_ids, "chunk_ids": chunk_ids,
"file_path": item["file_path"], "file_path": item.get("file_path", None),
# TODO: add document_id
} }
return upsert_sql, data return upsert_sql, data
@@ -599,8 +598,7 @@ class PGVectorStorage(BaseVectorStorage):
"content": item["content"], "content": item["content"],
"content_vector": json.dumps(item["__vector__"].tolist()), "content_vector": json.dumps(item["__vector__"].tolist()),
"chunk_ids": chunk_ids, "chunk_ids": chunk_ids,
"file_path": item["file_path"], "file_path": item.get("file_path", None),
# TODO: add document_id
} }
return upsert_sql, data return upsert_sql, data

View File

@@ -502,6 +502,7 @@ async def acreate_entity(
"source_id": source_id, "source_id": source_id,
"description": description, "description": description,
"entity_type": entity_type, "entity_type": entity_type,
"file_path": entity_data.get("file_path", "manual_creation"),
} }
} }
@@ -607,6 +608,7 @@ async def acreate_relation(
"description": description, "description": description,
"keywords": keywords, "keywords": keywords,
"weight": weight, "weight": weight,
"file_path": relation_data.get("file_path", "manual_creation"),
} }
} }