mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-07-14 16:32:16 +02:00
feat: merge geekan:cli-etc
This commit is contained in:
parent
5351b50d1c
commit
17bf646539
7 changed files with 0 additions and 180 deletions
|
|
@ -183,24 +183,6 @@ class Engineer(Role):
|
|||
msg = Message(
|
||||
content=coding_context.json(), instruct_content=coding_context, role=self.profile, cause_by=WriteCode
|
||||
)
|
||||
# =======
|
||||
# context = []
|
||||
# msg = self._rc.memory.get_by_actions([WriteDesign, WriteTasks, WriteCode])
|
||||
# for m in msg:
|
||||
# context.append(m.content)
|
||||
# context_str = "\n----------\n".join(context)
|
||||
# # Write code
|
||||
# code = await WriteCode().run(context=context_str, filename=todo)
|
||||
# # Code review
|
||||
# if self.use_code_review:
|
||||
# # try:
|
||||
# rewrite_code = await WriteCodeReview().run(context=context_str, code=code, filename=todo)
|
||||
# code = rewrite_code
|
||||
# # except Exception as e:
|
||||
# # logger.error("code review failed!", e)
|
||||
# file_path = self.write_file(todo, code)
|
||||
# msg = Message(content=code, role=self.profile, cause_by=WriteCode)
|
||||
# >>>>>>> feature/geekan_cli_etc
|
||||
self._rc.memory.add(msg)
|
||||
|
||||
changed_files.add(coding_context.code_doc.filename)
|
||||
|
|
@ -273,15 +255,6 @@ class Engineer(Role):
|
|||
coding_doc = Document(root_path=str(src_file_repo.root_path), filename=filename, content=context.json())
|
||||
return coding_doc
|
||||
|
||||
# =======
|
||||
# async def _act(self) -> Message:
|
||||
# """Determines the mode of action based on whether code review is used."""
|
||||
# logger.info(f"{self._setting}: ready to WriteCode")
|
||||
# if self.use_code_review:
|
||||
# return await self._act_sp_with_cr()
|
||||
# return await self._act_sp()
|
||||
# >>>>>>> feature/geekan_cli_etc
|
||||
|
||||
async def _new_code_actions(self):
|
||||
# Prepare file repos
|
||||
src_file_repo = CONFIG.git_repo.new_file_repository(CONFIG.src_workspace)
|
||||
|
|
|
|||
|
|
@ -44,32 +44,6 @@ class QaEngineer(Role):
|
|||
self.test_round = 0
|
||||
self.test_round_allowed = test_round_allowed
|
||||
|
||||
# <<<<<<< HEAD
|
||||
# =======
|
||||
# @classmethod
|
||||
# def parse_workspace(cls, system_design_msg: Message) -> str:
|
||||
# if system_design_msg.instruct_content:
|
||||
# return system_design_msg.instruct_content.dict().get("project_name")
|
||||
# return CodeParser.parse_str(block="project_name", text=system_design_msg.content)
|
||||
#
|
||||
# def get_workspace(self, return_proj_dir=True) -> Path:
|
||||
# msg = self._rc.memory.get_by_action(WriteDesign)[-1]
|
||||
# if not msg:
|
||||
# return CONFIG.workspace_path / "src"
|
||||
# workspace = self.parse_workspace(msg)
|
||||
# # project directory: workspace/{package_name}, which contains package source code folder, tests folder, resources folder, etc.
|
||||
# if return_proj_dir:
|
||||
# return CONFIG.workspace_path / workspace
|
||||
# # development codes directory: workspace/{package_name}/{package_name}
|
||||
# return CONFIG.workspace_path / workspace / workspace
|
||||
#
|
||||
# def write_file(self, filename: str, code: str):
|
||||
# workspace = self.get_workspace() / "tests"
|
||||
# file = workspace / filename
|
||||
# file.parent.mkdir(parents=True, exist_ok=True)
|
||||
# file.write_text(code)
|
||||
#
|
||||
# >>>>>>> feature/geekan_cli_etc
|
||||
async def _write_test(self, message: Message) -> None:
|
||||
changed_files = message.content.splitlines()
|
||||
src_file_repo = CONFIG.git_repo.new_file_repository(CONFIG.src_workspace)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue