mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-08 15:05:17 +02:00
refactor: 代码优化
This commit is contained in:
parent
4c99107a33
commit
81e719faa2
1 changed files with 2 additions and 4 deletions
|
|
@ -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/`.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue