mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-05-21 14:05:17 +02:00
Merge branch 'main' into incremental_development
# Conflicts: # metagpt/schema.py
This commit is contained in:
commit
e1b783ca14
127 changed files with 2346 additions and 648 deletions
|
|
@ -36,7 +36,8 @@ class QaEngineer(Role):
|
|||
profile: str = "QaEngineer"
|
||||
goal: str = "Write comprehensive and robust tests to ensure codes will work as expected without bugs"
|
||||
constraints: str = (
|
||||
"The test code you write should conform to code standard like PEP8, be modular, " "easy to read and maintain"
|
||||
"The test code you write should conform to code standard like PEP8, be modular, easy to read and maintain."
|
||||
"Use same language as user requirement"
|
||||
)
|
||||
test_round_allowed: int = 5
|
||||
test_round: int = 0
|
||||
|
|
@ -62,6 +63,8 @@ class QaEngineer(Role):
|
|||
if not filename or "test" in filename:
|
||||
continue
|
||||
code_doc = await src_file_repo.get(filename)
|
||||
if not code_doc:
|
||||
continue
|
||||
test_doc = await tests_file_repo.get("test_" + code_doc.filename)
|
||||
if not test_doc:
|
||||
test_doc = Document(
|
||||
|
|
|
|||
|
|
@ -166,6 +166,9 @@ class Role(SerializationMixin, is_polymorphic_base=True):
|
|||
Role.model_rebuild()
|
||||
super().__init__(**data)
|
||||
|
||||
if self.is_human:
|
||||
self.llm = HumanProvider()
|
||||
|
||||
self.llm.system_prompt = self._get_prefix()
|
||||
self._watch(data.get("watch") or [UserRequirement])
|
||||
|
||||
|
|
@ -418,7 +421,7 @@ class Role(SerializationMixin, is_polymorphic_base=True):
|
|||
Use llm to select actions in _think dynamically
|
||||
"""
|
||||
actions_taken = 0
|
||||
rsp = Message(content="No actions taken yet") # will be overwritten after Role _act
|
||||
rsp = Message(content="No actions taken yet", cause_by=Action) # will be overwritten after Role _act
|
||||
while actions_taken < self.rc.max_react_loop:
|
||||
# think
|
||||
await self._think()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue