mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-15 11:02:36 +02:00
feat: persist_path
This commit is contained in:
parent
ed0b9e33bc
commit
aa710129f7
2 changed files with 13 additions and 12 deletions
|
|
@ -10,7 +10,7 @@ from metagpt.tools.libs.index_repo import IndexRepo
|
|||
@pytest.mark.parametrize(("path", "query"), [(TEST_DATA_PATH / "requirements", "业务线")])
|
||||
async def test_index_repo(path, query):
|
||||
index_path = DEFAULT_WORKSPACE_ROOT / ".index"
|
||||
repo = IndexRepo(filename=str(index_path), root_path=str(path), min_token_count=0)
|
||||
repo = IndexRepo(persist_path=str(index_path), root_path=str(path), min_token_count=0)
|
||||
await repo.add([path])
|
||||
await repo.add([path])
|
||||
assert index_path.exists()
|
||||
|
|
@ -18,7 +18,7 @@ async def test_index_repo(path, query):
|
|||
rsp = await repo.search(query)
|
||||
assert rsp
|
||||
|
||||
repo2 = IndexRepo(filename=str(index_path), root_path=str(path), min_token_count=0)
|
||||
repo2 = IndexRepo(persist_path=str(index_path), root_path=str(path), min_token_count=0)
|
||||
rsp2 = await repo2.search(query)
|
||||
assert rsp2
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue