From a1fbd12874623fab91ac5c31b5f3a7f1a2a151f4 Mon Sep 17 00:00:00 2001 From: "m.dabbagh" Date: Tue, 27 Jan 2026 21:08:32 +0330 Subject: [PATCH] fix: paragraph_chunker was adding "None" when the section.title was none --- src/adapters/outgoing/chunkers/paragraph_chunker.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/adapters/outgoing/chunkers/paragraph_chunker.py b/src/adapters/outgoing/chunkers/paragraph_chunker.py index 105be6d..dffcbc3 100644 --- a/src/adapters/outgoing/chunkers/paragraph_chunker.py +++ b/src/adapters/outgoing/chunkers/paragraph_chunker.py @@ -309,7 +309,10 @@ class ParagraphChunker(IChunker): # Create chunks for this section with title prefix for text in chunk_texts: # Prepend document title and section title to chunk content - prefixed_content = f"{document_title}\n{section.title}\n{text}" + if section.title: + prefixed_content = f"{document_title}\n{section.title}\n\n{text}" + else: + prefixed_content = f"{document_title}\n\n{text}" chunk = Chunk( document_id=document.id,