fix: paragraph_chunker was adding "None" when the section.title was none

This commit is contained in:
m.dabbagh 2026-01-27 21:08:32 +03:30
parent 80dd901e42
commit a1fbd12874

View File

@ -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,