mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-30 03:16:23 +02:00
add cr tool
This commit is contained in:
parent
4dfe8524a1
commit
4cb0696df0
9 changed files with 781 additions and 0 deletions
15
examples/cr.py
Normal file
15
examples/cr.py
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
import fire
|
||||
|
||||
from metagpt.roles.di.engineer2 import Engineer2
|
||||
from metagpt.tools.libs.cr import CodeReview
|
||||
|
||||
|
||||
async def main(msg):
|
||||
role = Engineer2(tools=["Plan", "Editor:write,read", "RoleZero", "ReviewAndRewriteCode", "CodeReview"])
|
||||
cr = CodeReview()
|
||||
role.tool_execution_map.update({"CodeReview.review": cr.review, "CodeReview.fix": cr.fix})
|
||||
await role.run(msg)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
fire.Fire(main)
|
||||
Loading…
Add table
Add a link
Reference in a new issue