From 7510c6f5722107f27660b504d8893c128789fab0 Mon Sep 17 00:00:00 2001 From: hajdul88 <52442977+hajdul88@users.noreply.github.com> Date: Wed, 2 Jul 2025 09:51:07 +0200 Subject: [PATCH] Fix: fixes None last_cut_type pydantic errors by introducing default cut type --- cognee/tasks/chunks/chunk_by_paragraph.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cognee/tasks/chunks/chunk_by_paragraph.py b/cognee/tasks/chunks/chunk_by_paragraph.py index 1668276c5..f71c4372b 100644 --- a/cognee/tasks/chunks/chunk_by_paragraph.py +++ b/cognee/tasks/chunks/chunk_by_paragraph.py @@ -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