mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-06-17 15:35:21 +02:00
Action developer add chest_memory & .run test pass
This commit is contained in:
parent
3a705a0e89
commit
73cd368828
8 changed files with 84 additions and 49 deletions
|
|
@ -37,11 +37,12 @@ async def main():
|
|||
"elapsedTime": 41,
|
||||
},
|
||||
"inventory": {},
|
||||
"nearbyChests": {},
|
||||
"nearbyChests": {"(1344, 64, 1381)": "Unknown"},
|
||||
"blockRecords": ["grass_block", "dirt", "grass"],
|
||||
},
|
||||
]
|
||||
]
|
||||
|
||||
code = """
|
||||
async function collectBamboo(bot) {
|
||||
// Equip the iron sword
|
||||
|
|
@ -78,11 +79,12 @@ async def main():
|
|||
"""
|
||||
ad = ActionDeveloper()
|
||||
ge = GameEnvironment()
|
||||
ge.update_event(events)
|
||||
ad.set_memory(shared_memory=ge)
|
||||
msg = ad.encapsule_message(events=events, code=code)
|
||||
msg = ad.encapsule_message(events=ge.event, code=code)
|
||||
logger.info(f"Encapsuled_message: {msg}")
|
||||
|
||||
parsed_result = await ad.generate_action_code(msg)
|
||||
parsed_result = await ad.generate_action_code(**msg)
|
||||
|
||||
logger.info(f"Parsed_code_updating: {parsed_result}")
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue