summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustaf Rydholm <gustaf.rydholm@gmail.com>2024-04-06 01:55:13 +0200
committerGustaf Rydholm <gustaf.rydholm@gmail.com>2024-04-06 01:55:13 +0200
commit69c65c3fe53486c813540f28f5306554fd6911d2 (patch)
treea124f65ede2eb71882d9289462943bf059c30b62
parent3077bfdff3587aac5ef91a8fb5730c11c8bb5273 (diff)
Update log messages
-rw-r--r--rag/db/document.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/rag/db/document.py b/rag/db/document.py
index f8c97c2..72e3c66 100644
--- a/rag/db/document.py
+++ b/rag/db/document.py
@@ -29,12 +29,11 @@ class DocumentDB:
self.conn.commit()
def __hash(self, chunks: List[Document]) -> str:
- log.debug("Generating sha256 hash for pdf document")
+ log.debug("Generating sha256 hash of the chunks")
document = str.encode("".join([chunk.page_content for chunk in chunks]))
return hashlib.sha256(document).hexdigest()
def add(self, chunks: List[Document]) -> bool:
- log.debug("Inserting document hash into documents db...")
with self.conn.cursor() as cur:
hash = self.__hash(chunks)
cur.execute(
@@ -47,6 +46,7 @@ class DocumentDB:
)
exist = cur.fetchone()
if exist is None:
+ log.debug("Inserting document hash into documents db...")
cur.execute(
"""
INSERT INTO document