Spaces:
Running
Running
File size: 362 Bytes
5ea3240 | 1 2 3 4 5 6 7 8 9 10 11 | from ragforge.chunking import chunk_documents
from ragforge.schemas import Document
def test_chunking_preserves_source():
doc = Document("First sentence. Second sentence. Third sentence.", "demo.txt")
chunks = chunk_documents([doc])
assert chunks
assert all(c.source == "demo.txt" for c in chunks)
assert "First sentence" in chunks[0].text
|