move top-level modules into a real package

This commit is contained in:
Matteo Rosati
2026-04-22 15:47:46 +02:00
parent e33160282c
commit 8ebab832d5
35 changed files with 6192 additions and 31 deletions
+17
View File
@@ -0,0 +1,17 @@
from pathlib import Path
from typing import List
import semchunk
def chunk_text(text: str, chunk_size: int = 800) -> List[str]:
chunker = semchunk.chunkerify("gpt-4", chunk_size)
chunks = chunker(text)
return chunks
def chunk_file(filename: str, chunk_size: int = 800) -> List[str]:
contents = Path(filename).read_text()
return chunk_text(contents, chunk_size)