fix: paragraph_chunker was adding "None" when the section.title was none
This commit is contained in:
parent
80dd901e42
commit
a1fbd12874
@ -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,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user