mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-29 10:56:22 +02:00
modify add action to set action
This commit is contained in:
parent
07d34bda7a
commit
91e6564586
19 changed files with 34 additions and 33 deletions
|
|
@ -61,7 +61,7 @@ class AgentCreator(Role):
|
|||
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self.add_actions([CreateAgent])
|
||||
self.set_actions([CreateAgent])
|
||||
|
||||
async def _act(self) -> Message:
|
||||
logger.info(f"{self._setting}: to do {self.rc.todo}({self.rc.todo.name})")
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ class SimpleCoder(Role):
|
|||
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self.add_actions([SimpleWriteCode])
|
||||
self.set_actions([SimpleWriteCode])
|
||||
|
||||
async def _act(self) -> Message:
|
||||
logger.info(f"{self._setting}: to do {self.rc.todo}({self.rc.todo.name})")
|
||||
|
|
@ -76,7 +76,7 @@ class RunnableCoder(Role):
|
|||
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self.add_actions([SimpleWriteCode, SimpleRunCode])
|
||||
self.set_actions([SimpleWriteCode, SimpleRunCode])
|
||||
self._set_react_mode(react_mode=RoleReactMode.BY_ORDER.value)
|
||||
|
||||
async def _act(self) -> Message:
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ class SimpleCoder(Role):
|
|||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self._watch([UserRequirement])
|
||||
self.add_actions([SimpleWriteCode])
|
||||
self.set_actions([SimpleWriteCode])
|
||||
|
||||
|
||||
class SimpleWriteTest(Action):
|
||||
|
|
@ -75,7 +75,7 @@ class SimpleTester(Role):
|
|||
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self.add_actions([SimpleWriteTest])
|
||||
self.set_actions([SimpleWriteTest])
|
||||
# self._watch([SimpleWriteCode])
|
||||
self._watch([SimpleWriteCode, SimpleWriteReview]) # feel free to try this too
|
||||
|
||||
|
|
@ -114,7 +114,7 @@ class SimpleReviewer(Role):
|
|||
|
||||
def __init__(self, **kwargs):
|
||||
super().__init__(**kwargs)
|
||||
self.add_actions([SimpleWriteReview])
|
||||
self.set_actions([SimpleWriteReview])
|
||||
self._watch([SimpleWriteTest])
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ class Debator(Role):
|
|||
|
||||
def __init__(self, **data: Any):
|
||||
super().__init__(**data)
|
||||
self.add_actions([SpeakAloud])
|
||||
self.set_actions([SpeakAloud])
|
||||
self._watch([UserRequirement, SpeakAloud])
|
||||
|
||||
async def _observe(self) -> int:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue