diff --git a/src/RAG/Splitters/DocumentSplitter.php b/src/RAG/Splitters/DocumentSplitter.php index 5d0b0d19..18290196 100644 --- a/src/RAG/Splitters/DocumentSplitter.php +++ b/src/RAG/Splitters/DocumentSplitter.php @@ -24,6 +24,7 @@ public static function splitDocument(Document $document, int $maxLength = 1000, } if (\strlen($text) <= $maxLength) { + if (empty($document->hash)) $document->hash = \hash('sha256', $text); return [$document]; }