refactor: remove unnecessary header handling in chunk processing and update example usage

This commit is contained in:
begoniezhao
2025-11-21 15:13:57 +08:00
parent b9f264b883
commit a0685a22db

View File

@@ -198,8 +198,6 @@ class TextSplitter(BaseModel, Generic[T]):
# handle the last chunk # handle the last chunk
assert cur_chunk assert cur_chunk
if cur_headers and cur_len < self.chunk_size:
cur_chunk.insert(0, (cur_chunk[0][0], cur_chunk[0][1], cur_headers))
chunks.append( chunks.append(
( (
cur_chunk[0][0], cur_chunk[0][0],