From 044e5c64a9247081a259b2c885e70afa6f925836 Mon Sep 17 00:00:00 2001 From: Trayan Azarov Date: Tue, 16 Jul 2024 13:53:49 +0300 Subject: [PATCH] chore: Improve readability of SHA256 python example --- docs/core/document-ids.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docs/core/document-ids.md b/docs/core/document-ids.md index 5612fbe6..04ba93ed 100644 --- a/docs/core/document-ids.md +++ b/docs/core/document-ids.md @@ -166,6 +166,8 @@ thing, as it allows you to change the document without changing the ID. ``` === "Python" + + **Random SHA256:** ```python import hashlib @@ -194,6 +196,8 @@ thing, as it allows you to change the document without changing the ID. collection.add(ids=[generate_sha256_hash() for _ in range(len(my_documents))], documents=my_documents) ``` + **Document-based SHA256:** + It is also possible to use the document as basis for the hash, the downside of that is that when the document changes, and you have a semantic around the text as relating to the hash, you may need to update the hash.