initial commit: retrieval + agent artifacts
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
from raglab.chunking import chunk_markdown
|
||||
|
||||
|
||||
def test_chunking_keeps_heading_trail():
|
||||
text = "# Title\n\nIntro\n\n## Section\n\nBody text."
|
||||
chunks = chunk_markdown("doc", text)
|
||||
assert all(chunk.doc_id == "doc" for chunk in chunks)
|
||||
assert any("Section" in chunk.title for chunk in chunks)
|
||||
|
||||
|
||||
def test_long_text_is_split_with_overlap():
|
||||
chunks = chunk_markdown("doc", "# T\n\n" + "word " * 800, target=200, overlap=40)
|
||||
assert len(chunks) > 1
|
||||
assert all(len(chunk.text) <= 260 for chunk in chunks)
|
||||
Reference in New Issue
Block a user