You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
All examples is react_mode = BY_ORDER.
I know MetaGPT supporting REACT or PLAN_AND_ACT model, so could you release more example how to use REACT or PLAN_AND_ACT.
The text was updated successfully, but these errors were encountered:
The Data Interpreter utilizes the PLAN_AND_ACT mode.
You can find the detailed code in metagpt/roles/di/data_interpreter.py.
You can also find relevant demos at Data Interpreter (DI) | MetaGPT.
Regarding REACT, it consists of three actions: observe, think, and act. You can see these three operations (_observe(.), _think(.), _act(.)) in the base class Role in metagpt/roles/role.py:
@role_raise_decoratorasyncdefrun(self, with_message=None) ->Message|None:
"""Observe, and think and act based on the results of the observation"""
......
ifnotawaitself._observe():
......
returnrsp=awaitself.react()
.......
returnrsp
asyncdefreact(self) ->Message:
"""Entry to one of three strategies by which Role reacts to the observed Message"""ifself.rc.react_mode==RoleReactMode.REACTorself.rc.react_mode==RoleReactMode.BY_ORDER:
rsp=awaitself._react()
elif ......
returnrsp
asyncdef_react(self) ->Message:
......
whileactions_taken<self.rc.max_react_loop:
# thinktodo=awaitself._think()
ifnottodo:
break# actrsp=awaitself._act()
actions_taken+=1returnrsp# return output from the last action
When self.rc.max_react_loop of the _react is greater than 1, it is the BY_ORDER mode.
Feature description
All examples is
react_mode = BY_ORDER
.I know MetaGPT supporting
REACT or PLAN_AND_ACT
model, so could you release more example how to useREACT or PLAN_AND_ACT
.The text was updated successfully, but these errors were encountered: