mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-12 22:42:13 +02:00
test: seed chunk spans in retriever fixture
This commit is contained in:
parent
04b679e2bf
commit
c376fbaf61
1 changed files with 11 additions and 1 deletions
|
|
@ -40,11 +40,19 @@ def _make_document(
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def _make_chunk(*, content: str, document_id: int) -> Chunk:
|
def _make_chunk(
|
||||||
|
*,
|
||||||
|
content: str,
|
||||||
|
document_id: int,
|
||||||
|
start_char: int | None = None,
|
||||||
|
end_char: int | None = None,
|
||||||
|
) -> Chunk:
|
||||||
return Chunk(
|
return Chunk(
|
||||||
content=content,
|
content=content,
|
||||||
document_id=document_id,
|
document_id=document_id,
|
||||||
embedding=DUMMY_EMBEDDING,
|
embedding=DUMMY_EMBEDDING,
|
||||||
|
start_char=start_char,
|
||||||
|
end_char=end_char,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -91,6 +99,8 @@ async def seed_large_doc(
|
||||||
_make_chunk(
|
_make_chunk(
|
||||||
content="quarterly performance review summary note content",
|
content="quarterly performance review summary note content",
|
||||||
document_id=small_doc.id,
|
document_id=small_doc.id,
|
||||||
|
start_char=0,
|
||||||
|
end_char=10,
|
||||||
),
|
),
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue