update code

This commit is contained in:
stellahsr 2023-10-06 18:49:13 +08:00
parent c1c1d22cff
commit 7d14a85329
6 changed files with 38 additions and 19 deletions

View file

@ -13,7 +13,7 @@ from metagpt.minecraft_team import MinecraftPlayer
async def learn(task="Start", investment: float = 50.0, n_round: int = 3):
mc_player = MinecraftPlayer()
mc_player.set_port(1077) # Modify this to your Minecraft LAN port
mc_player.set_port(33141) # Modify this to your Minecraft LAN port
# mc_player.set_resume(True) # If load json from ckpt dir(include chest_memory, skills, ...)
mc_player.hire(
[
@ -24,7 +24,8 @@ async def learn(task="Start", investment: float = 50.0, n_round: int = 3):
]
)
print(mc_player.environment.roles)
print(mc_player.environment.roles["Generate code for specified tasks"]._rc)
mc_player.invest(investment)
mc_player.start(task)
await mc_player.run(n_round=n_round)