faiss store: add tests

This commit is contained in:
geekan 2024-01-02 21:30:35 +08:00
parent 54201b1459
commit c3dd03671d
5 changed files with 14 additions and 10 deletions

View file

@ -30,3 +30,11 @@ async def test_search_xlsx():
query = "Which facial cleanser is good for oily skin?"
result = await role.run(query)
logger.info(result)
@pytest.mark.asyncio
async def test_write():
store = FaissStore(EXAMPLE_PATH / "example.xlsx", meta_col="Answer", content_col="Question")
_faiss_store = store.write()
assert _faiss_store.docstore
assert _faiss_store.index