mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-07-02 16:01:04 +02:00
在mc branch添加相关的actions
This commit is contained in:
parent
3f892482a2
commit
5f521d4270
17 changed files with 878 additions and 0 deletions
32
minecraft_run.py
Normal file
32
minecraft_run.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
# @Date : 2023/9/24 11:09
|
||||
# @Author : stellahong (stellahong@fuzhi.ai)
|
||||
# @Desc :
|
||||
import asyncio
|
||||
|
||||
from metagpt.roles.minecraft.curriculum_agent import CurriculumDesigner
|
||||
from metagpt.roles.minecraft.skill_manager import SkillManager
|
||||
from metagpt.roles.minecraft.action_developer import ActionDeveloper
|
||||
from metagpt.roles.minecraft.critic_agent import CriticReviewer
|
||||
from metagpt.minecraft_team import MinecraftPlayer
|
||||
|
||||
|
||||
async def learn(task="Start", investment: float = 50.0, n_round: int = 3):
|
||||
mc_player = MinecraftPlayer()
|
||||
mc_player.hire(
|
||||
[
|
||||
CurriculumDesigner(),
|
||||
ActionDeveloper(),
|
||||
CriticReviewer(),
|
||||
SkillManager(),
|
||||
|
||||
]
|
||||
)
|
||||
|
||||
mc_player.invest(investment)
|
||||
mc_player.start(task)
|
||||
await mc_player.run(n_round=n_round)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(learn())
|
||||
Loading…
Add table
Add a link
Reference in a new issue