From 81e719faa21bd08d3f97545c30d48658348afc5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=8E=98=E6=9D=83=20=E9=A9=AC?= Date: Mon, 27 Nov 2023 19:29:29 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E4=BB=A3=E7=A0=81=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- metagpt/actions/prepare_documents.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/metagpt/actions/prepare_documents.py b/metagpt/actions/prepare_documents.py index c9b60ff27..92d5730b2 100644 --- a/metagpt/actions/prepare_documents.py +++ b/metagpt/actions/prepare_documents.py @@ -24,8 +24,7 @@ class PrepareDocuments(Action): async def run(self, with_messages, **kwargs): if CONFIG.git_repo: - docs_repo = CONFIG.git_repo.new_file_repository(DOCS_FILE_REPO) - doc = await docs_repo.get(REQUIREMENT_FILENAME) + doc = await FileRepository.get_file(filename=REQUIREMENT_FILENAME, relative_path=DOCS_FILE_REPO) return ActionOutput(content=doc.json(exclue="content"), instruct_content=doc) # Create and initialize the workspace folder, initialize the Git environment. @@ -34,9 +33,8 @@ class PrepareDocuments(Action): CONFIG.git_repo.open(local_path=workdir, auto_init=True) # Write the newly added requirements from the main parameter idea to `docs/requirement.txt`. - docs_file_repository = CONFIG.git_repo.new_file_repository(DOCS_FILE_REPO) doc = Document(root_path=DOCS_FILE_REPO, filename=REQUIREMENT_FILENAME, content=with_messages[0].content) - await docs_file_repository.save(REQUIREMENT_FILENAME, content=doc.content) + await FileRepository.save_file(filename=REQUIREMENT_FILENAME, content=doc.content, relative_path=DOCS_FILE_REPO) # Send a Message notification to the WritePRD action, instructing it to process requirements using # `docs/requirement.txt` and `docs/prds/`.