feat: chunked bge embeddings + lancedb sutta index

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
marcuspaico
2026-08-14 17:18:42 -07:00
parent 221b1f5097
commit 691d2d94f5
3 changed files with 64 additions and 0 deletions

14
tests/test_index.py Normal file
View File

@@ -0,0 +1,14 @@
from buddhagpt.index import chunk_text
def test_chunk_text_respects_max_words():
text = " ".join(f"w{i}" for i in range(700))
chunks = chunk_text(text, max_words=300, overlap=50)
assert all(len(c.split()) <= 300 for c in chunks)
assert len(chunks) == 3
def test_chunks_overlap():
text = " ".join(f"w{i}" for i in range(400))
a, b = chunk_text(text, max_words=300, overlap=50)
assert a.split()[-50:] == b.split()[:50]