update example for mgx

add intent detect action and mgx role
This commit is contained in:
stellahsr 2024-03-30 12:05:22 +08:00
parent 154e108fb0
commit a9938472fc
4 changed files with 357 additions and 0 deletions

3
examples/mgx/__init__.py Normal file
View file

@ -0,0 +1,3 @@
# -*- coding: utf-8 -*-
# @Author : stellahong (stellahong@fuzhi.ai)
# @Desc :

19
examples/mgx/run_mgx.py Normal file
View file

@ -0,0 +1,19 @@
# -*- coding: utf-8 -*-
# @Author : stellahong (stellahong@fuzhi.ai)
# @Desc :
import asyncio
from metagpt.roles.di.mgx import MGX
requirement = (
"design a game using Gym (an open source Python library), including a graphical interface and interactive gameplay"
)
async def main(requirement: str = ""):
mgx = MGX(ususe_intent=True)
await mgx.run(requirement)
if __name__ == "__main__":
asyncio.run(main(requirement))