Fixed Size Chunking
Split documents into character-limited chunks with configurable overlap.
FixedSizeChunking splits document text into chunks of at most chunk_size characters and keeps words intact when possible.
| Parameter | Type | Default | Description |
|---|---|---|---|
chunk_size | int | 5000 | Maximum characters per chunk. Use a positive value. |
overlap | int | 0 | Characters repeated between adjacent chunks. Use 0 <= overlap < chunk_size. |
Pass chunk_size > 0 and 0 <= overlap < chunk_size. The constructor raises ValueError when overlap >= chunk_size, but a negative overlap can pass validation and produce invalid chunks.