Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions app/services/chunking.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@
import re
import unicodedata
from dataclasses import dataclass
# Default chunking configuration constants
DEFAULT_CHUNK_SIZE = 512
DEFAULT_CHUNK_OVERLAP = 64




@dataclass
Expand Down Expand Up @@ -42,8 +47,8 @@ def normalize_text(text: str) -> str:
" ", # word boundaries
"", # character-level fallback
]


chunk_size: int = DEFAULT_CHUNK_SIZE,
chunk_overlap: int = DEFAULT_CHUNK_OVERLAP,
def chunk_text(
text: str,
chunk_size: int = 512,
Expand Down