diff --git a/semantic_router/splitters/rolling_window.py b/semantic_router/splitters/rolling_window.py index fcd520e93c2db19669d89863f388dd0134dc2638..b3ca6279e6733bf5afa0a57dbefa64c3379fda35 100644 --- a/semantic_router/splitters/rolling_window.py +++ b/semantic_router/splitters/rolling_window.py @@ -215,7 +215,11 @@ class RollingWindowSplitter(BaseSplitter): logger.debug(f"Document token count: {doc_token_count} tokens") # Check if current index is a split point based on similarity if doc_idx + 1 in split_indices: - if self.min_split_tokens <= current_tokens_count + doc_token_count < self.max_split_tokens: + if ( + self.min_split_tokens + <= current_tokens_count + doc_token_count + < self.max_split_tokens + ): # Include the current document before splitting # if it doesn't exceed the max limit current_split.append(doc)