diff --git a/src/chonkie/refinery/overlap.py b/src/chonkie/refinery/overlap.py index 7b4d248..5c096c8 100644 --- a/src/chonkie/refinery/overlap.py +++ b/src/chonkie/refinery/overlap.py @@ -171,7 +171,7 @@ def _suffix_overlap_token_exact(self, chunk: Chunk) -> Optional[Context]: return None # Take 6x context_size characters to ensure enough tokens - char_window = min(len(chunk.text), self.context_size * self._AVG_CHAR_PER_TOKEN) + char_window = min(len(chunk.text), int(self.context_size * self._AVG_CHAR_PER_TOKEN)) text_portion = chunk.text[:char_window] # Get exact token boundaries