Fix: fixes None last_cut_type pydantic errors by introducing default cut type

This commit is contained in:
hajdul88 2025-07-02 09:51:07 +02:00
parent 6078b35b87
commit 7510c6f572

View file

@ -31,7 +31,7 @@ def chunk_by_paragraph(
current_chunk = ""
chunk_index = 0
paragraph_ids = []
last_cut_type = None
last_cut_type = "default"
current_chunk_size = 0
for paragraph_id, sentence, sentence_size, end_type in chunk_by_sentence(
@ -77,6 +77,9 @@ def chunk_by_paragraph(
current_chunk_size = 0
chunk_index += 1
if not end_type:
end_type = "default"
last_cut_type = end_type
# Yield any remaining text