mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-11 15:15:18 +02:00
fixbug: 如果index_builder异常未及时建索引,则自动建索引以防max token
This commit is contained in:
parent
a94e282e7f
commit
daea102ee7
2 changed files with 23 additions and 13 deletions
|
|
@ -10,7 +10,6 @@ from metagpt.tools.libs.index_repo import (
|
|||
CHATS_INDEX_ROOT,
|
||||
CHATS_ROOT,
|
||||
UPLOAD_ROOT,
|
||||
UPLOADS_INDEX_ROOT,
|
||||
IndexRepo,
|
||||
)
|
||||
from metagpt.utils.common import list_files
|
||||
|
|
@ -677,8 +676,6 @@ async def mock_index_repo():
|
|||
os.system(command)
|
||||
filenames = list_files(UPLOAD_ROOT)
|
||||
uploads_files = [i for i in filenames if Path(i).suffix in {".md", ".txt", ".json", ".pdf"}]
|
||||
uploads_repo = IndexRepo(persist_path=UPLOADS_INDEX_ROOT, root_path=UPLOAD_ROOT, min_token_count=0)
|
||||
await uploads_repo.add(uploads_files)
|
||||
assert uploads_files
|
||||
|
||||
filenames = list_files(src_path)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue