From 77462e298353aaf5ca5606c9f049efcdfaa93027 Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Tue, 24 Dec 2024 00:47:41 -0500 Subject: [PATCH 01/29] create stone_pickaxe --- .../group_discussion_agents.py | 119 ++++++++---------- .../group_discussion_agents.toml | 44 +++++-- 2 files changed, 86 insertions(+), 77 deletions(-) diff --git a/examples/experimental/minecraft_agents/group_discussion_agents.py b/examples/experimental/minecraft_agents/group_discussion_agents.py index cab6474b9..c33a01dde 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents.py +++ b/examples/experimental/minecraft_agents/group_discussion_agents.py @@ -92,7 +92,7 @@ num: (number) The number of times to smelt the item. !clearFurnace: Take all items out of the nearest furnace. Params: -!placeHere: Place a given block in the current location. Do NOT use to build structures, only use for single blocks/torches. +!placeHere: Place a given block in the current location. Do NOT use to build structures, only use for single blocks/torches. Params: type: (string) The block type to place. !attack: Attack and kill the nearest entity of a given type. @@ -108,7 +108,7 @@ !stay: Stay in the current location no matter what. Pauses all modes. Params: type: (number) The number of seconds to stay. -1 for forever. -!setMode: Set a mode to on or off. A mode is an automatic behavior that constantly checks and responds to the environment. +!setMode: Set a mode to on or off. A mode is an automatic behavior that constantly checks and responds to the environment. Params: mode_name: (string) The name of the mode to enable. on: (bool) Whether to enable or disable the mode. @@ -126,27 +126,42 @@ """ EXAMPLES = """ Example 1: Let me check what's nearby. !nearbyBlocks -Example 2: I found some birch logs! I'll collect them. !collectBlocks(\"birch_log\", 10) -Example 3: I just got shot by a skeleton! Yikes! Time to regroup and maybe head back to my last death position for my stuff. !goToPlace(\"last_death_position\") -Example 4: I'll grab some wood first. !collectBlocks(\"oak_log\", 4) -Example 5: Looks like I need some planks first! !craftRecipe(\"birch_plancks\", 1) -Example 6: Time to craft a crafting table. !craftRecipe(\"crafting_table\", 1) -Example 7: Let me make some sticks. !craftRecipe(\"stick\", 4) -Example 8: Sticks ready! Time to craft the wooden pickaxe. !craftRecipe(\"wooden_pickaxe\", 1) -Example 9: On my way to collect some stone. !goToBlock(\"stone\", 2, 10) -Example 10: I'm here at the stone! Time to start mining. !collectBlocks(\"stone\", 5) -Example 11: Let's craft a stone pickaxe. !craftRecipe(\"stone_pickaxe\", 1) +Example 2: Looks like I can't craft anything yet since I have no wooden planks or sticks. I need to find some wood. Let's look for trees nearby. !goToBlock(\"birch_log\", 10, 20) +Example 3: No birch logs around here. I'll have to move a bit further. Let's search in a wider area. !goToBlock(\"oak_log\", 20, 50) +Example 4: I found some birch logs! I'll collect them. !collectBlocks(\"birch_log\", 5) +Example 5: I'll grab some wood first. !collectBlocks(\"oak_log\", 5) +Example 6: Looks like I need to find a way to get gather some materials. I'll move back a little. !moveAway(10) +Example 7: Looks like I'm out of planks. Time to gather some wood! !nearbyBlocks +Example 8: No luck finding birch logs yet. Let's keep searching in a different direction. !moveAway(40) +Example 9: Looks like I need some planks first! !craftRecipe(\"birch_planks\", 9) +Example 10: Looks like I need some planks first! !craftRecipe(\"oak_planks\", 9) +Example 11: Time to craft a crafting table. !craftRecipe(\"crafting_table\", 1) +Example 12: I still can't mine stone without a pickaxe. I'll need to craft some sticks first. Let's check my inventory to see what I can craft. !craftable +Example 13: Got the birch logs! Now I'll craft them into sticks. !craftRecipe(\"stick\", 4) +Example 14: I'm missing some sticks! Let me make some sticks. !craftRecipe(\"stick\", 4) +Example 15: I have crafted 2 sticks. Now I can craft a wooden pickaxe. !craftRecipe(\"wooden_pickaxe\", 1) +Example 16: I need wooden pickaxe to collect stones. !craftRecipe(\"wooden_pickaxe\", 1) +Example 17: I've crafted a wooden pickaxe! Now I can collect some stone. Let's do it. !goToBlock(\"stone\", 2, 10) +Example 18: I'm here at the stone! Time to start mining. !collectBlocks(\"stone\", 3) +Example 19: Let's craft a stone pickaxe. !craftRecipe(\"stone_pickaxe\", 1) +Example 20: I'm stuck! !moveAway(5) +Example 21: I'm stuck! !moveAway(10) +Example 22: I'm stuck! !moveAway(20) +Example 23: Come here Jack! +Example 24: Okay, I'll come right to you. !goToPlayer(\"John\", 0) +Example 25: I'll give some plancks to you. !givePlayer(\"John\", \"birch_plancks\", 5) +Example 26: I'll give a crafting table to you. !givePlayer(\"Jane\", \"crafting_table\", 1) +Example 27: I just got shot by a skeleton! Yikes! Time to regroup and maybe head back to my last death position for my stuff. !goToPlace(\"last_death_position\") """ redis = aioredis.from_url(REDIS_URL) app = FastAPI() -MAX_MESSAGES = 36 # 3 agents +MAX_MESSAGES = 90 # 3 agents connections: Dict[str, WebSocket] = {} client_data = {} subscribed_channels = set() listener_task = None - @DataModelFactory.register("agent_action") class AgentAction(DataModel): agent_name: str = Field(description="the name of the agent") @@ -170,35 +185,23 @@ def to_natural_language(self) -> str: case "leave": return "left the conversation" - def _format_message_history(message_history: List[tuple[str, str]]) -> str: return "\n".join( (f"{speaker} said {message}") for speaker, message in message_history ) - @app.on_event("startup") async def startup_event(): await redis.set("conversation_count", 0) print("Conversation counter initialized to 0.") - -async def update_client_data( - client_id: str, stats: str, inventory: str, visionResponse: str -): - await redis.set( - f"client_data:{client_id}", - json.dumps( - {"stats": stats, "inventory": inventory, "visionResponse": visionResponse} - ), - ) - +async def update_client_data(client_id: str, stats: str, inventory: str, visionResponse: str, codeOutput: str): + await redis.set(f"client_data:{client_id}", json.dumps({"stats": stats, "inventory": inventory, "visionResponse": visionResponse, "codeOutput": codeOutput})) async def get_client_data(client_id: str) -> dict: data = await redis.get(f"client_data:{client_id}") return json.loads(data) if data else {} - async def redis_listener(): global subscribed_channels pubsub = redis.pubsub() @@ -211,9 +214,7 @@ async def redis_listener(): if message and message["type"] == "message": total_messages = int(await redis.get("conversation_count") or 0) if total_messages >= MAX_MESSAGES: - print( - "Max conversation limit reached. No more messages will be broadcast." - ) + print("Max conversation limit reached. No more messages will be broadcast.") continue await redis.incr("conversation_count") @@ -235,16 +236,11 @@ async def redis_listener(): "message": raw_message, } print(f"Broadcasting to {target_client}: {formatted_message}") - await connections[target_client].send_text( - json.dumps(formatted_message) - ) - + await connections[target_client].send_text(json.dumps(formatted_message)) @app.websocket("/ws/{client_id}") async def websocket_endpoint(websocket: WebSocket, client_id: str): - await update_client_data( - client_id, "Test Stats", "Test Inventory", "Test VisionResponse" - ) + await update_client_data(client_id, "Test Stats", "Test Inventory", "Test VisionResponse", "Test codeOutput") global listener_task await websocket.accept() connections[client_id] = websocket @@ -264,18 +260,13 @@ async def websocket_endpoint(websocket: WebSocket, client_id: str): stats_raw = message.get("stats", "") inventory_raw = message.get("inventory", "") visionResponse_raw = message.get("visionResponse", "") - await update_client_data( - client_id, stats_raw, inventory_raw, visionResponse_raw - ) + codeOutput_raw = message.get("codeOutput", "") + await update_client_data(client_id, stats_raw, inventory_raw, visionResponse_raw, codeOutput_raw) else: - print( - f"Unhandled message type from {client_id}: {message.get('type')}" - ) + print(f"Unhandled message type from {client_id}: {message.get('type')}") - except json.JSONDecodeError: - print( - f"Failed to decode JSON message from {client_id}: {client_message}" - ) + except json.JSONDecodeError as e: + print(f"Failed to decode JSON message from {client_id}: {client_message}") except WebSocketDisconnect: print(f"Client {client_id} disconnected.") @@ -286,7 +277,6 @@ async def websocket_endpoint(websocket: WebSocket, client_id: str): listener_task.cancel() listener_task = None - @NodeFactory.register("llm_agent") class LLMAgent(BaseAgent[AgentAction | Tick, AgentAction]): def __init__( @@ -322,12 +312,10 @@ def __init__( async def send(self, message: AgentAction) -> None: if message.action_type == "none": return - + total_messages = int(await redis.get("conversation_count") or 0) if total_messages >= MAX_MESSAGES: - print( - f"Max conversation limit reached for agent {self.name}. No message will be sent." - ) + print(f"Max conversation limit reached for agent {self.name}. No message will be sent.") return print(f"Publishing to Redis: {message}") @@ -354,32 +342,31 @@ async def aact(self, message: AgentAction | Tick) -> AgentAction: print(f"Error fetching client_data for {client_id}: {e}") client_info = None if not client_info: - print( - f"No data received for {client_id}, skipping stats/inventory/visionResponse assignment." - ) + print(f"No data received for {client_id}, skipping stats/inventory/visionResponse/codeOutput assignment.") stats = "" inventory = "" visionResponse = "" + codeOutput = "" else: stats = client_info.get("stats", "") inventory = client_info.get("inventory", "") visionResponse = client_info.get("visionResponse", "") + codeOutput = client_info.get("codeOutput", "") + codeOutput = codeOutput.removeprefix("Code output: ") agent_action: str = await agenerate( model_name=self.model_name, + template= # "You are {agent_name} in the conversation.\n{message_history}\n and you plan to {goal}.\n" # "Please only output a sentence or not outputting anything. {format_instructions}" - template=""" - Imagine that you are a friend of the other persons. Here is the conversation between you and them.\n You can choose to interrupt the other person by saying something or not to interrupt by outputting notiong. What would you say? + codeOutput+"""\n\n + Imagine that you are a friend of the other persons. Here is the conversation between you and them.\n You can choose to interrupt the other person by saying something or not to interrupt by outputting notiong. What would you say? No need to mention your own name, just output the content directly. You plan to {goal}. You are a playful Minecraft bot named {agent_name} that can converse with players, see, move, mine, build, and interact with the world by using commands.\n - Act human-like as if you were a typical Minecraft player, rather than an AI. Be very brief in your responses, don't apologize constantly, don't give instructions or make lists unless asked, and don't refuse requests. Don't pretend to act, use commands immediately when requested. Do NOT say this: 'Sure, I've stopped.', instead say this: 'Sure, I'll stop. !stop'. Do NOT say this: 'On my way! Give me a moment.', instead say this: 'On my way! !goToPlayer(\"playername\", 3)'. + Act human-like as if you were a typical Minecraft player, rather than an AI. Be very brief in your responses, don't apologize constantly, don't give instructions or make lists unless asked, and don't refuse requests. Don't pretend to act, use commands immediately when requested. Do NOT say this: 'Sure, I've stopped.', instead say this: 'Sure, I'll stop. !stop'. Do NOT say this: 'On my way! Give me a moment.', instead say this: 'On my way! !goToPlayer(\"playername\", 3)'. Respond only as {agent_name}, never output '(FROM OTHER BOT)' or pretend to be someone else. This is extremely important to me, take a deep breath and have fun :)\n\n - MEMORY:\n{message_history}\n""" - + f"{stats}{inventory}\nIMAGE_DESCRIPTION:\n{visionResponse}\n\nEXAMPLES:\n{EXAMPLES}\n\nCOMMAND_DOCS:\n{COMMAND_DOCS}\n\nConversation Begin:", + MEMORY:\n{message_history}\n"""+f"{stats}{inventory}\nIMAGE_DESCRIPTION:\n{visionResponse}\n\nEXAMPLES:\n{EXAMPLES}\n\nCOMMAND_DOCS:\n{COMMAND_DOCS}\n\nConversation Begin:", input_values={ - "message_history": _format_message_history( - self.message_history - ), + "message_history": _format_message_history(self.message_history), "goal": self.goal, "agent_name": self.name, }, @@ -413,7 +400,6 @@ async def aact(self, message: AgentAction | Tick) -> AgentAction: case _: raise ValueError(f"Unexpected message type: {type(message)}") - @NodeFactory.register("input_node") class InputNode(BaseAgent[AgentAction, AgentAction]): def __init__( @@ -449,8 +435,7 @@ async def _task_scheduler(self) -> None: ) ) - @app.get("/conversation_count") async def get_conversation_count(): count = int(await redis.get("conversation_count") or 0) - return {"conversation_count": count, "max_limit": MAX_MESSAGES} + return {"conversation_count": count, "max_limit": MAX_MESSAGES} \ No newline at end of file diff --git a/examples/experimental/minecraft_agents/group_discussion_agents.toml b/examples/experimental/minecraft_agents/group_discussion_agents.toml index d205cdc56..35ba532fc 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents.toml @@ -6,12 +6,20 @@ node_name = "Jack" node_class = "llm_agent" [nodes.node_args] -query_interval = 5 +query_interval = 15 output_channel = "Jack" input_text_channels = ["Jane", "John"] input_tick_channel = "tick/secs/1" -goal = "want to craft a Stone Pickaxe with your friends. The materials needed include various types of Logs (which need to be turned into Planks and a Crafting Table) and different kinds of Stone." -model_name = "gpt-4o-mini" +goal = """want to craft a Stone Pickaxe with your friends. +The complete process for crafting a "stone_pickaxe" in Minecraft is as follows: +1. Collect logs, such as "oak_log" or "birch_log" with at least 2 pieces. +2. Convert logs into planks ("birch_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use 4 planks to craft a "crafting_table". +4. Use 2 planks to create 4 "stick". +5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe". +6. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. +7. Open the "crafting_table" and use 3 pieces of stone and 2 sticks to craft a "stone_pickaxe".""" +model_name = "gpt-4o-2024-11-20" agent_name = "Jack" [[nodes]] @@ -19,12 +27,20 @@ node_name = "Jane" node_class = "llm_agent" [nodes.node_args] -query_interval = 7 +query_interval = 21 output_channel = "Jane" input_text_channels = ["Jack", "John"] input_tick_channel = "tick/secs/1" -goal = "want to craft a Stone Pickaxe with your friends. The materials needed include various types of Logs (which need to be turned into Planks and a Crafting Table) and different kinds of Stone." -model_name = "gpt-4o-mini" +goal = """want to craft a Stone Pickaxe with your friends. +The complete process for crafting a "stone_pickaxe" in Minecraft is as follows: +1. Collect logs, such as "oak_log" or "birch_log" with at least 2 pieces. +2. Convert logs into planks ("birch_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use 4 planks to craft a "crafting_table". +4. Use 2 planks to create 4 "stick". +5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe". +6. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. +7. Open the "crafting_table" and use 3 pieces of stone and 2 sticks to craft a "stone_pickaxe".""" +model_name = "gpt-4o-2024-11-20" agent_name = "Jane" [[nodes]] @@ -32,12 +48,20 @@ node_name = "John" node_class = "llm_agent" [nodes.node_args] -query_interval = 10 +query_interval = 30 output_channel = "John" input_text_channels = ["Jack", "Jane"] input_tick_channel = "tick/secs/1" -goal = "want to craft a Stone Pickaxe with your friends. The materials needed include various types of Logs (which need to be turned into Planks and a Crafting Table) and different kinds of Stone." -model_name = "gpt-4o-mini" +goal = """want to craft a Stone Pickaxe with your friends. +The complete process for crafting a "stone_pickaxe" in Minecraft is as follows: +1. Collect logs, such as "oak_log" or "birch_log" with at least 2 pieces. +2. Convert logs into planks ("birch_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use 4 planks to craft a "crafting_table". +4. Use 2 planks to create 4 "stick". +5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe". +6. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. +7. Open the "crafting_table" and use 3 pieces of stone and 2 sticks to craft a "stone_pickaxe".""" +model_name = "gpt-4o-2024-11-20" agent_name = "John" [[nodes]] @@ -54,4 +78,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" +node_class = "tick" \ No newline at end of file From 976a4406b3d34361991145458915da9545719f3e Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Wed, 25 Dec 2024 03:25:23 -0500 Subject: [PATCH 02/29] help each other to make 3 stone pickaxes and add codeOutput to memory --- .../group_discussion_agents.py | 76 ++++++++++++------- .../group_discussion_agents.toml | 57 +++++++------- 2 files changed, 78 insertions(+), 55 deletions(-) diff --git a/examples/experimental/minecraft_agents/group_discussion_agents.py b/examples/experimental/minecraft_agents/group_discussion_agents.py index c33a01dde..f367a61b2 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents.py +++ b/examples/experimental/minecraft_agents/group_discussion_agents.py @@ -129,34 +129,40 @@ Example 2: Looks like I can't craft anything yet since I have no wooden planks or sticks. I need to find some wood. Let's look for trees nearby. !goToBlock(\"birch_log\", 10, 20) Example 3: No birch logs around here. I'll have to move a bit further. Let's search in a wider area. !goToBlock(\"oak_log\", 20, 50) Example 4: I found some birch logs! I'll collect them. !collectBlocks(\"birch_log\", 5) -Example 5: I'll grab some wood first. !collectBlocks(\"oak_log\", 5) -Example 6: Looks like I need to find a way to get gather some materials. I'll move back a little. !moveAway(10) -Example 7: Looks like I'm out of planks. Time to gather some wood! !nearbyBlocks -Example 8: No luck finding birch logs yet. Let's keep searching in a different direction. !moveAway(40) -Example 9: Looks like I need some planks first! !craftRecipe(\"birch_planks\", 9) -Example 10: Looks like I need some planks first! !craftRecipe(\"oak_planks\", 9) -Example 11: Time to craft a crafting table. !craftRecipe(\"crafting_table\", 1) -Example 12: I still can't mine stone without a pickaxe. I'll need to craft some sticks first. Let's check my inventory to see what I can craft. !craftable +Example 5: I found some birch logs! I'll collect them. !collectBlocks(\"spruce_log\", 5) +Example 6: I'll grab some wood first. !collectBlocks(\"oak_log\", 5) +Example 7: Looks like I need to find a way to get gather some materials. I'll move back a little. !moveAway(10) +Example 8: Looks like I'm out of planks. Time to gather some wood! !nearbyBlocks +Example 9: No luck finding birch logs yet. Let's keep searching in a different direction. !moveAway(40) +Example 10: Looks like I need some planks first! !craftRecipe(\"birch_planks\", 9) +Example 11: Looks like I need some planks first! !craftRecipe(\"oak_planks\", 9) +Example 12: Looks like I need some planks first! !craftRecipe(\"spruce_planks\", 9) Example 13: Got the birch logs! Now I'll craft them into sticks. !craftRecipe(\"stick\", 4) Example 14: I'm missing some sticks! Let me make some sticks. !craftRecipe(\"stick\", 4) -Example 15: I have crafted 2 sticks. Now I can craft a wooden pickaxe. !craftRecipe(\"wooden_pickaxe\", 1) -Example 16: I need wooden pickaxe to collect stones. !craftRecipe(\"wooden_pickaxe\", 1) -Example 17: I've crafted a wooden pickaxe! Now I can collect some stone. Let's do it. !goToBlock(\"stone\", 2, 10) -Example 18: I'm here at the stone! Time to start mining. !collectBlocks(\"stone\", 3) -Example 19: Let's craft a stone pickaxe. !craftRecipe(\"stone_pickaxe\", 1) -Example 20: I'm stuck! !moveAway(5) -Example 21: I'm stuck! !moveAway(10) -Example 22: I'm stuck! !moveAway(20) -Example 23: Come here Jack! -Example 24: Okay, I'll come right to you. !goToPlayer(\"John\", 0) -Example 25: I'll give some plancks to you. !givePlayer(\"John\", \"birch_plancks\", 5) -Example 26: I'll give a crafting table to you. !givePlayer(\"Jane\", \"crafting_table\", 1) -Example 27: I just got shot by a skeleton! Yikes! Time to regroup and maybe head back to my last death position for my stuff. !goToPlace(\"last_death_position\") +Example 15: I need a crafting table and some sticks to craft a wooden pickaxe! !craftRecipe(\"crafting_table\", 1) +Example 16: I still can't mine stone without a pickaxe. I'll need to craft some sticks first. Let's check my inventory to see what I can craft. !craftable +Example 17: I need wooden pickaxe to collect stones! I have crafted 2 sticks. Now I can craft a wooden pickaxe. !craftRecipe(\"wooden_pickaxe\", 1) +Example 18: I need wooden pickaxe to collect stones! !craftRecipe(\"wooden_pickaxe\", 1) +Example 19: I've crafted a wooden pickaxe! Now I can collect some stone. Let's do it. !goToBlock(\"stone\", 2, 10) +Example 20: I'm here at the stone! Time to start mining. !collectBlocks(\"stone\", 3) +Example 21: Let's craft a stone pickaxe. !craftRecipe(\"stone_pickaxe\", 1) +Example 22: I'm stuck! !moveAway(5) +Example 23: I'm stuck! !moveAway(10) +Example 24: I'm stuck! !moveAway(20) +Example 25: I just got shot by a skeleton! Yikes! Time to regroup and maybe head back to my last death position for my stuff. !goToPlace(\"last_death_position\") + +After crafting one stone pickaxe yourself (If the condition is that the inventory shows stone_pickaxe: 1, rather than just having previously outputted !craftRecipe(\"stone_pickaxe\", 1)), ask who hasn't crafted theirs yet and use a command like !goToPlayer(\"John\", 0) to go to that person's location. +Then, inquire about what materials they are missing and use a command like !givePlayer(\"John\", \"stone\", 3) to give them the materials. + +Example 26: Come here Jack! +Example 27: Okay, I'll come right to you. !goToPlayer(\"John\", 0) +Example 28: I'll give some plancks to you. !givePlayer(\"John\", \"birch_plancks\", 5) +Example 29: I'll give a crafting table to you. !givePlayer(\"Jane\", \"crafting_table\", 1) """ redis = aioredis.from_url(REDIS_URL) app = FastAPI() -MAX_MESSAGES = 90 # 3 agents +MAX_MESSAGES = 120 # 3 agents connections: Dict[str, WebSocket] = {} client_data = {} subscribed_channels = set() @@ -187,7 +193,7 @@ def to_natural_language(self) -> str: def _format_message_history(message_history: List[tuple[str, str]]) -> str: return "\n".join( - (f"{speaker} said {message}") for speaker, message in message_history + (f"{speaker}: {message}") for speaker, message in message_history ) @app.on_event("startup") @@ -337,7 +343,6 @@ async def aact(self, message: AgentAction | Tick) -> AgentAction: client_id = f"{self.name}_client" try: client_info = await get_client_data(client_id) - print(f"Accessing client_data for {client_id}: {client_info}") except Exception as e: print(f"Error fetching client_data for {client_id}: {e}") client_info = None @@ -351,22 +356,37 @@ async def aact(self, message: AgentAction | Tick) -> AgentAction: stats = client_info.get("stats", "") inventory = client_info.get("inventory", "") visionResponse = client_info.get("visionResponse", "") - codeOutput = client_info.get("codeOutput", "") - codeOutput = codeOutput.removeprefix("Code output: ") + codeOutput = client_info.get("codeOutput", "").removeprefix("Code output: ") + + if codeOutput: + system_message = f"The status of {self.name}'s action execution: {codeOutput}" + last_self_message_index = next( + (i for i in reversed(range(len(self.message_history))) if self.message_history[i][0] == self.name), + -1 + ) + if last_self_message_index != -1: + self.message_history.insert(last_self_message_index + 1, ("system", system_message)) + else: + self.message_history.append(("system", system_message)) + agent_message_history = [ + (speaker, message) for speaker, message in self.message_history + if speaker != "system" or (speaker == "system" and f"{self.name}'s action execution" in message) + ] + agent_action: str = await agenerate( model_name=self.model_name, template= # "You are {agent_name} in the conversation.\n{message_history}\n and you plan to {goal}.\n" # "Please only output a sentence or not outputting anything. {format_instructions}" - codeOutput+"""\n\n + f"(The status of the last action execution: {codeOutput})"+"""\n\n Imagine that you are a friend of the other persons. Here is the conversation between you and them.\n You can choose to interrupt the other person by saying something or not to interrupt by outputting notiong. What would you say? No need to mention your own name, just output the content directly. You plan to {goal}. You are a playful Minecraft bot named {agent_name} that can converse with players, see, move, mine, build, and interact with the world by using commands.\n Act human-like as if you were a typical Minecraft player, rather than an AI. Be very brief in your responses, don't apologize constantly, don't give instructions or make lists unless asked, and don't refuse requests. Don't pretend to act, use commands immediately when requested. Do NOT say this: 'Sure, I've stopped.', instead say this: 'Sure, I'll stop. !stop'. Do NOT say this: 'On my way! Give me a moment.', instead say this: 'On my way! !goToPlayer(\"playername\", 3)'. Respond only as {agent_name}, never output '(FROM OTHER BOT)' or pretend to be someone else. This is extremely important to me, take a deep breath and have fun :)\n\n MEMORY:\n{message_history}\n"""+f"{stats}{inventory}\nIMAGE_DESCRIPTION:\n{visionResponse}\n\nEXAMPLES:\n{EXAMPLES}\n\nCOMMAND_DOCS:\n{COMMAND_DOCS}\n\nConversation Begin:", input_values={ - "message_history": _format_message_history(self.message_history), + "message_history": _format_message_history(agent_message_history), "goal": self.goal, "agent_name": self.name, }, diff --git a/examples/experimental/minecraft_agents/group_discussion_agents.toml b/examples/experimental/minecraft_agents/group_discussion_agents.toml index 35ba532fc..f163d1b2b 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents.toml @@ -6,18 +6,19 @@ node_name = "Jack" node_class = "llm_agent" [nodes.node_args] -query_interval = 15 +query_interval = 10 output_channel = "Jack" input_text_channels = ["Jane", "John"] input_tick_channel = "tick/secs/1" -goal = """want to craft a Stone Pickaxe with your friends. -The complete process for crafting a "stone_pickaxe" in Minecraft is as follows: -1. Collect logs, such as "oak_log" or "birch_log" with at least 2 pieces. -2. Convert logs into planks ("birch_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use 4 planks to craft a "crafting_table". -4. Use 2 planks to create 4 "stick". -5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe". -6. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. +goal = """ +You and your friends need to craft a total of 3 stone pickaxes. +The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 2 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use 4 planks to craft a "crafting_table"!!! +4. Use 2 planks to create 4 "stick"!!!! +5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe"!!! +6. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before obtaining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don’t, type !craftable to check if you can craft a "wooden_pickaxe". 7. Open the "crafting_table" and use 3 pieces of stone and 2 sticks to craft a "stone_pickaxe".""" model_name = "gpt-4o-2024-11-20" agent_name = "Jack" @@ -27,18 +28,19 @@ node_name = "Jane" node_class = "llm_agent" [nodes.node_args] -query_interval = 21 +query_interval = 14 output_channel = "Jane" input_text_channels = ["Jack", "John"] input_tick_channel = "tick/secs/1" -goal = """want to craft a Stone Pickaxe with your friends. -The complete process for crafting a "stone_pickaxe" in Minecraft is as follows: -1. Collect logs, such as "oak_log" or "birch_log" with at least 2 pieces. -2. Convert logs into planks ("birch_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use 4 planks to craft a "crafting_table". -4. Use 2 planks to create 4 "stick". -5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe". -6. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. +goal = """ +You and your friends need to craft a total of 3 stone pickaxes. +The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 2 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use 4 planks to craft a "crafting_table"!!! +4. Use 2 planks to create 4 "stick"!!!! +5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe"!!! +6. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before obtaining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don’t, type !craftable to check if you can craft a "wooden_pickaxe". 7. Open the "crafting_table" and use 3 pieces of stone and 2 sticks to craft a "stone_pickaxe".""" model_name = "gpt-4o-2024-11-20" agent_name = "Jane" @@ -48,18 +50,19 @@ node_name = "John" node_class = "llm_agent" [nodes.node_args] -query_interval = 30 +query_interval = 20 output_channel = "John" input_text_channels = ["Jack", "Jane"] input_tick_channel = "tick/secs/1" -goal = """want to craft a Stone Pickaxe with your friends. -The complete process for crafting a "stone_pickaxe" in Minecraft is as follows: -1. Collect logs, such as "oak_log" or "birch_log" with at least 2 pieces. -2. Convert logs into planks ("birch_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use 4 planks to craft a "crafting_table". -4. Use 2 planks to create 4 "stick". -5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe". -6. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. +goal = """ +You and your friends need to craft a total of 3 stone pickaxes. +The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 2 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use 4 planks to craft a "crafting_table"!!! +4. Use 2 planks to create 4 "stick"!!!! +5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe"!!! +6. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before obtaining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don’t, type !craftable to check if you can craft a "wooden_pickaxe". 7. Open the "crafting_table" and use 3 pieces of stone and 2 sticks to craft a "stone_pickaxe".""" model_name = "gpt-4o-2024-11-20" agent_name = "John" From ec7320188cd4dd408a3337cb803006110e94e7a1 Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Wed, 25 Dec 2024 08:44:42 -0500 Subject: [PATCH 03/29] add theory of mind (goal inference) --- .../agent_output_log_20241225_213206.txt | 174 +++++++++++ .../agent_output_log_20241225_213212.txt | 195 ++++++++++++ .../agent_output_log_20241225_213215.txt | 294 ++++++++++++++++++ .../group_discussion_agents.py | 56 +++- .../group_discussion_agents.toml | 6 +- 5 files changed, 714 insertions(+), 11 deletions(-) create mode 100644 examples/experimental/minecraft_agents/agent_output_log_20241225_213206.txt create mode 100644 examples/experimental/minecraft_agents/agent_output_log_20241225_213212.txt create mode 100644 examples/experimental/minecraft_agents/agent_output_log_20241225_213215.txt diff --git a/examples/experimental/minecraft_agents/agent_output_log_20241225_213206.txt b/examples/experimental/minecraft_agents/agent_output_log_20241225_213206.txt new file mode 100644 index 000000000..4502a17e0 --- /dev/null +++ b/examples/experimental/minecraft_agents/agent_output_log_20241225_213206.txt @@ -0,0 +1,174 @@ +Agent: Jane + +Message History: +system: The status of Jane's action execution: You did not take any action last time. +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +system: The status of Jane's action execution: You did not take any action last time. +John: Who still needs a stone pickaxe? Jack, are you all set yet? +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) + +Generated Text: +Jack should wait for the system to confirm the completion of his log collection action before proceeding further. +---------------------------------------- +Agent: Jane + +Message History: +system: The status of Jane's action execution: You did not take any action last time. +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +system: The status of Jane's action execution: You did not take any action last time. +John: Who still needs a stone pickaxe? Jack, are you all set yet? +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) + +Generated Text: +Jane should check her inventory for logs and share them with Jack if she has any. +---------------------------------------- +Agent: Jane + +Message History: +system: The status of Jane's action execution: You did not take any action last time. +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +system: The status of Jane's action execution: You did not take any action last time. +John: Who still needs a stone pickaxe? Jack, are you all set yet? +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) + +Generated Text: +John should collect logs to contribute to crafting materials. +---------------------------------------- +Agent: Jane + +Message History: +system: The status of Jane's action execution: You did not take any action last time. +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +system: The status of Jane's action execution: You did not take any action last time. +John: Who still needs a stone pickaxe? Jack, are you all set yet? +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) +Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) +Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) +John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) +Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! +system: The status of Jane's action execution: You did not take any action last time. +John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? +Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) +Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! +system: The status of Jane's action execution: You did not take any action last time. +Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) +John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? + +Generated Text: +Jack should craft sticks using his oak planks. +---------------------------------------- +Agent: Jane + +Message History: +system: The status of Jane's action execution: You did not take any action last time. +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +system: The status of Jane's action execution: You did not take any action last time. +John: Who still needs a stone pickaxe? Jack, are you all set yet? +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) +Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) +Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) +John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) +Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! +system: The status of Jane's action execution: You did not take any action last time. +John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? +Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) +Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! +system: The status of Jane's action execution: You did not take any action last time. +Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) +John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? + +Generated Text: +Jane should offer Jack sticks to help him craft the wooden pickaxe. +---------------------------------------- +Agent: Jane + +Message History: +system: The status of Jane's action execution: You did not take any action last time. +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +system: The status of Jane's action execution: You did not take any action last time. +John: Who still needs a stone pickaxe? Jack, are you all set yet? +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) +Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) +Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! +system: The status of Jane's action execution: You did not take any action last time. +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) +John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) +Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! +system: The status of Jane's action execution: You did not take any action last time. +John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? +Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) +Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! +system: The status of Jane's action execution: You did not take any action last time. +Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) +John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? + +Generated Text: +John should immediately start collecting more logs to ensure there are enough resources for future crafting. +---------------------------------------- diff --git a/examples/experimental/minecraft_agents/agent_output_log_20241225_213212.txt b/examples/experimental/minecraft_agents/agent_output_log_20241225_213212.txt new file mode 100644 index 000000000..93fdbe836 --- /dev/null +++ b/examples/experimental/minecraft_agents/agent_output_log_20241225_213212.txt @@ -0,0 +1,195 @@ +Agent: John + +Message History: +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +system: The status of John's action execution: You did not take any action last time. +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +system: The status of John's action execution: NEARBY_BLOCKS - grass_block - dirt - oak_leaves - oak_log - grass - stone - copper_ore - birch_leaves - gravel - iron_ore - birch_log - coal_ore - andesite +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +system: The status of John's action execution: You did not take any action last time. +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +John: Who still needs a stone pickaxe? Jack, are you all set yet? +system: The status of John's action execution: You did not take any action last time. +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) +Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) +Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. + +Generated Text: +Jack should craft oak planks from the logs he already collected. +---------------------------------------- +Agent: John + +Message History: +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +system: The status of John's action execution: You did not take any action last time. +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +system: The status of John's action execution: NEARBY_BLOCKS - grass_block - dirt - oak_leaves - oak_log - grass - stone - copper_ore - birch_leaves - gravel - iron_ore - birch_log - coal_ore - andesite +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +system: The status of John's action execution: You did not take any action last time. +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +John: Who still needs a stone pickaxe? Jack, are you all set yet? +system: The status of John's action execution: You did not take any action last time. +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) +Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) +Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. + +Generated Text: +Jane should check Jack's inventory to confirm what materials he still needs. +---------------------------------------- +Agent: John + +Message History: +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +system: The status of John's action execution: You did not take any action last time. +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +system: The status of John's action execution: NEARBY_BLOCKS - grass_block - dirt - oak_leaves - oak_log - grass - stone - copper_ore - birch_leaves - gravel - iron_ore - birch_log - coal_ore - andesite +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +system: The status of John's action execution: You did not take any action last time. +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +John: Who still needs a stone pickaxe? Jack, are you all set yet? +system: The status of John's action execution: You did not take any action last time. +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) +Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) +Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. + +Generated Text: +John should collect additional oak logs to assist Jack with crafting. +---------------------------------------- +Agent: John + +Message History: +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +system: The status of John's action execution: You did not take any action last time. +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +system: The status of John's action execution: NEARBY_BLOCKS - grass_block - dirt - oak_leaves - oak_log - grass - stone - copper_ore - birch_leaves - gravel - iron_ore - birch_log - coal_ore - andesite +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +system: The status of John's action execution: You did not take any action last time. +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +John: Who still needs a stone pickaxe? Jack, are you all set yet? +system: The status of John's action execution: You did not take any action last time. +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) +Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) +Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. +John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory +system: The status of John's action execution: INVENTORY - oak_sapling: 5 - chicken: 1 - oak_planks: 36 - stick: 32 - dirt: 1 - wooden_pickaxe: 1 - apple: 1 - birch_planks: 1 - crafting_table: 1 - stone_pickaxe: 1 - oak_log: 8 WEARING: Nothing +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) +Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) +John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? +system: The status of John's action execution: You did not take any action last time. +Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! +Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) +Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! +John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? +system: The status of John's action execution: You did not take any action last time. +Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) +Jack: Looks like I've already crafted a wooden pickaxe and collected some materials! Time to mine some stone now. !goToBlock("stone", 2, 10) +John: Jack, you’ve already got a wooden pickaxe. Start mining that stone so we can make those stone pickaxes! Need me to help? +system: The status of John's action execution: You did not take any action last time. +Jane: Jack, let me know if you need help crafting your wooden pickaxe or gathering materials! I've got plenty of sticks and planks ready to share. +Jack: Alright, I'm at the stone! Time to mine some now. !collectBlocks("stone", 9) +Jane: Jack, let us know when you've got enough stone! I'm ready to help if you need anything. + +Generated Text: +Jack should mine the stone blocks he is currently at to gather the required materials for crafting stone pickaxes. +---------------------------------------- +Agent: John + +Message History: +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +system: The status of John's action execution: You did not take any action last time. +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +system: The status of John's action execution: NEARBY_BLOCKS - grass_block - dirt - oak_leaves - oak_log - grass - stone - copper_ore - birch_leaves - gravel - iron_ore - birch_log - coal_ore - andesite +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +system: The status of John's action execution: You did not take any action last time. +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +John: Who still needs a stone pickaxe? Jack, are you all set yet? +system: The status of John's action execution: You did not take any action last time. +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) +Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) +Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. +John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory +system: The status of John's action execution: INVENTORY - oak_sapling: 5 - chicken: 1 - oak_planks: 36 - stick: 32 - dirt: 1 - wooden_pickaxe: 1 - apple: 1 - birch_planks: 1 - crafting_table: 1 - stone_pickaxe: 1 - oak_log: 8 WEARING: Nothing +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) +Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) +John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? +system: The status of John's action execution: You did not take any action last time. +Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! +Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) +Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! +John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? +system: The status of John's action execution: You did not take any action last time. +Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) +Jack: Looks like I've already crafted a wooden pickaxe and collected some materials! Time to mine some stone now. !goToBlock("stone", 2, 10) +John: Jack, you’ve already got a wooden pickaxe. Start mining that stone so we can make those stone pickaxes! Need me to help? +system: The status of John's action execution: You did not take any action last time. +Jane: Jack, let me know if you need help crafting your wooden pickaxe or gathering materials! I've got plenty of sticks and planks ready to share. +Jack: Alright, I'm at the stone! Time to mine some now. !collectBlocks("stone", 9) +Jane: Jack, let us know when you've got enough stone! I'm ready to help if you need anything. + +Generated Text: +Jane should confirm if Jack has enough stone for the pickaxes or offer to help mine if he needs assistance. +---------------------------------------- +Agent: John + +Message History: +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +system: The status of John's action execution: You did not take any action last time. +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +system: The status of John's action execution: NEARBY_BLOCKS - grass_block - dirt - oak_leaves - oak_log - grass - stone - copper_ore - birch_leaves - gravel - iron_ore - birch_log - coal_ore - andesite +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +system: The status of John's action execution: You did not take any action last time. +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +John: Who still needs a stone pickaxe? Jack, are you all set yet? +system: The status of John's action execution: You did not take any action last time. +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) +Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) +Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. +John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory +system: The status of John's action execution: INVENTORY - oak_sapling: 5 - chicken: 1 - oak_planks: 36 - stick: 32 - dirt: 1 - wooden_pickaxe: 1 - apple: 1 - birch_planks: 1 - crafting_table: 1 - stone_pickaxe: 1 - oak_log: 8 WEARING: Nothing +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) +Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) +John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? +system: The status of John's action execution: You did not take any action last time. +Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! +Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) +Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! +John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? +system: The status of John's action execution: You did not take any action last time. +Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) +Jack: Looks like I've already crafted a wooden pickaxe and collected some materials! Time to mine some stone now. !goToBlock("stone", 2, 10) +John: Jack, you’ve already got a wooden pickaxe. Start mining that stone so we can make those stone pickaxes! Need me to help? +system: The status of John's action execution: You did not take any action last time. +Jane: Jack, let me know if you need help crafting your wooden pickaxe or gathering materials! I've got plenty of sticks and planks ready to share. +Jack: Alright, I'm at the stone! Time to mine some now. !collectBlocks("stone", 9) +Jane: Jack, let us know when you've got enough stone! I'm ready to help if you need anything. + +Generated Text: +John should mine stone to help Jack gather enough for crafting the stone pickaxes. +---------------------------------------- diff --git a/examples/experimental/minecraft_agents/agent_output_log_20241225_213215.txt b/examples/experimental/minecraft_agents/agent_output_log_20241225_213215.txt new file mode 100644 index 000000000..03dced171 --- /dev/null +++ b/examples/experimental/minecraft_agents/agent_output_log_20241225_213215.txt @@ -0,0 +1,294 @@ +Agent: Jack + +Message History: +system: The status of Jack's action execution: You did not take any action last time. +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? + +Generated Text: +Jack should collect more oak logs to proceed with crafting. +---------------------------------------- +Agent: Jack + +Message History: +system: The status of Jack's action execution: You did not take any action last time. +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? + +Generated Text: +Jane should collect oak logs to help Jack craft the required stone pickaxes. +---------------------------------------- +Agent: Jack + +Message History: +system: The status of Jack's action execution: You did not take any action last time. +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? + +Generated Text: +John should collect oak_logs since Jack needs more and Jane is already set with materials. +---------------------------------------- +Agent: Jack + +Message History: +system: The status of Jack's action execution: You did not take any action last time. +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +John: Who still needs a stone pickaxe? Jack, are you all set yet? +Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! +John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! +John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? + +Generated Text: +Jack should start crafting the stone pickaxes using the materials he already has in his inventory. +---------------------------------------- +Agent: Jack + +Message History: +system: The status of Jack's action execution: You did not take any action last time. +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +John: Who still needs a stone pickaxe? Jack, are you all set yet? +Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! +John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! +John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? + +Generated Text: +Jane should offer her oak logs to Jack directly by using the command `!give("oak_log", 5, Jack)`. +---------------------------------------- +Agent: Jack + +Message History: +system: The status of Jack's action execution: You did not take any action last time. +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +John: Who still needs a stone pickaxe? Jack, are you all set yet? +Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! +John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! +John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? + +Generated Text: +John should suggest Jack use the oak logs he already has to craft his stone pickaxe. +---------------------------------------- +Agent: Jack + +Message History: +system: The status of Jack's action execution: You did not take any action last time. +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +John: Who still needs a stone pickaxe? Jack, are you all set yet? +Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! +John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! +John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? +Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) +system: The status of Jack's action execution: Successfully crafted crafting_table, you now have 1 crafting_table. +Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! +Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) +system: The status of Jack's action execution: Placed crafting_table at (-10, 68, 40). Successfully crafted wooden_pickaxe, you now have 1 wooden_pickaxe. Collected 1 crafting_table. +John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? +Jack: Looks like I've already crafted a wooden pickaxe and collected some materials! Time to mine some stone now. !goToBlock("stone", 2, 10) +system: The status of Jack's action execution: Found stone at (-9, 65, 36). You have reached at -9, 65, 36. +John: Jack, you’ve already got a wooden pickaxe. Start mining that stone so we can make those stone pickaxes! Need me to help? +Jack: Alright, I'm at the stone! Time to mine some now. !collectBlocks("stone", 9) +system: The status of Jack's action execution: Found stone at (-9, 65, 36). You have reached at -9, 65, 36. +Jane: Jack, let me know if you need help crafting your wooden pickaxe or gathering materials! I've got plenty of sticks and planks ready to share. +Jane: Jack, let us know when you've got enough stone! I'm ready to help if you need anything. + +Generated Text: +Jack should mine 9 stone blocks immediately. +---------------------------------------- +Agent: Jack + +Message History: +system: The status of Jack's action execution: You did not take any action last time. +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +John: Who still needs a stone pickaxe? Jack, are you all set yet? +Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! +John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! +John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? +Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) +system: The status of Jack's action execution: Successfully crafted crafting_table, you now have 1 crafting_table. +Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! +Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) +system: The status of Jack's action execution: Placed crafting_table at (-10, 68, 40). Successfully crafted wooden_pickaxe, you now have 1 wooden_pickaxe. Collected 1 crafting_table. +John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? +Jack: Looks like I've already crafted a wooden pickaxe and collected some materials! Time to mine some stone now. !goToBlock("stone", 2, 10) +system: The status of Jack's action execution: Found stone at (-9, 65, 36). You have reached at -9, 65, 36. +John: Jack, you’ve already got a wooden pickaxe. Start mining that stone so we can make those stone pickaxes! Need me to help? +Jack: Alright, I'm at the stone! Time to mine some now. !collectBlocks("stone", 9) +system: The status of Jack's action execution: Found stone at (-9, 65, 36). You have reached at -9, 65, 36. +Jane: Jack, let me know if you need help crafting your wooden pickaxe or gathering materials! I've got plenty of sticks and planks ready to share. +Jane: Jack, let us know when you've got enough stone! I'm ready to help if you need anything. + +Generated Text: +Jane should wait for Jack to finish mining stone and then assist with crafting if needed. +---------------------------------------- +Agent: Jack + +Message History: +system: The status of Jack's action execution: You did not take any action last time. +Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks +system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore +Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? +John: Let’s get moving! I’ll find some logs. !nearbyBlocks +Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? +Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? +Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? +Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. +John: Who still needs a stone pickaxe? Jack, are you all set yet? +Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! +John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory +Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) +system: The status of Jack's action execution: You did not take any action last time. +Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! +John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? +Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) +system: The status of Jack's action execution: Successfully crafted crafting_table, you now have 1 crafting_table. +Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! +Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) +system: The status of Jack's action execution: Placed crafting_table at (-10, 68, 40). Successfully crafted wooden_pickaxe, you now have 1 wooden_pickaxe. Collected 1 crafting_table. +John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? +Jack: Looks like I've already crafted a wooden pickaxe and collected some materials! Time to mine some stone now. !goToBlock("stone", 2, 10) +system: The status of Jack's action execution: Found stone at (-9, 65, 36). You have reached at -9, 65, 36. +John: Jack, you’ve already got a wooden pickaxe. Start mining that stone so we can make those stone pickaxes! Need me to help? +Jack: Alright, I'm at the stone! Time to mine some now. !collectBlocks("stone", 9) +system: The status of Jack's action execution: Found stone at (-9, 65, 36). You have reached at -9, 65, 36. +Jane: Jack, let me know if you need help crafting your wooden pickaxe or gathering materials! I've got plenty of sticks and planks ready to share. +Jane: Jack, let us know when you've got enough stone! I'm ready to help if you need anything. + +Generated Text: +John should mine stone alongside Jack to help gather enough for crafting the stone pickaxes. +---------------------------------------- diff --git a/examples/experimental/minecraft_agents/group_discussion_agents.py b/examples/experimental/minecraft_agents/group_discussion_agents.py index f367a61b2..803f17932 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents.py +++ b/examples/experimental/minecraft_agents/group_discussion_agents.py @@ -2,6 +2,10 @@ import redis.asyncio as aioredis import asyncio import json +import os +import re +import aiofiles +from datetime import datetime from typing import Dict, List, AsyncIterator from aact import Message, NodeFactory from aact.messages import Tick, DataModel, DataModelFactory @@ -157,7 +161,8 @@ Example 26: Come here Jack! Example 27: Okay, I'll come right to you. !goToPlayer(\"John\", 0) Example 28: I'll give some plancks to you. !givePlayer(\"John\", \"birch_plancks\", 5) -Example 29: I'll give a crafting table to you. !givePlayer(\"Jane\", \"crafting_table\", 1) +Example 29: I'll give some stones to you. !givePlayer(\"Jack\", \"stone\", 3) +Example 30: I'll give a crafting table to you. !givePlayer(\"Jane\", \"crafting_table\", 1) """ redis = aioredis.from_url(REDIS_URL) app = FastAPI() @@ -167,6 +172,7 @@ client_data = {} subscribed_channels = set() listener_task = None +OUTPUT_FILE = f"agent_output_log_{datetime.now().strftime('%Y%m%d_%H%M%S')}.txt" @DataModelFactory.register("agent_action") class AgentAction(DataModel): @@ -199,7 +205,8 @@ def _format_message_history(message_history: List[tuple[str, str]]) -> str: @app.on_event("startup") async def startup_event(): await redis.set("conversation_count", 0) - print("Conversation counter initialized to 0.") + await redis.set("status_count", 0) + print("Conversation and status counter initialized to 0.") async def update_client_data(client_id: str, stats: str, inventory: str, visionResponse: str, codeOutput: str): await redis.set(f"client_data:{client_id}", json.dumps({"stats": stats, "inventory": inventory, "visionResponse": visionResponse, "codeOutput": codeOutput})) @@ -208,6 +215,40 @@ async def get_client_data(client_id: str) -> dict: data = await redis.get(f"client_data:{client_id}") return json.loads(data) if data else {} +async def log_to_file(agent_name: str, agent_message_history: List[tuple[str, str]], generated_text: str): + try: + history_str = _format_message_history(agent_message_history) + log_content = ( + f"Agent: {agent_name}\n\n" + f"Message History:\n{history_str}\n\n" + f"Generated Text:\n{generated_text}\n" + f"{'-'*40}\n" + ) + async with aiofiles.open(OUTPUT_FILE, mode="a") as file: + await file.write(log_content) + print(f"Successfully logged output for {agent_name} to {OUTPUT_FILE}.") + except Exception as e: + print(f"Error logging output for {agent_name}: {e}") + +async def check_and_generate(agent_name: str, agent_message_history: List[tuple[str, str]]): + count = len(re.findall(r"system: The status of", _format_message_history(agent_message_history))) + if count % 4 == 0 and count != 0: # Multiple of 4 but not 0 + targets = ["Jack", "Jane", "John"] + for target in targets: + if target == agent_name.lower(): + continue + template = f"What should {target} do immediately next? Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}" + print(f"\033[1;32m{template}\033[0m") + generated_text = await agenerate( + model_name="gpt-4o-2024-11-20", + template=template, + input_values={"agent_message_history": _format_message_history(agent_message_history)}, + temperature=0.7, + output_parser=StrOutputParser(), + ) + await log_to_file(agent_name, agent_message_history, generated_text) + print(f"\033[1;32m{generated_text}\033[0m") # Green bold output + async def redis_listener(): global subscribed_channels pubsub = redis.pubsub() @@ -246,7 +287,7 @@ async def redis_listener(): @app.websocket("/ws/{client_id}") async def websocket_endpoint(websocket: WebSocket, client_id: str): - await update_client_data(client_id, "Test Stats", "Test Inventory", "Test VisionResponse", "Test codeOutput") + await update_client_data(client_id, "Test Stats", "Test Inventory", "Test VisionResponse", "You did not take any action last time.") global listener_task await websocket.accept() connections[client_id] = websocket @@ -254,7 +295,6 @@ async def websocket_endpoint(websocket: WebSocket, client_id: str): # Start the Redis listener only once if not listener_task: listener_task = asyncio.create_task(redis_listener()) - try: while True: client_message = await websocket.receive_text() @@ -360,10 +400,7 @@ async def aact(self, message: AgentAction | Tick) -> AgentAction: if codeOutput: system_message = f"The status of {self.name}'s action execution: {codeOutput}" - last_self_message_index = next( - (i for i in reversed(range(len(self.message_history))) if self.message_history[i][0] == self.name), - -1 - ) + last_self_message_index = next((i for i in reversed(range(len(self.message_history))) if self.message_history[i][0] == self.name), -1) if last_self_message_index != -1: self.message_history.insert(last_self_message_index + 1, ("system", system_message)) else: @@ -394,6 +431,9 @@ async def aact(self, message: AgentAction | Tick) -> AgentAction: output_parser=StrOutputParser(), ) print(f"Generated action for {self.name}: {agent_action}") + + await check_and_generate(self.name, agent_message_history) + if agent_action != "none" and agent_action != "": self.message_history.append((self.name, agent_action)) return AgentAction( diff --git a/examples/experimental/minecraft_agents/group_discussion_agents.toml b/examples/experimental/minecraft_agents/group_discussion_agents.toml index f163d1b2b..32914cdd8 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents.toml @@ -6,7 +6,7 @@ node_name = "Jack" node_class = "llm_agent" [nodes.node_args] -query_interval = 10 +query_interval = 15 output_channel = "Jack" input_text_channels = ["Jane", "John"] input_tick_channel = "tick/secs/1" @@ -28,7 +28,7 @@ node_name = "Jane" node_class = "llm_agent" [nodes.node_args] -query_interval = 14 +query_interval = 19 output_channel = "Jane" input_text_channels = ["Jack", "John"] input_tick_channel = "tick/secs/1" @@ -50,7 +50,7 @@ node_name = "John" node_class = "llm_agent" [nodes.node_args] -query_interval = 20 +query_interval = 23 output_channel = "John" input_text_channels = ["Jack", "Jane"] input_tick_channel = "tick/secs/1" From c854d11d96c413f5b1a00ee85628aacc82f8706f Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:19:16 +0800 Subject: [PATCH 04/29] Delete examples/experimental/minecraft_agents/agent_output_log_20241225_213206.txt --- .../agent_output_log_20241225_213206.txt | 174 ------------------ 1 file changed, 174 deletions(-) delete mode 100644 examples/experimental/minecraft_agents/agent_output_log_20241225_213206.txt diff --git a/examples/experimental/minecraft_agents/agent_output_log_20241225_213206.txt b/examples/experimental/minecraft_agents/agent_output_log_20241225_213206.txt deleted file mode 100644 index 4502a17e0..000000000 --- a/examples/experimental/minecraft_agents/agent_output_log_20241225_213206.txt +++ /dev/null @@ -1,174 +0,0 @@ -Agent: Jane - -Message History: -system: The status of Jane's action execution: You did not take any action last time. -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -system: The status of Jane's action execution: You did not take any action last time. -John: Who still needs a stone pickaxe? Jack, are you all set yet? -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) - -Generated Text: -Jack should wait for the system to confirm the completion of his log collection action before proceeding further. ----------------------------------------- -Agent: Jane - -Message History: -system: The status of Jane's action execution: You did not take any action last time. -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -system: The status of Jane's action execution: You did not take any action last time. -John: Who still needs a stone pickaxe? Jack, are you all set yet? -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) - -Generated Text: -Jane should check her inventory for logs and share them with Jack if she has any. ----------------------------------------- -Agent: Jane - -Message History: -system: The status of Jane's action execution: You did not take any action last time. -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -system: The status of Jane's action execution: You did not take any action last time. -John: Who still needs a stone pickaxe? Jack, are you all set yet? -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) - -Generated Text: -John should collect logs to contribute to crafting materials. ----------------------------------------- -Agent: Jane - -Message History: -system: The status of Jane's action execution: You did not take any action last time. -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -system: The status of Jane's action execution: You did not take any action last time. -John: Who still needs a stone pickaxe? Jack, are you all set yet? -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) -Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) -Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) -John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) -Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! -system: The status of Jane's action execution: You did not take any action last time. -John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? -Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) -Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! -system: The status of Jane's action execution: You did not take any action last time. -Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) -John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? - -Generated Text: -Jack should craft sticks using his oak planks. ----------------------------------------- -Agent: Jane - -Message History: -system: The status of Jane's action execution: You did not take any action last time. -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -system: The status of Jane's action execution: You did not take any action last time. -John: Who still needs a stone pickaxe? Jack, are you all set yet? -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) -Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) -Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) -John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) -Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! -system: The status of Jane's action execution: You did not take any action last time. -John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? -Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) -Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! -system: The status of Jane's action execution: You did not take any action last time. -Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) -John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? - -Generated Text: -Jane should offer Jack sticks to help him craft the wooden pickaxe. ----------------------------------------- -Agent: Jane - -Message History: -system: The status of Jane's action execution: You did not take any action last time. -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -system: The status of Jane's action execution: You did not take any action last time. -John: Who still needs a stone pickaxe? Jack, are you all set yet? -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) -Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) -Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! -system: The status of Jane's action execution: You did not take any action last time. -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) -John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) -Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! -system: The status of Jane's action execution: You did not take any action last time. -John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? -Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) -Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! -system: The status of Jane's action execution: You did not take any action last time. -Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) -John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? - -Generated Text: -John should immediately start collecting more logs to ensure there are enough resources for future crafting. ----------------------------------------- From 81e21cc5f6b323cf7e67f89716b7a6fced79612c Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:19:30 +0800 Subject: [PATCH 05/29] Delete examples/experimental/minecraft_agents/agent_output_log_20241225_213212.txt --- .../agent_output_log_20241225_213212.txt | 195 ------------------ 1 file changed, 195 deletions(-) delete mode 100644 examples/experimental/minecraft_agents/agent_output_log_20241225_213212.txt diff --git a/examples/experimental/minecraft_agents/agent_output_log_20241225_213212.txt b/examples/experimental/minecraft_agents/agent_output_log_20241225_213212.txt deleted file mode 100644 index 93fdbe836..000000000 --- a/examples/experimental/minecraft_agents/agent_output_log_20241225_213212.txt +++ /dev/null @@ -1,195 +0,0 @@ -Agent: John - -Message History: -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -system: The status of John's action execution: You did not take any action last time. -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -system: The status of John's action execution: NEARBY_BLOCKS - grass_block - dirt - oak_leaves - oak_log - grass - stone - copper_ore - birch_leaves - gravel - iron_ore - birch_log - coal_ore - andesite -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -system: The status of John's action execution: You did not take any action last time. -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -John: Who still needs a stone pickaxe? Jack, are you all set yet? -system: The status of John's action execution: You did not take any action last time. -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) -Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) -Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. - -Generated Text: -Jack should craft oak planks from the logs he already collected. ----------------------------------------- -Agent: John - -Message History: -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -system: The status of John's action execution: You did not take any action last time. -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -system: The status of John's action execution: NEARBY_BLOCKS - grass_block - dirt - oak_leaves - oak_log - grass - stone - copper_ore - birch_leaves - gravel - iron_ore - birch_log - coal_ore - andesite -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -system: The status of John's action execution: You did not take any action last time. -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -John: Who still needs a stone pickaxe? Jack, are you all set yet? -system: The status of John's action execution: You did not take any action last time. -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) -Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) -Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. - -Generated Text: -Jane should check Jack's inventory to confirm what materials he still needs. ----------------------------------------- -Agent: John - -Message History: -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -system: The status of John's action execution: You did not take any action last time. -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -system: The status of John's action execution: NEARBY_BLOCKS - grass_block - dirt - oak_leaves - oak_log - grass - stone - copper_ore - birch_leaves - gravel - iron_ore - birch_log - coal_ore - andesite -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -system: The status of John's action execution: You did not take any action last time. -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -John: Who still needs a stone pickaxe? Jack, are you all set yet? -system: The status of John's action execution: You did not take any action last time. -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) -Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) -Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. - -Generated Text: -John should collect additional oak logs to assist Jack with crafting. ----------------------------------------- -Agent: John - -Message History: -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -system: The status of John's action execution: You did not take any action last time. -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -system: The status of John's action execution: NEARBY_BLOCKS - grass_block - dirt - oak_leaves - oak_log - grass - stone - copper_ore - birch_leaves - gravel - iron_ore - birch_log - coal_ore - andesite -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -system: The status of John's action execution: You did not take any action last time. -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -John: Who still needs a stone pickaxe? Jack, are you all set yet? -system: The status of John's action execution: You did not take any action last time. -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) -Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) -Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. -John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory -system: The status of John's action execution: INVENTORY - oak_sapling: 5 - chicken: 1 - oak_planks: 36 - stick: 32 - dirt: 1 - wooden_pickaxe: 1 - apple: 1 - birch_planks: 1 - crafting_table: 1 - stone_pickaxe: 1 - oak_log: 8 WEARING: Nothing -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) -Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) -John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? -system: The status of John's action execution: You did not take any action last time. -Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! -Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) -Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! -John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? -system: The status of John's action execution: You did not take any action last time. -Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) -Jack: Looks like I've already crafted a wooden pickaxe and collected some materials! Time to mine some stone now. !goToBlock("stone", 2, 10) -John: Jack, you’ve already got a wooden pickaxe. Start mining that stone so we can make those stone pickaxes! Need me to help? -system: The status of John's action execution: You did not take any action last time. -Jane: Jack, let me know if you need help crafting your wooden pickaxe or gathering materials! I've got plenty of sticks and planks ready to share. -Jack: Alright, I'm at the stone! Time to mine some now. !collectBlocks("stone", 9) -Jane: Jack, let us know when you've got enough stone! I'm ready to help if you need anything. - -Generated Text: -Jack should mine the stone blocks he is currently at to gather the required materials for crafting stone pickaxes. ----------------------------------------- -Agent: John - -Message History: -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -system: The status of John's action execution: You did not take any action last time. -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -system: The status of John's action execution: NEARBY_BLOCKS - grass_block - dirt - oak_leaves - oak_log - grass - stone - copper_ore - birch_leaves - gravel - iron_ore - birch_log - coal_ore - andesite -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -system: The status of John's action execution: You did not take any action last time. -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -John: Who still needs a stone pickaxe? Jack, are you all set yet? -system: The status of John's action execution: You did not take any action last time. -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) -Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) -Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. -John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory -system: The status of John's action execution: INVENTORY - oak_sapling: 5 - chicken: 1 - oak_planks: 36 - stick: 32 - dirt: 1 - wooden_pickaxe: 1 - apple: 1 - birch_planks: 1 - crafting_table: 1 - stone_pickaxe: 1 - oak_log: 8 WEARING: Nothing -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) -Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) -John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? -system: The status of John's action execution: You did not take any action last time. -Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! -Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) -Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! -John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? -system: The status of John's action execution: You did not take any action last time. -Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) -Jack: Looks like I've already crafted a wooden pickaxe and collected some materials! Time to mine some stone now. !goToBlock("stone", 2, 10) -John: Jack, you’ve already got a wooden pickaxe. Start mining that stone so we can make those stone pickaxes! Need me to help? -system: The status of John's action execution: You did not take any action last time. -Jane: Jack, let me know if you need help crafting your wooden pickaxe or gathering materials! I've got plenty of sticks and planks ready to share. -Jack: Alright, I'm at the stone! Time to mine some now. !collectBlocks("stone", 9) -Jane: Jack, let us know when you've got enough stone! I'm ready to help if you need anything. - -Generated Text: -Jane should confirm if Jack has enough stone for the pickaxes or offer to help mine if he needs assistance. ----------------------------------------- -Agent: John - -Message History: -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -system: The status of John's action execution: You did not take any action last time. -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -system: The status of John's action execution: NEARBY_BLOCKS - grass_block - dirt - oak_leaves - oak_log - grass - stone - copper_ore - birch_leaves - gravel - iron_ore - birch_log - coal_ore - andesite -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -system: The status of John's action execution: You did not take any action last time. -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -John: Who still needs a stone pickaxe? Jack, are you all set yet? -system: The status of John's action execution: You did not take any action last time. -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) -Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) -Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. -John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory -system: The status of John's action execution: INVENTORY - oak_sapling: 5 - chicken: 1 - oak_planks: 36 - stick: 32 - dirt: 1 - wooden_pickaxe: 1 - apple: 1 - birch_planks: 1 - crafting_table: 1 - stone_pickaxe: 1 - oak_log: 8 WEARING: Nothing -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) -Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) -John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? -system: The status of John's action execution: You did not take any action last time. -Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! -Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) -Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! -John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? -system: The status of John's action execution: You did not take any action last time. -Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) -Jack: Looks like I've already crafted a wooden pickaxe and collected some materials! Time to mine some stone now. !goToBlock("stone", 2, 10) -John: Jack, you’ve already got a wooden pickaxe. Start mining that stone so we can make those stone pickaxes! Need me to help? -system: The status of John's action execution: You did not take any action last time. -Jane: Jack, let me know if you need help crafting your wooden pickaxe or gathering materials! I've got plenty of sticks and planks ready to share. -Jack: Alright, I'm at the stone! Time to mine some now. !collectBlocks("stone", 9) -Jane: Jack, let us know when you've got enough stone! I'm ready to help if you need anything. - -Generated Text: -John should mine stone to help Jack gather enough for crafting the stone pickaxes. ----------------------------------------- From 1bb4b991ebbfa3c741938138e9cef13fc4c962c8 Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Fri, 27 Dec 2024 12:19:42 +0800 Subject: [PATCH 06/29] Delete examples/experimental/minecraft_agents/agent_output_log_20241225_213215.txt --- .../agent_output_log_20241225_213215.txt | 294 ------------------ 1 file changed, 294 deletions(-) delete mode 100644 examples/experimental/minecraft_agents/agent_output_log_20241225_213215.txt diff --git a/examples/experimental/minecraft_agents/agent_output_log_20241225_213215.txt b/examples/experimental/minecraft_agents/agent_output_log_20241225_213215.txt deleted file mode 100644 index 03dced171..000000000 --- a/examples/experimental/minecraft_agents/agent_output_log_20241225_213215.txt +++ /dev/null @@ -1,294 +0,0 @@ -Agent: Jack - -Message History: -system: The status of Jack's action execution: You did not take any action last time. -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? - -Generated Text: -Jack should collect more oak logs to proceed with crafting. ----------------------------------------- -Agent: Jack - -Message History: -system: The status of Jack's action execution: You did not take any action last time. -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? - -Generated Text: -Jane should collect oak logs to help Jack craft the required stone pickaxes. ----------------------------------------- -Agent: Jack - -Message History: -system: The status of Jack's action execution: You did not take any action last time. -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? - -Generated Text: -John should collect oak_logs since Jack needs more and Jane is already set with materials. ----------------------------------------- -Agent: Jack - -Message History: -system: The status of Jack's action execution: You did not take any action last time. -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -John: Who still needs a stone pickaxe? Jack, are you all set yet? -Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! -John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! -John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? - -Generated Text: -Jack should start crafting the stone pickaxes using the materials he already has in his inventory. ----------------------------------------- -Agent: Jack - -Message History: -system: The status of Jack's action execution: You did not take any action last time. -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -John: Who still needs a stone pickaxe? Jack, are you all set yet? -Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! -John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! -John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? - -Generated Text: -Jane should offer her oak logs to Jack directly by using the command `!give("oak_log", 5, Jack)`. ----------------------------------------- -Agent: Jack - -Message History: -system: The status of Jack's action execution: You did not take any action last time. -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -John: Who still needs a stone pickaxe? Jack, are you all set yet? -Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! -John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! -John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? - -Generated Text: -John should suggest Jack use the oak logs he already has to craft his stone pickaxe. ----------------------------------------- -Agent: Jack - -Message History: -system: The status of Jack's action execution: You did not take any action last time. -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -John: Who still needs a stone pickaxe? Jack, are you all set yet? -Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! -John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! -John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? -Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) -system: The status of Jack's action execution: Successfully crafted crafting_table, you now have 1 crafting_table. -Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! -Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) -system: The status of Jack's action execution: Placed crafting_table at (-10, 68, 40). Successfully crafted wooden_pickaxe, you now have 1 wooden_pickaxe. Collected 1 crafting_table. -John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? -Jack: Looks like I've already crafted a wooden pickaxe and collected some materials! Time to mine some stone now. !goToBlock("stone", 2, 10) -system: The status of Jack's action execution: Found stone at (-9, 65, 36). You have reached at -9, 65, 36. -John: Jack, you’ve already got a wooden pickaxe. Start mining that stone so we can make those stone pickaxes! Need me to help? -Jack: Alright, I'm at the stone! Time to mine some now. !collectBlocks("stone", 9) -system: The status of Jack's action execution: Found stone at (-9, 65, 36). You have reached at -9, 65, 36. -Jane: Jack, let me know if you need help crafting your wooden pickaxe or gathering materials! I've got plenty of sticks and planks ready to share. -Jane: Jack, let us know when you've got enough stone! I'm ready to help if you need anything. - -Generated Text: -Jack should mine 9 stone blocks immediately. ----------------------------------------- -Agent: Jack - -Message History: -system: The status of Jack's action execution: You did not take any action last time. -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -John: Who still needs a stone pickaxe? Jack, are you all set yet? -Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! -John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! -John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? -Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) -system: The status of Jack's action execution: Successfully crafted crafting_table, you now have 1 crafting_table. -Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! -Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) -system: The status of Jack's action execution: Placed crafting_table at (-10, 68, 40). Successfully crafted wooden_pickaxe, you now have 1 wooden_pickaxe. Collected 1 crafting_table. -John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? -Jack: Looks like I've already crafted a wooden pickaxe and collected some materials! Time to mine some stone now. !goToBlock("stone", 2, 10) -system: The status of Jack's action execution: Found stone at (-9, 65, 36). You have reached at -9, 65, 36. -John: Jack, you’ve already got a wooden pickaxe. Start mining that stone so we can make those stone pickaxes! Need me to help? -Jack: Alright, I'm at the stone! Time to mine some now. !collectBlocks("stone", 9) -system: The status of Jack's action execution: Found stone at (-9, 65, 36). You have reached at -9, 65, 36. -Jane: Jack, let me know if you need help crafting your wooden pickaxe or gathering materials! I've got plenty of sticks and planks ready to share. -Jane: Jack, let us know when you've got enough stone! I'm ready to help if you need anything. - -Generated Text: -Jane should wait for Jack to finish mining stone and then assist with crafting if needed. ----------------------------------------- -Agent: Jack - -Message History: -system: The status of Jack's action execution: You did not take any action last time. -Jack: Looks like we need to craft three stone pickaxes! Let's get started. I'll grab some logs first. !nearbyBlocks -system: The status of Jack's action execution: NEARBY_BLOCKS - oak_leaves - oak_log - grass - grass_block - dirt - stone - birch_leaves - coal_ore - pumpkin - copper_ore - birch_log - gravel - granite - andesite - lapis_ore -Jane: Let’s get started! First, we need some logs to begin crafting. Who’s ready to chop some trees? -John: Let’s get moving! I’ll find some logs. !nearbyBlocks -Jack: Looks like I already have some logs in my inventory! I'll craft some planks first. !craftRecipe("oak_planks", 4) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -Jane: Looks like I already have a stone pickaxe in my inventory. Who hasn’t crafted theirs yet? -Jack: Looks like I need more logs to keep crafting. I'll grab some now! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -John: Looks like I’ve already got a stone pickaxe in my inventory too. Who still needs one? -Jane: Looks like I already have a stone pickaxe, so I’m all set! Who still needs materials? -Jack: Looks like I need some more logs for crafting. Let me grab a few real quick! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: Not enough oak_log to craft 4, crafted 3. You now have 16 oak_planks. -John: Who still needs a stone pickaxe? Jack, are you all set yet? -Jack: Looks like I need more oak logs to keep going. I'll grab some right now! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, do you still need help crafting your stone pickaxe? I’ve got materials if you’re missing anything. -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs first! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, need any help with those logs? I’ve got plenty if you’re short on materials. Let me know! -John: Jack, you've said you need more oak logs like three times now. Did you finally get enough, or do you need me to help? !inventory -Jack: Looks like I still need to craft my stone pickaxe. Let me grab more oak logs real quick! !collectBlocks("oak_log", 5) -system: The status of Jack's action execution: You did not take any action last time. -Jane: Jack, do you actually need help? I’ve got plenty of oak logs and materials ready to share. Let me know! -John: Jack, you already have 8 oak logs in your inventory. Do you really need more, or should we start crafting? -Jack: John, I already have 8 oak logs in my inventory! Let me start crafting. !craftRecipe("crafting_table", 1) -system: The status of Jack's action execution: Successfully crafted crafting_table, you now have 1 crafting_table. -Jane: Jack, sounds like you're finally crafting that crafting table! Let us know when you're ready to move on—I'm here to help if you need anything! -Jack: Alright, I've got my crafting table ready! Time to craft a wooden pickaxe next. !craftRecipe("wooden_pickaxe", 1) -system: The status of Jack's action execution: Placed crafting_table at (-10, 68, 40). Successfully crafted wooden_pickaxe, you now have 1 wooden_pickaxe. Collected 1 crafting_table. -John: Jack, since you already crafted a crafting table, let’s move on to the next step! Do you need me to help with sticks or anything else? -Jack: Looks like I've already crafted a wooden pickaxe and collected some materials! Time to mine some stone now. !goToBlock("stone", 2, 10) -system: The status of Jack's action execution: Found stone at (-9, 65, 36). You have reached at -9, 65, 36. -John: Jack, you’ve already got a wooden pickaxe. Start mining that stone so we can make those stone pickaxes! Need me to help? -Jack: Alright, I'm at the stone! Time to mine some now. !collectBlocks("stone", 9) -system: The status of Jack's action execution: Found stone at (-9, 65, 36). You have reached at -9, 65, 36. -Jane: Jack, let me know if you need help crafting your wooden pickaxe or gathering materials! I've got plenty of sticks and planks ready to share. -Jane: Jack, let us know when you've got enough stone! I'm ready to help if you need anything. - -Generated Text: -John should mine stone alongside Jack to help gather enough for crafting the stone pickaxes. ----------------------------------------- From 6a671438f88f0f2b33c285ea3a49a4b6d5a74064 Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Thu, 26 Dec 2024 23:20:05 -0500 Subject: [PATCH 07/29] add theory of mind (goal inference) --- .../group_discussion_agents.py | 3 +- .../group_discussion_agents.toml | 40 +++++++++---------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/examples/experimental/minecraft_agents/group_discussion_agents.py b/examples/experimental/minecraft_agents/group_discussion_agents.py index 803f17932..d2249894f 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents.py +++ b/examples/experimental/minecraft_agents/group_discussion_agents.py @@ -2,7 +2,6 @@ import redis.asyncio as aioredis import asyncio import json -import os import re import aiofiles from datetime import datetime @@ -160,7 +159,7 @@ Example 26: Come here Jack! Example 27: Okay, I'll come right to you. !goToPlayer(\"John\", 0) -Example 28: I'll give some plancks to you. !givePlayer(\"John\", \"birch_plancks\", 5) +Example 28: I'll give some plancks to you. !givePlayer(\"John\", \"stick\", 4) Example 29: I'll give some stones to you. !givePlayer(\"Jack\", \"stone\", 3) Example 30: I'll give a crafting table to you. !givePlayer(\"Jane\", \"crafting_table\", 1) """ diff --git a/examples/experimental/minecraft_agents/group_discussion_agents.toml b/examples/experimental/minecraft_agents/group_discussion_agents.toml index 32914cdd8..439a86427 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents.toml @@ -11,15 +11,14 @@ output_channel = "Jack" input_text_channels = ["Jane", "John"] input_tick_channel = "tick/secs/1" goal = """ -You and your friends need to craft a total of 3 stone pickaxes. -The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 2 pieces. +You and your friends need to craft a "stone_pickaxe". YOUR TASK IS TO CRAFT A "crafting_table". +After crafting one "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !goToPlayer(\"John\", 0) to go to John's location. +Then, use the command !placeHere(\"crafting_table\") to give John the "crafting_table". Afterward, please use the command !moveAway(5) once to maintain distance. + +The complete process for crafting a "crafting_table" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. 2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use 4 planks to craft a "crafting_table"!!! -4. Use 2 planks to create 4 "stick"!!!! -5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe"!!! -6. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before obtaining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don’t, type !craftable to check if you can craft a "wooden_pickaxe". -7. Open the "crafting_table" and use 3 pieces of stone and 2 sticks to craft a "stone_pickaxe".""" +3. Use 4 planks to craft a "crafting_table".""" model_name = "gpt-4o-2024-11-20" agent_name = "Jack" @@ -33,15 +32,14 @@ output_channel = "Jane" input_text_channels = ["Jack", "John"] input_tick_channel = "tick/secs/1" goal = """ -You and your friends need to craft a total of 3 stone pickaxes. -The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 2 pieces. +You and your friends need to craft a "stone_pickaxe". YOUR TASK IS TO CRAFT 4 "stick". +After crafting 4 "stick" yourself (If the condition is that the inventory shows stick: 4, rather than just having previously outputted !craftRecipe("stick", 4)), use the command !goToPlayer("John", 0) to go to John's location. +Then, use the command `!givePlayer(\"John\", \"stick\", 4)` to give John 4 "stick" (number like 4 does not need to use double quotation marks). Afterward, please use the command !moveAway(5) once to maintain distance. + +The complete process for crafting 4 "stick" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. 2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use 4 planks to craft a "crafting_table"!!! -4. Use 2 planks to create 4 "stick"!!!! -5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe"!!! -6. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before obtaining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don’t, type !craftable to check if you can craft a "wooden_pickaxe". -7. Open the "crafting_table" and use 3 pieces of stone and 2 sticks to craft a "stone_pickaxe".""" +3. Use 2 planks to create 4 "stick".""" model_name = "gpt-4o-2024-11-20" agent_name = "Jane" @@ -55,13 +53,15 @@ output_channel = "John" input_text_channels = ["Jack", "Jane"] input_tick_channel = "tick/secs/1" goal = """ -You and your friends need to craft a total of 3 stone pickaxes. +You and your friends need to craft a "stone_pickaxe". Jack will help you craft a "crafting_table" and give it to you, while Jane will craft 4 "stick" and give them to you. +Before this, you should collect some logs and process them into at least 3 planks. Once you have received the "crafting_table" and 4 "stick", you can proceed to craft the "stone_pickaxe" as follows. + The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): 1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 2 pieces. 2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use 4 planks to craft a "crafting_table"!!! -4. Use 2 planks to create 4 "stick"!!!! -5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe"!!! +3. Use 4 planks to craft a "crafting_table". +4. Use 2 planks to create 4 "stick". +5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe". 6. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before obtaining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don’t, type !craftable to check if you can craft a "wooden_pickaxe". 7. Open the "crafting_table" and use 3 pieces of stone and 2 sticks to craft a "stone_pickaxe".""" model_name = "gpt-4o-2024-11-20" From fe355fd792f2909207b80540f683075701f53784 Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Fri, 27 Dec 2024 22:08:47 -0500 Subject: [PATCH 08/29] toml files for different tasks --- .../group_discussion_agents_boat.toml | 81 ++++++++++++++++++ .../group_discussion_agents_chest.toml | 80 ++++++++++++++++++ ...group_discussion_agents_stone_pickaxe.toml | 84 +++++++++++++++++++ 3 files changed, 245 insertions(+) create mode 100644 examples/experimental/minecraft_agents/group_discussion_agents_boat.toml create mode 100644 examples/experimental/minecraft_agents/group_discussion_agents_chest.toml create mode 100644 examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml b/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml new file mode 100644 index 000000000..985aa2763 --- /dev/null +++ b/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml @@ -0,0 +1,81 @@ +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft a "chest" and a "boat". YOUR TASK IS TO CRAFT A "crafting_table". +After crafting a "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !placeHere(\"crafting_table\"). + +The complete process for crafting a "crafting_table" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use 4 planks to craft a "crafting_table".""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft a "chest" and a "boat". YOUR TASK IS TO CRAFT ONE "chest". +Once you have crafted at least 8 planks (If the condition is that the inventory shows oak_planks: 8, birch_planks: 8 or spruce_planks: 8), use the command !goToPlayer("Jack", 0) to go to Jack's location. +Then, use the command !goToBlock("crafting_table", 10, 20) to locate a nearby "crafting_table". Next, use !craftRecipe("chest", 1) to craft a chest, then use the command !placeHere(\"chest\") to place it. + +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect at least 2 logs, such as "oak_log", "spruce_log" or "birch_log". +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. After finding Jack and a nearby "crafting_table", use 8 planks to create a "chest".""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft a "chest" and a "boat". YOUR TASK IS TO CRAFT ONE BOAT. +Once you have crafted at least 5 planks (If the condition is that the inventory shows oak_planks: 5, birch_planks: 5 or spruce_planks: 5), use the command !goToPlayer("Jack", 0) to go to Jack's location. +Then, use the command !goToBlock("crafting_table", 10, 20) to locate a nearby "crafting_table". Next, use !craftRecipe("oak_boat", 1), !craftRecipe("birch_boat", 1) or !craftRecipe("spruce_boat", 1) to craft a boat. +After that, use the command !goToBlock("chest", 10, 20) to locate a nearby "chest", and then use !putInChest("oak_boat", 1), !putInChest("birch_boat", 1) or !putInChest("spruce_boat", 1) to place the boat in the chest. + +The complete process for crafting a boat in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect at least 2 logs, such as "oak_log", "spruce_log" or "birch_log". +2. Convert the logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. After finding Jack and a nearby "crafting_table", use 5 planks to create a boat.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" \ No newline at end of file diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml b/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml new file mode 100644 index 000000000..1a243e28b --- /dev/null +++ b/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml @@ -0,0 +1,80 @@ +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft 2 "chest". YOUR TASK IS TO CRAFT A "crafting_table". +After crafting a "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !placeHere(\"crafting_table\"). + +The complete process for crafting a "crafting_table" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use 4 planks to craft a "crafting_table".""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft 2 "chest". YOUR TASK IS TO CRAFT ONE "chest". +Once you have crafted at least 8 planks (If the condition is that the inventory shows oak_planks: 8, birch_planks: 8 or spruce_planks: 8), use the command !goToPlayer("Jack", 0) to go to Jack's location. +Then, use the command !goToBlock("crafting_table", 10, 20) to locate a nearby "crafting_table". Next, use !craftRecipe("chest", 1) to craft a chest, then use the command !placeHere(\"chest\") to place it. + +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect at least 2 logs, such as "oak_log", "spruce_log" or "birch_log". +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. After finding Jack and a nearby "crafting_table", use 8 planks to create a "chest".""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft 2 "chest". YOUR TASK IS TO CRAFT ONE "chest". +Once you have crafted at least 8 planks (If the condition is that the inventory shows oak_planks: 8, birch_planks: 8 or spruce_planks: 8), use the command !goToPlayer("Jack", 0) to go to Jack's location. +Then, use the command !goToBlock("crafting_table", 10, 20) to locate a nearby "crafting_table". Next, use !craftRecipe("chest", 1) to craft a chest, then use the command !placeHere(\"chest\") to place it. + +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect at least 2 logs, such as "oak_log", "spruce_log" or "birch_log". +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. After finding Jack and a nearby "crafting_table", use 8 planks to create a "chest".""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" \ No newline at end of file diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml b/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml new file mode 100644 index 000000000..439a86427 --- /dev/null +++ b/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml @@ -0,0 +1,84 @@ +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft a "stone_pickaxe". YOUR TASK IS TO CRAFT A "crafting_table". +After crafting one "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !goToPlayer(\"John\", 0) to go to John's location. +Then, use the command !placeHere(\"crafting_table\") to give John the "crafting_table". Afterward, please use the command !moveAway(5) once to maintain distance. + +The complete process for crafting a "crafting_table" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use 4 planks to craft a "crafting_table".""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft a "stone_pickaxe". YOUR TASK IS TO CRAFT 4 "stick". +After crafting 4 "stick" yourself (If the condition is that the inventory shows stick: 4, rather than just having previously outputted !craftRecipe("stick", 4)), use the command !goToPlayer("John", 0) to go to John's location. +Then, use the command `!givePlayer(\"John\", \"stick\", 4)` to give John 4 "stick" (number like 4 does not need to use double quotation marks). Afterward, please use the command !moveAway(5) once to maintain distance. + +The complete process for crafting 4 "stick" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use 2 planks to create 4 "stick".""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft a "stone_pickaxe". Jack will help you craft a "crafting_table" and give it to you, while Jane will craft 4 "stick" and give them to you. +Before this, you should collect some logs and process them into at least 3 planks. Once you have received the "crafting_table" and 4 "stick", you can proceed to craft the "stone_pickaxe" as follows. + +The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 2 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use 4 planks to craft a "crafting_table". +4. Use 2 planks to create 4 "stick". +5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe". +6. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before obtaining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don’t, type !craftable to check if you can craft a "wooden_pickaxe". +7. Open the "crafting_table" and use 3 pieces of stone and 2 sticks to craft a "stone_pickaxe".""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" \ No newline at end of file From f3c914b9f5baa43dd687364c24aaee0d2f1a9e8d Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Thu, 9 Jan 2025 19:18:31 +0800 Subject: [PATCH 09/29] added some new ToM questions --- .../group_discussion_agents.py | 71 ++++++++++++++++--- 1 file changed, 63 insertions(+), 8 deletions(-) diff --git a/examples/experimental/minecraft_agents/group_discussion_agents.py b/examples/experimental/minecraft_agents/group_discussion_agents.py index d2249894f..824479d2e 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents.py +++ b/examples/experimental/minecraft_agents/group_discussion_agents.py @@ -234,19 +234,74 @@ async def check_and_generate(agent_name: str, agent_message_history: List[tuple[ if count % 4 == 0 and count != 0: # Multiple of 4 but not 0 targets = ["Jack", "Jane", "John"] for target in targets: - if target == agent_name.lower(): - continue - template = f"What should {target} do immediately next? Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}" - print(f"\033[1;32m{template}\033[0m") - generated_text = await agenerate( + # if target == agent_name.lower(): + # continue # skip themselves + + template_1 = f"You are {agent_name}. What should {target} do immediately next? Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}" + print(f"\033[1;32m{template_1}\033[0m") + generated_text_1 = await agenerate( + model_name="gpt-4o-2024-11-20", + template=template_1, + input_values={"agent_message_history": _format_message_history(agent_message_history)}, + temperature=0.7, + output_parser=StrOutputParser(), + ) + await log_to_file(agent_name, agent_message_history, generated_text_1) + + template_2 = f"You are {agent_name}. What is {target} doing right now? Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}" + print(f"\033[1;32m{template_2}\033[0m") + generated_text_2 = await agenerate( + model_name="gpt-4o-2024-11-20", + template=template_2, + input_values={"agent_message_history": _format_message_history(agent_message_history)}, + temperature=0.7, + output_parser=StrOutputParser(), + ) + await log_to_file(agent_name, agent_message_history, generated_text_2) + + template_3 = f"You are {agent_name}. What materials or tools does {target} currently have? Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}" + print(f"\033[1;32m{template_3}\033[0m") + generated_text_3 = await agenerate( + model_name="gpt-4o-2024-11-20", + template=template_3, + input_values={"agent_message_history": _format_message_history(agent_message_history)}, + temperature=0.7, + output_parser=StrOutputParser(), + ) + await log_to_file(agent_name, agent_message_history, generated_text_3) + + template_4 = f"You are {agent_name}. Is {target} in a cooperative, competitive, or independent relationship with you? Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}" + print(f"\033[1;32m{template_4}\033[0m") + generated_text_4 = await agenerate( + model_name="gpt-4o-2024-11-20", + template=template_4, + input_values={"agent_message_history": _format_message_history(agent_message_history)}, + temperature=0.7, + output_parser=StrOutputParser(), + ) + await log_to_file(agent_name, agent_message_history, generated_text_4) + + template_5 = f"""You are {agent_name}. What is {target} seeing right now? If you don’t know, please answer \"I don’t know.\" Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}""" + print(f"\033[1;32m{template_5}\033[0m") + generated_text_5 = await agenerate( + model_name="gpt-4o-2024-11-20", + template=template_5, + input_values={"agent_message_history": _format_message_history(agent_message_history)}, + temperature=0.7, + output_parser=StrOutputParser(), + ) + await log_to_file(agent_name, agent_message_history, generated_text_5) + + template_6 = f"""You are {agent_name}. What steps does {target} still need to take to complete the final goal? Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}""" + print(f"\033[1;32m{template_6}\033[0m") + generated_text_6 = await agenerate( model_name="gpt-4o-2024-11-20", - template=template, + template=template_6, input_values={"agent_message_history": _format_message_history(agent_message_history)}, temperature=0.7, output_parser=StrOutputParser(), ) - await log_to_file(agent_name, agent_message_history, generated_text) - print(f"\033[1;32m{generated_text}\033[0m") # Green bold output + await log_to_file(agent_name, agent_message_history, generated_text_6) async def redis_listener(): global subscribed_channels From 3e99c74f08bb00774ae7650cccf30da95da915b3 Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Fri, 10 Jan 2025 11:39:49 +0800 Subject: [PATCH 10/29] improve log --- .../group_discussion_agents.py | 42 ++++++++++++------- 1 file changed, 27 insertions(+), 15 deletions(-) diff --git a/examples/experimental/minecraft_agents/group_discussion_agents.py b/examples/experimental/minecraft_agents/group_discussion_agents.py index 824479d2e..1043bcd55 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents.py +++ b/examples/experimental/minecraft_agents/group_discussion_agents.py @@ -1,4 +1,5 @@ from fastapi import FastAPI, WebSocket, WebSocketDisconnect +from pathlib import Path import redis.asyncio as aioredis import asyncio import json @@ -171,7 +172,13 @@ client_data = {} subscribed_channels = set() listener_task = None -OUTPUT_FILE = f"agent_output_log_{datetime.now().strftime('%Y%m%d_%H%M%S')}.txt" +LOG_DIR = Path(f"agent_logs_{datetime.now().strftime('%Y%m%d_%H%M')}") +LOG_DIR.mkdir(exist_ok=True) +AGENT_FILES = { + "Jane": LOG_DIR / "jane_log.txt", + "John": LOG_DIR / "john_log.txt", + "Jack": LOG_DIR / "jack_log.txt" +} @DataModelFactory.register("agent_action") class AgentAction(DataModel): @@ -216,16 +223,19 @@ async def get_client_data(client_id: str) -> dict: async def log_to_file(agent_name: str, agent_message_history: List[tuple[str, str]], generated_text: str): try: + if agent_name not in AGENT_FILES: + raise ValueError(f"Unknown agent name: {agent_name}") + output_file = AGENT_FILES[agent_name] history_str = _format_message_history(agent_message_history) log_content = ( f"Agent: {agent_name}\n\n" f"Message History:\n{history_str}\n\n" - f"Generated Text:\n{generated_text}\n" + f"ToM Q&A:\n{generated_text}\n" f"{'-'*40}\n" ) - async with aiofiles.open(OUTPUT_FILE, mode="a") as file: + async with aiofiles.open(output_file, mode="a") as file: await file.write(log_content) - print(f"Successfully logged output for {agent_name} to {OUTPUT_FILE}.") + print(f"Successfully logged output for {agent_name} to {output_file}.") except Exception as e: print(f"Error logging output for {agent_name}: {e}") @@ -246,7 +256,6 @@ async def check_and_generate(agent_name: str, agent_message_history: List[tuple[ temperature=0.7, output_parser=StrOutputParser(), ) - await log_to_file(agent_name, agent_message_history, generated_text_1) template_2 = f"You are {agent_name}. What is {target} doing right now? Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}" print(f"\033[1;32m{template_2}\033[0m") @@ -257,7 +266,6 @@ async def check_and_generate(agent_name: str, agent_message_history: List[tuple[ temperature=0.7, output_parser=StrOutputParser(), ) - await log_to_file(agent_name, agent_message_history, generated_text_2) template_3 = f"You are {agent_name}. What materials or tools does {target} currently have? Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}" print(f"\033[1;32m{template_3}\033[0m") @@ -268,7 +276,6 @@ async def check_and_generate(agent_name: str, agent_message_history: List[tuple[ temperature=0.7, output_parser=StrOutputParser(), ) - await log_to_file(agent_name, agent_message_history, generated_text_3) template_4 = f"You are {agent_name}. Is {target} in a cooperative, competitive, or independent relationship with you? Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}" print(f"\033[1;32m{template_4}\033[0m") @@ -279,7 +286,6 @@ async def check_and_generate(agent_name: str, agent_message_history: List[tuple[ temperature=0.7, output_parser=StrOutputParser(), ) - await log_to_file(agent_name, agent_message_history, generated_text_4) template_5 = f"""You are {agent_name}. What is {target} seeing right now? If you don’t know, please answer \"I don’t know.\" Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}""" print(f"\033[1;32m{template_5}\033[0m") @@ -290,7 +296,6 @@ async def check_and_generate(agent_name: str, agent_message_history: List[tuple[ temperature=0.7, output_parser=StrOutputParser(), ) - await log_to_file(agent_name, agent_message_history, generated_text_5) template_6 = f"""You are {agent_name}. What steps does {target} still need to take to complete the final goal? Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}""" print(f"\033[1;32m{template_6}\033[0m") @@ -301,7 +306,8 @@ async def check_and_generate(agent_name: str, agent_message_history: List[tuple[ temperature=0.7, output_parser=StrOutputParser(), ) - await log_to_file(agent_name, agent_message_history, generated_text_6) + generated_text = template_1 + "\n" + generated_text_1 + "\n" + template_2 + "\n" + generated_text_2 + "\n" + template_3 + "\n" + generated_text_3 + "\n" + template_4 + "\n" + generated_text_4 + "\n" + template_5 + "\n" + generated_text_5 + "\n" + template_6 + "\n" + generated_text_6 + await log_to_file(agent_name, agent_message_history, generated_text) async def redis_listener(): global subscribed_channels @@ -452,17 +458,23 @@ async def aact(self, message: AgentAction | Tick) -> AgentAction: visionResponse = client_info.get("visionResponse", "") codeOutput = client_info.get("codeOutput", "").removeprefix("Code output: ") - if codeOutput: - system_message = f"The status of {self.name}'s action execution: {codeOutput}" + if codeOutput: # action execution last_self_message_index = next((i for i in reversed(range(len(self.message_history))) if self.message_history[i][0] == self.name), -1) if last_self_message_index != -1: - self.message_history.insert(last_self_message_index + 1, ("system", system_message)) + self.message_history.insert(last_self_message_index + 1, ("system", f"The status of {self.name}'s action execution: {codeOutput}")) else: - self.message_history.append(("system", system_message)) + self.message_history.append(("system", f"The status of {self.name}'s action execution: {codeOutput}")) + + if visionResponse: # add image description to the memory + last_self_message_index = next((i for i in reversed(range(len(self.message_history))) if self.message_history[i][0] == self.name), -1) + if last_self_message_index != -1: + self.message_history.insert(last_self_message_index + 1, ("system", f"The following is the description of the game view {self.name} is seeing: {visionResponse}")) + else: + self.message_history.append(("system", f"The following is the description of the game view {self.name} is seeing: {visionResponse}")) agent_message_history = [ (speaker, message) for speaker, message in self.message_history - if speaker != "system" or (speaker == "system" and f"{self.name}'s action execution" in message) + if speaker != "system" or (speaker == "system" and self.name in message) ] agent_action: str = await agenerate( From 1b29ee2a54642c30bc457e09679202753f2c6ebd Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Sat, 11 Jan 2025 19:58:05 +0800 Subject: [PATCH 11/29] read images from google cloud storage; add openai_api_predict_async --- .../group_discussion_agents.py | 102 ++++++++---------- 1 file changed, 42 insertions(+), 60 deletions(-) diff --git a/examples/experimental/minecraft_agents/group_discussion_agents.py b/examples/experimental/minecraft_agents/group_discussion_agents.py index 1043bcd55..6340861a9 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents.py +++ b/examples/experimental/minecraft_agents/group_discussion_agents.py @@ -15,6 +15,12 @@ from sotopia.generation_utils.generate import StrOutputParser from sotopia.messages import ActionType from pydantic import Field +import openai +import os +from openai import AsyncOpenAI + +openai.api_key = os.environ["OPENAI_API_KEY"] +client = AsyncOpenAI() REDIS_URL = "redis://localhost:6379/0" COMMAND_DOCS = """ @@ -208,14 +214,27 @@ def _format_message_history(message_history: List[tuple[str, str]]) -> str: (f"{speaker}: {message}") for speaker, message in message_history ) +async def openai_api_predict_async(template, image_url): + response = await client.chat.completions.create( + model="gpt-4o-2024-11-20", + messages=[{ + "role": "user", + "content": [ + {"type": "text", "text": template,}, + {"type": "image_url", "image_url": {"url": image_url},}, + ], + }], + ) + return response.choices[0].message.content + @app.on_event("startup") async def startup_event(): await redis.set("conversation_count", 0) await redis.set("status_count", 0) print("Conversation and status counter initialized to 0.") -async def update_client_data(client_id: str, stats: str, inventory: str, visionResponse: str, codeOutput: str): - await redis.set(f"client_data:{client_id}", json.dumps({"stats": stats, "inventory": inventory, "visionResponse": visionResponse, "codeOutput": codeOutput})) +async def update_client_data(client_id: str, stats: str, inventory: str, visionResponse: str, codeOutput: str, latestImageUri: str): + await redis.set(f"client_data:{client_id}", json.dumps({"stats": stats, "inventory": inventory, "visionResponse": visionResponse, "codeOutput": codeOutput, "latestImageUri": latestImageUri})) async def get_client_data(client_id: str) -> dict: data = await redis.get(f"client_data:{client_id}") @@ -239,73 +258,35 @@ async def log_to_file(agent_name: str, agent_message_history: List[tuple[str, st except Exception as e: print(f"Error logging output for {agent_name}: {e}") -async def check_and_generate(agent_name: str, agent_message_history: List[tuple[str, str]]): +async def check_and_generate(agent_name: str, agent_message_history: List[tuple[str, str]], latestImageUri: str): # ToM questions count = len(re.findall(r"system: The status of", _format_message_history(agent_message_history))) if count % 4 == 0 and count != 0: # Multiple of 4 but not 0 targets = ["Jack", "Jane", "John"] for target in targets: - # if target == agent_name.lower(): - # continue # skip themselves - - template_1 = f"You are {agent_name}. What should {target} do immediately next? Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}" + template_1 = f"You are {agent_name}. What should {target} do immediately next? Respond in one concise sentence." print(f"\033[1;32m{template_1}\033[0m") - generated_text_1 = await agenerate( - model_name="gpt-4o-2024-11-20", - template=template_1, - input_values={"agent_message_history": _format_message_history(agent_message_history)}, - temperature=0.7, - output_parser=StrOutputParser(), - ) + generated_text_1 = await openai_api_predict_async(template_1 + f" Here is the conversation history: {_format_message_history(agent_message_history)}", latestImageUri) - template_2 = f"You are {agent_name}. What is {target} doing right now? Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}" + template_2 = f"You are {agent_name}. What is {target} doing right now? Respond in one concise sentence." print(f"\033[1;32m{template_2}\033[0m") - generated_text_2 = await agenerate( - model_name="gpt-4o-2024-11-20", - template=template_2, - input_values={"agent_message_history": _format_message_history(agent_message_history)}, - temperature=0.7, - output_parser=StrOutputParser(), - ) + generated_text_2 = await openai_api_predict_async(template_2 + f" Here is the conversation history: {_format_message_history(agent_message_history)}", latestImageUri) - template_3 = f"You are {agent_name}. What materials or tools does {target} currently have? Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}" + template_3 = f"You are {agent_name}. What materials or tools does {target} currently have? Respond in one concise sentence." print(f"\033[1;32m{template_3}\033[0m") - generated_text_3 = await agenerate( - model_name="gpt-4o-2024-11-20", - template=template_3, - input_values={"agent_message_history": _format_message_history(agent_message_history)}, - temperature=0.7, - output_parser=StrOutputParser(), - ) + generated_text_3 = await openai_api_predict_async(template_3 + f" Here is the conversation history: {_format_message_history(agent_message_history)}", latestImageUri) - template_4 = f"You are {agent_name}. Is {target} in a cooperative, competitive, or independent relationship with you? Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}" + template_4 = f"You are {agent_name}. Is {target} in a cooperative, competitive, or independent relationship with you? Respond in one concise sentence." print(f"\033[1;32m{template_4}\033[0m") - generated_text_4 = await agenerate( - model_name="gpt-4o-2024-11-20", - template=template_4, - input_values={"agent_message_history": _format_message_history(agent_message_history)}, - temperature=0.7, - output_parser=StrOutputParser(), - ) + generated_text_4= await openai_api_predict_async(template_4 + f" Here is the conversation history: {_format_message_history(agent_message_history)}", latestImageUri) - template_5 = f"""You are {agent_name}. What is {target} seeing right now? If you don’t know, please answer \"I don’t know.\" Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}""" + template_5 = f"""You are {agent_name}. What is {target} seeing right now? If you don’t know, please answer \"I don’t know.\" Respond in one concise sentence.""" print(f"\033[1;32m{template_5}\033[0m") - generated_text_5 = await agenerate( - model_name="gpt-4o-2024-11-20", - template=template_5, - input_values={"agent_message_history": _format_message_history(agent_message_history)}, - temperature=0.7, - output_parser=StrOutputParser(), - ) + generated_text_5 = await openai_api_predict_async(template_5 + f" Here is the conversation history: {_format_message_history(agent_message_history)}", latestImageUri) - template_6 = f"""You are {agent_name}. What steps does {target} still need to take to complete the final goal? Respond in one concise sentence. Here is the conversation history: {{agent_message_history}}""" + template_6 = f"You are {agent_name}. What steps does {target} still need to take to complete the final goal? Respond in one concise sentence." print(f"\033[1;32m{template_6}\033[0m") - generated_text_6 = await agenerate( - model_name="gpt-4o-2024-11-20", - template=template_6, - input_values={"agent_message_history": _format_message_history(agent_message_history)}, - temperature=0.7, - output_parser=StrOutputParser(), - ) + generated_text_6 = await openai_api_predict_async(template_6 + f" Here is the conversation history: {_format_message_history(agent_message_history)}", latestImageUri) + generated_text = template_1 + "\n" + generated_text_1 + "\n" + template_2 + "\n" + generated_text_2 + "\n" + template_3 + "\n" + generated_text_3 + "\n" + template_4 + "\n" + generated_text_4 + "\n" + template_5 + "\n" + generated_text_5 + "\n" + template_6 + "\n" + generated_text_6 await log_to_file(agent_name, agent_message_history, generated_text) @@ -347,7 +328,7 @@ async def redis_listener(): @app.websocket("/ws/{client_id}") async def websocket_endpoint(websocket: WebSocket, client_id: str): - await update_client_data(client_id, "Test Stats", "Test Inventory", "Test VisionResponse", "You did not take any action last time.") + await update_client_data(client_id, "None", "None", "None", "You did not take any action last time.", "None") global listener_task await websocket.accept() connections[client_id] = websocket @@ -367,7 +348,8 @@ async def websocket_endpoint(websocket: WebSocket, client_id: str): inventory_raw = message.get("inventory", "") visionResponse_raw = message.get("visionResponse", "") codeOutput_raw = message.get("codeOutput", "") - await update_client_data(client_id, stats_raw, inventory_raw, visionResponse_raw, codeOutput_raw) + latestImageUri_raw = message.get("latestImageUri", "") + await update_client_data(client_id, stats_raw, inventory_raw, visionResponse_raw, codeOutput_raw, latestImageUri_raw) else: print(f"Unhandled message type from {client_id}: {message.get('type')}") @@ -447,16 +429,18 @@ async def aact(self, message: AgentAction | Tick) -> AgentAction: print(f"Error fetching client_data for {client_id}: {e}") client_info = None if not client_info: - print(f"No data received for {client_id}, skipping stats/inventory/visionResponse/codeOutput assignment.") + print(f"No data received for {client_id}, skipping stats/inventory/visionResponse/codeOutput/latestImageUri assignment.") stats = "" inventory = "" visionResponse = "" codeOutput = "" + latestImageUri = "" else: stats = client_info.get("stats", "") inventory = client_info.get("inventory", "") visionResponse = client_info.get("visionResponse", "") codeOutput = client_info.get("codeOutput", "").removeprefix("Code output: ") + latestImageUri = client_info.get("latestImageUri", "") if codeOutput: # action execution last_self_message_index = next((i for i in reversed(range(len(self.message_history))) if self.message_history[i][0] == self.name), -1) @@ -480,8 +464,6 @@ async def aact(self, message: AgentAction | Tick) -> AgentAction: agent_action: str = await agenerate( model_name=self.model_name, template= - # "You are {agent_name} in the conversation.\n{message_history}\n and you plan to {goal}.\n" - # "Please only output a sentence or not outputting anything. {format_instructions}" f"(The status of the last action execution: {codeOutput})"+"""\n\n Imagine that you are a friend of the other persons. Here is the conversation between you and them.\n You can choose to interrupt the other person by saying something or not to interrupt by outputting notiong. What would you say? No need to mention your own name, just output the content directly. You plan to {goal}. You are a playful Minecraft bot named {agent_name} that can converse with players, see, move, mine, build, and interact with the world by using commands.\n @@ -498,7 +480,7 @@ async def aact(self, message: AgentAction | Tick) -> AgentAction: ) print(f"Generated action for {self.name}: {agent_action}") - await check_and_generate(self.name, agent_message_history) + await check_and_generate(self.name, agent_message_history, latestImageUri) if agent_action != "none" and agent_action != "": self.message_history.append((self.name, agent_action)) From a5e0b26ee3b852d108e3e225a41df96e8dc2eb75 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Sun, 12 Jan 2025 07:53:42 +0000 Subject: [PATCH 12/29] [autofix.ci] apply automated fixes --- .../group_discussion_agents.py | 264 ++++++++++++++---- .../group_discussion_agents.toml | 8 +- .../group_discussion_agents_boat.toml | 8 +- .../group_discussion_agents_chest.toml | 8 +- ...group_discussion_agents_stone_pickaxe.toml | 8 +- 5 files changed, 230 insertions(+), 66 deletions(-) diff --git a/examples/experimental/minecraft_agents/group_discussion_agents.py b/examples/experimental/minecraft_agents/group_discussion_agents.py index 6340861a9..45888675a 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents.py +++ b/examples/experimental/minecraft_agents/group_discussion_agents.py @@ -102,7 +102,7 @@ num: (number) The number of times to smelt the item. !clearFurnace: Take all items out of the nearest furnace. Params: -!placeHere: Place a given block in the current location. Do NOT use to build structures, only use for single blocks/torches. +!placeHere: Place a given block in the current location. Do NOT use to build structures, only use for single blocks/torches. Params: type: (string) The block type to place. !attack: Attack and kill the nearest entity of a given type. @@ -118,7 +118,7 @@ !stay: Stay in the current location no matter what. Pauses all modes. Params: type: (number) The number of seconds to stay. -1 for forever. -!setMode: Set a mode to on or off. A mode is an automatic behavior that constantly checks and responds to the environment. +!setMode: Set a mode to on or off. A mode is an automatic behavior that constantly checks and responds to the environment. Params: mode_name: (string) The name of the mode to enable. on: (bool) Whether to enable or disable the mode. @@ -161,7 +161,7 @@ Example 24: I'm stuck! !moveAway(20) Example 25: I just got shot by a skeleton! Yikes! Time to regroup and maybe head back to my last death position for my stuff. !goToPlace(\"last_death_position\") -After crafting one stone pickaxe yourself (If the condition is that the inventory shows stone_pickaxe: 1, rather than just having previously outputted !craftRecipe(\"stone_pickaxe\", 1)), ask who hasn't crafted theirs yet and use a command like !goToPlayer(\"John\", 0) to go to that person's location. +After crafting one stone pickaxe yourself (If the condition is that the inventory shows stone_pickaxe: 1, rather than just having previously outputted !craftRecipe(\"stone_pickaxe\", 1)), ask who hasn't crafted theirs yet and use a command like !goToPlayer(\"John\", 0) to go to that person's location. Then, inquire about what materials they are missing and use a command like !givePlayer(\"John\", \"stone\", 3) to give them the materials. Example 26: Come here Jack! @@ -183,9 +183,10 @@ AGENT_FILES = { "Jane": LOG_DIR / "jane_log.txt", "John": LOG_DIR / "john_log.txt", - "Jack": LOG_DIR / "jack_log.txt" + "Jack": LOG_DIR / "jack_log.txt", } + @DataModelFactory.register("agent_action") class AgentAction(DataModel): agent_name: str = Field(description="the name of the agent") @@ -209,38 +210,70 @@ def to_natural_language(self) -> str: case "leave": return "left the conversation" + def _format_message_history(message_history: List[tuple[str, str]]) -> str: - return "\n".join( - (f"{speaker}: {message}") for speaker, message in message_history - ) + return "\n".join((f"{speaker}: {message}") for speaker, message in message_history) + async def openai_api_predict_async(template, image_url): response = await client.chat.completions.create( model="gpt-4o-2024-11-20", - messages=[{ + messages=[ + { "role": "user", "content": [ - {"type": "text", "text": template,}, - {"type": "image_url", "image_url": {"url": image_url},}, + { + "type": "text", + "text": template, + }, + { + "type": "image_url", + "image_url": {"url": image_url}, + }, ], - }], + } + ], ) return response.choices[0].message.content + @app.on_event("startup") async def startup_event(): await redis.set("conversation_count", 0) await redis.set("status_count", 0) print("Conversation and status counter initialized to 0.") -async def update_client_data(client_id: str, stats: str, inventory: str, visionResponse: str, codeOutput: str, latestImageUri: str): - await redis.set(f"client_data:{client_id}", json.dumps({"stats": stats, "inventory": inventory, "visionResponse": visionResponse, "codeOutput": codeOutput, "latestImageUri": latestImageUri})) + +async def update_client_data( + client_id: str, + stats: str, + inventory: str, + visionResponse: str, + codeOutput: str, + latestImageUri: str, +): + await redis.set( + f"client_data:{client_id}", + json.dumps( + { + "stats": stats, + "inventory": inventory, + "visionResponse": visionResponse, + "codeOutput": codeOutput, + "latestImageUri": latestImageUri, + } + ), + ) + async def get_client_data(client_id: str) -> dict: data = await redis.get(f"client_data:{client_id}") return json.loads(data) if data else {} -async def log_to_file(agent_name: str, agent_message_history: List[tuple[str, str]], generated_text: str): + +async def log_to_file( + agent_name: str, agent_message_history: List[tuple[str, str]], generated_text: str +): try: if agent_name not in AGENT_FILES: raise ValueError(f"Unknown agent name: {agent_name}") @@ -258,38 +291,94 @@ async def log_to_file(agent_name: str, agent_message_history: List[tuple[str, st except Exception as e: print(f"Error logging output for {agent_name}: {e}") -async def check_and_generate(agent_name: str, agent_message_history: List[tuple[str, str]], latestImageUri: str): # ToM questions - count = len(re.findall(r"system: The status of", _format_message_history(agent_message_history))) + +async def check_and_generate( + agent_name: str, agent_message_history: List[tuple[str, str]], latestImageUri: str +): # ToM questions + count = len( + re.findall( + r"system: The status of", _format_message_history(agent_message_history) + ) + ) if count % 4 == 0 and count != 0: # Multiple of 4 but not 0 targets = ["Jack", "Jane", "John"] for target in targets: template_1 = f"You are {agent_name}. What should {target} do immediately next? Respond in one concise sentence." print(f"\033[1;32m{template_1}\033[0m") - generated_text_1 = await openai_api_predict_async(template_1 + f" Here is the conversation history: {_format_message_history(agent_message_history)}", latestImageUri) + generated_text_1 = await openai_api_predict_async( + template_1 + + f" Here is the conversation history: {_format_message_history(agent_message_history)}", + latestImageUri, + ) template_2 = f"You are {agent_name}. What is {target} doing right now? Respond in one concise sentence." print(f"\033[1;32m{template_2}\033[0m") - generated_text_2 = await openai_api_predict_async(template_2 + f" Here is the conversation history: {_format_message_history(agent_message_history)}", latestImageUri) + generated_text_2 = await openai_api_predict_async( + template_2 + + f" Here is the conversation history: {_format_message_history(agent_message_history)}", + latestImageUri, + ) template_3 = f"You are {agent_name}. What materials or tools does {target} currently have? Respond in one concise sentence." print(f"\033[1;32m{template_3}\033[0m") - generated_text_3 = await openai_api_predict_async(template_3 + f" Here is the conversation history: {_format_message_history(agent_message_history)}", latestImageUri) + generated_text_3 = await openai_api_predict_async( + template_3 + + f" Here is the conversation history: {_format_message_history(agent_message_history)}", + latestImageUri, + ) template_4 = f"You are {agent_name}. Is {target} in a cooperative, competitive, or independent relationship with you? Respond in one concise sentence." print(f"\033[1;32m{template_4}\033[0m") - generated_text_4= await openai_api_predict_async(template_4 + f" Here is the conversation history: {_format_message_history(agent_message_history)}", latestImageUri) + generated_text_4 = await openai_api_predict_async( + template_4 + + f" Here is the conversation history: {_format_message_history(agent_message_history)}", + latestImageUri, + ) template_5 = f"""You are {agent_name}. What is {target} seeing right now? If you don’t know, please answer \"I don’t know.\" Respond in one concise sentence.""" print(f"\033[1;32m{template_5}\033[0m") - generated_text_5 = await openai_api_predict_async(template_5 + f" Here is the conversation history: {_format_message_history(agent_message_history)}", latestImageUri) + generated_text_5 = await openai_api_predict_async( + template_5 + + f" Here is the conversation history: {_format_message_history(agent_message_history)}", + latestImageUri, + ) template_6 = f"You are {agent_name}. What steps does {target} still need to take to complete the final goal? Respond in one concise sentence." print(f"\033[1;32m{template_6}\033[0m") - generated_text_6 = await openai_api_predict_async(template_6 + f" Here is the conversation history: {_format_message_history(agent_message_history)}", latestImageUri) + generated_text_6 = await openai_api_predict_async( + template_6 + + f" Here is the conversation history: {_format_message_history(agent_message_history)}", + latestImageUri, + ) - generated_text = template_1 + "\n" + generated_text_1 + "\n" + template_2 + "\n" + generated_text_2 + "\n" + template_3 + "\n" + generated_text_3 + "\n" + template_4 + "\n" + generated_text_4 + "\n" + template_5 + "\n" + generated_text_5 + "\n" + template_6 + "\n" + generated_text_6 + generated_text = ( + template_1 + + "\n" + + generated_text_1 + + "\n" + + template_2 + + "\n" + + generated_text_2 + + "\n" + + template_3 + + "\n" + + generated_text_3 + + "\n" + + template_4 + + "\n" + + generated_text_4 + + "\n" + + template_5 + + "\n" + + generated_text_5 + + "\n" + + template_6 + + "\n" + + generated_text_6 + ) await log_to_file(agent_name, agent_message_history, generated_text) + async def redis_listener(): global subscribed_channels pubsub = redis.pubsub() @@ -302,7 +391,9 @@ async def redis_listener(): if message and message["type"] == "message": total_messages = int(await redis.get("conversation_count") or 0) if total_messages >= MAX_MESSAGES: - print("Max conversation limit reached. No more messages will be broadcast.") + print( + "Max conversation limit reached. No more messages will be broadcast." + ) continue await redis.incr("conversation_count") @@ -324,11 +415,21 @@ async def redis_listener(): "message": raw_message, } print(f"Broadcasting to {target_client}: {formatted_message}") - await connections[target_client].send_text(json.dumps(formatted_message)) + await connections[target_client].send_text( + json.dumps(formatted_message) + ) + @app.websocket("/ws/{client_id}") async def websocket_endpoint(websocket: WebSocket, client_id: str): - await update_client_data(client_id, "None", "None", "None", "You did not take any action last time.", "None") + await update_client_data( + client_id, + "None", + "None", + "None", + "You did not take any action last time.", + "None", + ) global listener_task await websocket.accept() connections[client_id] = websocket @@ -349,12 +450,23 @@ async def websocket_endpoint(websocket: WebSocket, client_id: str): visionResponse_raw = message.get("visionResponse", "") codeOutput_raw = message.get("codeOutput", "") latestImageUri_raw = message.get("latestImageUri", "") - await update_client_data(client_id, stats_raw, inventory_raw, visionResponse_raw, codeOutput_raw, latestImageUri_raw) + await update_client_data( + client_id, + stats_raw, + inventory_raw, + visionResponse_raw, + codeOutput_raw, + latestImageUri_raw, + ) else: - print(f"Unhandled message type from {client_id}: {message.get('type')}") + print( + f"Unhandled message type from {client_id}: {message.get('type')}" + ) - except json.JSONDecodeError as e: - print(f"Failed to decode JSON message from {client_id}: {client_message}") + except json.JSONDecodeError: + print( + f"Failed to decode JSON message from {client_id}: {client_message}" + ) except WebSocketDisconnect: print(f"Client {client_id} disconnected.") @@ -365,6 +477,7 @@ async def websocket_endpoint(websocket: WebSocket, client_id: str): listener_task.cancel() listener_task = None + @NodeFactory.register("llm_agent") class LLMAgent(BaseAgent[AgentAction | Tick, AgentAction]): def __init__( @@ -400,10 +513,12 @@ def __init__( async def send(self, message: AgentAction) -> None: if message.action_type == "none": return - + total_messages = int(await redis.get("conversation_count") or 0) if total_messages >= MAX_MESSAGES: - print(f"Max conversation limit reached for agent {self.name}. No message will be sent.") + print( + f"Max conversation limit reached for agent {self.name}. No message will be sent." + ) return print(f"Publishing to Redis: {message}") @@ -429,7 +544,9 @@ async def aact(self, message: AgentAction | Tick) -> AgentAction: print(f"Error fetching client_data for {client_id}: {e}") client_info = None if not client_info: - print(f"No data received for {client_id}, skipping stats/inventory/visionResponse/codeOutput/latestImageUri assignment.") + print( + f"No data received for {client_id}, skipping stats/inventory/visionResponse/codeOutput/latestImageUri assignment." + ) stats = "" inventory = "" visionResponse = "" @@ -439,39 +556,82 @@ async def aact(self, message: AgentAction | Tick) -> AgentAction: stats = client_info.get("stats", "") inventory = client_info.get("inventory", "") visionResponse = client_info.get("visionResponse", "") - codeOutput = client_info.get("codeOutput", "").removeprefix("Code output: ") + codeOutput = client_info.get("codeOutput", "").removeprefix( + "Code output: " + ) latestImageUri = client_info.get("latestImageUri", "") if codeOutput: # action execution - last_self_message_index = next((i for i in reversed(range(len(self.message_history))) if self.message_history[i][0] == self.name), -1) + last_self_message_index = next( + ( + i + for i in reversed(range(len(self.message_history))) + if self.message_history[i][0] == self.name + ), + -1, + ) if last_self_message_index != -1: - self.message_history.insert(last_self_message_index + 1, ("system", f"The status of {self.name}'s action execution: {codeOutput}")) + self.message_history.insert( + last_self_message_index + 1, + ( + "system", + f"The status of {self.name}'s action execution: {codeOutput}", + ), + ) else: - self.message_history.append(("system", f"The status of {self.name}'s action execution: {codeOutput}")) + self.message_history.append( + ( + "system", + f"The status of {self.name}'s action execution: {codeOutput}", + ) + ) if visionResponse: # add image description to the memory - last_self_message_index = next((i for i in reversed(range(len(self.message_history))) if self.message_history[i][0] == self.name), -1) + last_self_message_index = next( + ( + i + for i in reversed(range(len(self.message_history))) + if self.message_history[i][0] == self.name + ), + -1, + ) if last_self_message_index != -1: - self.message_history.insert(last_self_message_index + 1, ("system", f"The following is the description of the game view {self.name} is seeing: {visionResponse}")) + self.message_history.insert( + last_self_message_index + 1, + ( + "system", + f"The following is the description of the game view {self.name} is seeing: {visionResponse}", + ), + ) else: - self.message_history.append(("system", f"The following is the description of the game view {self.name} is seeing: {visionResponse}")) + self.message_history.append( + ( + "system", + f"The following is the description of the game view {self.name} is seeing: {visionResponse}", + ) + ) agent_message_history = [ - (speaker, message) for speaker, message in self.message_history - if speaker != "system" or (speaker == "system" and self.name in message) + (speaker, message) + for speaker, message in self.message_history + if speaker != "system" + or (speaker == "system" and self.name in message) ] - + agent_action: str = await agenerate( model_name=self.model_name, - template= - f"(The status of the last action execution: {codeOutput})"+"""\n\n + template=f"(The status of the last action execution: {codeOutput})" + + """\n\n Imagine that you are a friend of the other persons. Here is the conversation between you and them.\n You can choose to interrupt the other person by saying something or not to interrupt by outputting notiong. What would you say? No need to mention your own name, just output the content directly. You plan to {goal}. You are a playful Minecraft bot named {agent_name} that can converse with players, see, move, mine, build, and interact with the world by using commands.\n - Act human-like as if you were a typical Minecraft player, rather than an AI. Be very brief in your responses, don't apologize constantly, don't give instructions or make lists unless asked, and don't refuse requests. Don't pretend to act, use commands immediately when requested. Do NOT say this: 'Sure, I've stopped.', instead say this: 'Sure, I'll stop. !stop'. Do NOT say this: 'On my way! Give me a moment.', instead say this: 'On my way! !goToPlayer(\"playername\", 3)'. + Act human-like as if you were a typical Minecraft player, rather than an AI. Be very brief in your responses, don't apologize constantly, don't give instructions or make lists unless asked, and don't refuse requests. Don't pretend to act, use commands immediately when requested. Do NOT say this: 'Sure, I've stopped.', instead say this: 'Sure, I'll stop. !stop'. Do NOT say this: 'On my way! Give me a moment.', instead say this: 'On my way! !goToPlayer(\"playername\", 3)'. Respond only as {agent_name}, never output '(FROM OTHER BOT)' or pretend to be someone else. This is extremely important to me, take a deep breath and have fun :)\n\n - MEMORY:\n{message_history}\n"""+f"{stats}{inventory}\nIMAGE_DESCRIPTION:\n{visionResponse}\n\nEXAMPLES:\n{EXAMPLES}\n\nCOMMAND_DOCS:\n{COMMAND_DOCS}\n\nConversation Begin:", + MEMORY:\n{message_history}\n""" + + f"{stats}{inventory}\nIMAGE_DESCRIPTION:\n{visionResponse}\n\nEXAMPLES:\n{EXAMPLES}\n\nCOMMAND_DOCS:\n{COMMAND_DOCS}\n\nConversation Begin:", input_values={ - "message_history": _format_message_history(agent_message_history), + "message_history": _format_message_history( + agent_message_history + ), "goal": self.goal, "agent_name": self.name, }, @@ -480,7 +640,9 @@ async def aact(self, message: AgentAction | Tick) -> AgentAction: ) print(f"Generated action for {self.name}: {agent_action}") - await check_and_generate(self.name, agent_message_history, latestImageUri) + await check_and_generate( + self.name, agent_message_history, latestImageUri + ) if agent_action != "none" and agent_action != "": self.message_history.append((self.name, agent_action)) @@ -508,6 +670,7 @@ async def aact(self, message: AgentAction | Tick) -> AgentAction: case _: raise ValueError(f"Unexpected message type: {type(message)}") + @NodeFactory.register("input_node") class InputNode(BaseAgent[AgentAction, AgentAction]): def __init__( @@ -543,7 +706,8 @@ async def _task_scheduler(self) -> None: ) ) + @app.get("/conversation_count") async def get_conversation_count(): count = int(await redis.get("conversation_count") or 0) - return {"conversation_count": count, "max_limit": MAX_MESSAGES} \ No newline at end of file + return {"conversation_count": count, "max_limit": MAX_MESSAGES} diff --git a/examples/experimental/minecraft_agents/group_discussion_agents.toml b/examples/experimental/minecraft_agents/group_discussion_agents.toml index 439a86427..6f2a472a1 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents.toml @@ -12,8 +12,8 @@ input_text_channels = ["Jane", "John"] input_tick_channel = "tick/secs/1" goal = """ You and your friends need to craft a "stone_pickaxe". YOUR TASK IS TO CRAFT A "crafting_table". -After crafting one "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !goToPlayer(\"John\", 0) to go to John's location. -Then, use the command !placeHere(\"crafting_table\") to give John the "crafting_table". Afterward, please use the command !moveAway(5) once to maintain distance. +After crafting one "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !goToPlayer(\"John\", 0) to go to John's location. +Then, use the command !placeHere(\"crafting_table\") to give John the "crafting_table". Afterward, please use the command !moveAway(5) once to maintain distance. The complete process for crafting a "crafting_table" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): 1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. @@ -33,7 +33,7 @@ input_text_channels = ["Jack", "John"] input_tick_channel = "tick/secs/1" goal = """ You and your friends need to craft a "stone_pickaxe". YOUR TASK IS TO CRAFT 4 "stick". -After crafting 4 "stick" yourself (If the condition is that the inventory shows stick: 4, rather than just having previously outputted !craftRecipe("stick", 4)), use the command !goToPlayer("John", 0) to go to John's location. +After crafting 4 "stick" yourself (If the condition is that the inventory shows stick: 4, rather than just having previously outputted !craftRecipe("stick", 4)), use the command !goToPlayer("John", 0) to go to John's location. Then, use the command `!givePlayer(\"John\", \"stick\", 4)` to give John 4 "stick" (number like 4 does not need to use double quotation marks). Afterward, please use the command !moveAway(5) once to maintain distance. The complete process for crafting 4 "stick" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): @@ -81,4 +81,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" \ No newline at end of file +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml b/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml index 985aa2763..a023b23d1 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml @@ -12,7 +12,7 @@ input_text_channels = ["Jane", "John"] input_tick_channel = "tick/secs/1" goal = """ You and your friends need to craft a "chest" and a "boat". YOUR TASK IS TO CRAFT A "crafting_table". -After crafting a "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !placeHere(\"crafting_table\"). +After crafting a "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !placeHere(\"crafting_table\"). The complete process for crafting a "crafting_table" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): 1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. @@ -32,7 +32,7 @@ input_text_channels = ["Jack", "John"] input_tick_channel = "tick/secs/1" goal = """ You and your friends need to craft a "chest" and a "boat". YOUR TASK IS TO CRAFT ONE "chest". -Once you have crafted at least 8 planks (If the condition is that the inventory shows oak_planks: 8, birch_planks: 8 or spruce_planks: 8), use the command !goToPlayer("Jack", 0) to go to Jack's location. +Once you have crafted at least 8 planks (If the condition is that the inventory shows oak_planks: 8, birch_planks: 8 or spruce_planks: 8), use the command !goToPlayer("Jack", 0) to go to Jack's location. Then, use the command !goToBlock("crafting_table", 10, 20) to locate a nearby "crafting_table". Next, use !craftRecipe("chest", 1) to craft a chest, then use the command !placeHere(\"chest\") to place it. The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): @@ -53,7 +53,7 @@ input_text_channels = ["Jack", "Jane"] input_tick_channel = "tick/secs/1" goal = """ You and your friends need to craft a "chest" and a "boat". YOUR TASK IS TO CRAFT ONE BOAT. -Once you have crafted at least 5 planks (If the condition is that the inventory shows oak_planks: 5, birch_planks: 5 or spruce_planks: 5), use the command !goToPlayer("Jack", 0) to go to Jack's location. +Once you have crafted at least 5 planks (If the condition is that the inventory shows oak_planks: 5, birch_planks: 5 or spruce_planks: 5), use the command !goToPlayer("Jack", 0) to go to Jack's location. Then, use the command !goToBlock("crafting_table", 10, 20) to locate a nearby "crafting_table". Next, use !craftRecipe("oak_boat", 1), !craftRecipe("birch_boat", 1) or !craftRecipe("spruce_boat", 1) to craft a boat. After that, use the command !goToBlock("chest", 10, 20) to locate a nearby "chest", and then use !putInChest("oak_boat", 1), !putInChest("birch_boat", 1) or !putInChest("spruce_boat", 1) to place the boat in the chest. @@ -78,4 +78,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" \ No newline at end of file +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml b/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml index 1a243e28b..b6f725a57 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml @@ -12,7 +12,7 @@ input_text_channels = ["Jane", "John"] input_tick_channel = "tick/secs/1" goal = """ You and your friends need to craft 2 "chest". YOUR TASK IS TO CRAFT A "crafting_table". -After crafting a "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !placeHere(\"crafting_table\"). +After crafting a "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !placeHere(\"crafting_table\"). The complete process for crafting a "crafting_table" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): 1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. @@ -32,7 +32,7 @@ input_text_channels = ["Jack", "John"] input_tick_channel = "tick/secs/1" goal = """ You and your friends need to craft 2 "chest". YOUR TASK IS TO CRAFT ONE "chest". -Once you have crafted at least 8 planks (If the condition is that the inventory shows oak_planks: 8, birch_planks: 8 or spruce_planks: 8), use the command !goToPlayer("Jack", 0) to go to Jack's location. +Once you have crafted at least 8 planks (If the condition is that the inventory shows oak_planks: 8, birch_planks: 8 or spruce_planks: 8), use the command !goToPlayer("Jack", 0) to go to Jack's location. Then, use the command !goToBlock("crafting_table", 10, 20) to locate a nearby "crafting_table". Next, use !craftRecipe("chest", 1) to craft a chest, then use the command !placeHere(\"chest\") to place it. The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): @@ -53,7 +53,7 @@ input_text_channels = ["Jack", "Jane"] input_tick_channel = "tick/secs/1" goal = """ You and your friends need to craft 2 "chest". YOUR TASK IS TO CRAFT ONE "chest". -Once you have crafted at least 8 planks (If the condition is that the inventory shows oak_planks: 8, birch_planks: 8 or spruce_planks: 8), use the command !goToPlayer("Jack", 0) to go to Jack's location. +Once you have crafted at least 8 planks (If the condition is that the inventory shows oak_planks: 8, birch_planks: 8 or spruce_planks: 8), use the command !goToPlayer("Jack", 0) to go to Jack's location. Then, use the command !goToBlock("crafting_table", 10, 20) to locate a nearby "crafting_table". Next, use !craftRecipe("chest", 1) to craft a chest, then use the command !placeHere(\"chest\") to place it. The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): @@ -77,4 +77,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" \ No newline at end of file +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml b/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml index 439a86427..6f2a472a1 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml @@ -12,8 +12,8 @@ input_text_channels = ["Jane", "John"] input_tick_channel = "tick/secs/1" goal = """ You and your friends need to craft a "stone_pickaxe". YOUR TASK IS TO CRAFT A "crafting_table". -After crafting one "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !goToPlayer(\"John\", 0) to go to John's location. -Then, use the command !placeHere(\"crafting_table\") to give John the "crafting_table". Afterward, please use the command !moveAway(5) once to maintain distance. +After crafting one "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !goToPlayer(\"John\", 0) to go to John's location. +Then, use the command !placeHere(\"crafting_table\") to give John the "crafting_table". Afterward, please use the command !moveAway(5) once to maintain distance. The complete process for crafting a "crafting_table" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): 1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. @@ -33,7 +33,7 @@ input_text_channels = ["Jack", "John"] input_tick_channel = "tick/secs/1" goal = """ You and your friends need to craft a "stone_pickaxe". YOUR TASK IS TO CRAFT 4 "stick". -After crafting 4 "stick" yourself (If the condition is that the inventory shows stick: 4, rather than just having previously outputted !craftRecipe("stick", 4)), use the command !goToPlayer("John", 0) to go to John's location. +After crafting 4 "stick" yourself (If the condition is that the inventory shows stick: 4, rather than just having previously outputted !craftRecipe("stick", 4)), use the command !goToPlayer("John", 0) to go to John's location. Then, use the command `!givePlayer(\"John\", \"stick\", 4)` to give John 4 "stick" (number like 4 does not need to use double quotation marks). Afterward, please use the command !moveAway(5) once to maintain distance. The complete process for crafting 4 "stick" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): @@ -81,4 +81,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" \ No newline at end of file +node_class = "tick" From 7a2dff4097573475136e59c9f0c1d4e05f214b37 Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Mon, 13 Jan 2025 09:56:01 +0800 Subject: [PATCH 13/29] add chest_no_task_division --- .../group_discussion_agents.toml | 50 +++++------ .../group_discussion_agents_boat.toml | 2 +- .../group_discussion_agents_chest.toml | 2 +- ...p_discussion_agents_chest_no_division.toml | 84 +++++++++++++++++++ ...group_discussion_agents_stone_pickaxe.toml | 2 +- 5 files changed, 112 insertions(+), 28 deletions(-) create mode 100644 examples/experimental/minecraft_agents/group_discussion_agents_chest_no_division.toml diff --git a/examples/experimental/minecraft_agents/group_discussion_agents.toml b/examples/experimental/minecraft_agents/group_discussion_agents.toml index 6f2a472a1..7a0677979 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents.toml @@ -11,14 +11,15 @@ output_channel = "Jack" input_text_channels = ["Jane", "John"] input_tick_channel = "tick/secs/1" goal = """ -You and your friends need to craft a "stone_pickaxe". YOUR TASK IS TO CRAFT A "crafting_table". -After crafting one "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !goToPlayer(\"John\", 0) to go to John's location. -Then, use the command !placeHere(\"crafting_table\") to give John the "crafting_table". Afterward, please use the command !moveAway(5) once to maintain distance. +You and your friends need to craft 2 "chest" and place them. Please discuss the task division quickly and start working. -The complete process for crafting a "crafting_table" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use 4 planks to craft a "crafting_table".""" +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("chest", 1) to craft a "chest" (requires 8 planks). +6. Use the command !placeHere("chest") to place the chest.""" model_name = "gpt-4o-2024-11-20" agent_name = "Jack" @@ -32,14 +33,15 @@ output_channel = "Jane" input_text_channels = ["Jack", "John"] input_tick_channel = "tick/secs/1" goal = """ -You and your friends need to craft a "stone_pickaxe". YOUR TASK IS TO CRAFT 4 "stick". -After crafting 4 "stick" yourself (If the condition is that the inventory shows stick: 4, rather than just having previously outputted !craftRecipe("stick", 4)), use the command !goToPlayer("John", 0) to go to John's location. -Then, use the command `!givePlayer(\"John\", \"stick\", 4)` to give John 4 "stick" (number like 4 does not need to use double quotation marks). Afterward, please use the command !moveAway(5) once to maintain distance. +You and your friends need to craft 2 "chest" and place them. Please discuss the task division quickly and start working. -The complete process for crafting 4 "stick" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use 2 planks to create 4 "stick".""" +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("chest", 1) to craft a "chest" (requires 8 planks). +6. Use the command !placeHere("chest") to place the chest.""" model_name = "gpt-4o-2024-11-20" agent_name = "Jane" @@ -53,17 +55,15 @@ output_channel = "John" input_text_channels = ["Jack", "Jane"] input_tick_channel = "tick/secs/1" goal = """ -You and your friends need to craft a "stone_pickaxe". Jack will help you craft a "crafting_table" and give it to you, while Jane will craft 4 "stick" and give them to you. -Before this, you should collect some logs and process them into at least 3 planks. Once you have received the "crafting_table" and 4 "stick", you can proceed to craft the "stone_pickaxe" as follows. +You and your friends need to craft 2 "chest" and place them. Please discuss the task division quickly and start working. -The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 2 pieces. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use 4 planks to craft a "crafting_table". -4. Use 2 planks to create 4 "stick". -5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe". -6. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before obtaining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don’t, type !craftable to check if you can craft a "wooden_pickaxe". -7. Open the "crafting_table" and use 3 pieces of stone and 2 sticks to craft a "stone_pickaxe".""" +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("chest", 1) to craft a "chest" (requires 8 planks). +6. Use the command !placeHere("chest") to place the chest.""" model_name = "gpt-4o-2024-11-20" agent_name = "John" @@ -81,4 +81,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" +node_class = "tick" \ No newline at end of file diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml b/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml index a023b23d1..ba1f7cc72 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml @@ -78,4 +78,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" +node_class = "tick" \ No newline at end of file diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml b/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml index b6f725a57..5c5ae5ac5 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml @@ -77,4 +77,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" +node_class = "tick" \ No newline at end of file diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_chest_no_division.toml b/examples/experimental/minecraft_agents/group_discussion_agents_chest_no_division.toml new file mode 100644 index 000000000..7a0677979 --- /dev/null +++ b/examples/experimental/minecraft_agents/group_discussion_agents_chest_no_division.toml @@ -0,0 +1,84 @@ +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft 2 "chest" and place them. Please discuss the task division quickly and start working. + +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("chest", 1) to craft a "chest" (requires 8 planks). +6. Use the command !placeHere("chest") to place the chest.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft 2 "chest" and place them. Please discuss the task division quickly and start working. + +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("chest", 1) to craft a "chest" (requires 8 planks). +6. Use the command !placeHere("chest") to place the chest.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft 2 "chest" and place them. Please discuss the task division quickly and start working. + +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("chest", 1) to craft a "chest" (requires 8 planks). +6. Use the command !placeHere("chest") to place the chest.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" \ No newline at end of file diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml b/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml index 6f2a472a1..6b24306e5 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml @@ -81,4 +81,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" +node_class = "tick" \ No newline at end of file From b3c0bad5f4cb21004e1f517bf0e302331a65f23f Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Mon, 13 Jan 2025 01:56:41 +0000 Subject: [PATCH 14/29] [autofix.ci] apply automated fixes --- .../experimental/minecraft_agents/group_discussion_agents.toml | 2 +- .../minecraft_agents/group_discussion_agents_boat.toml | 2 +- .../minecraft_agents/group_discussion_agents_chest.toml | 2 +- .../group_discussion_agents_chest_no_division.toml | 2 +- .../minecraft_agents/group_discussion_agents_stone_pickaxe.toml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/experimental/minecraft_agents/group_discussion_agents.toml b/examples/experimental/minecraft_agents/group_discussion_agents.toml index 7a0677979..500e4ffc1 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents.toml @@ -81,4 +81,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" \ No newline at end of file +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml b/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml index ba1f7cc72..a023b23d1 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml @@ -78,4 +78,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" \ No newline at end of file +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml b/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml index 5c5ae5ac5..b6f725a57 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml @@ -77,4 +77,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" \ No newline at end of file +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_chest_no_division.toml b/examples/experimental/minecraft_agents/group_discussion_agents_chest_no_division.toml index 7a0677979..500e4ffc1 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_chest_no_division.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_chest_no_division.toml @@ -81,4 +81,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" \ No newline at end of file +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml b/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml index 6b24306e5..6f2a472a1 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml @@ -81,4 +81,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" \ No newline at end of file +node_class = "tick" From e6c037b3bf6e4dc6d8ea85226b8f4bad5033141b Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Wed, 15 Jan 2025 16:58:22 +0800 Subject: [PATCH 15/29] add boat_no_division.toml --- ...up_discussion_agents_boat_no_division.toml | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 examples/experimental/minecraft_agents/group_discussion_agents_boat_no_division.toml diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_boat_no_division.toml b/examples/experimental/minecraft_agents/group_discussion_agents_boat_no_division.toml new file mode 100644 index 000000000..4f3c2b541 --- /dev/null +++ b/examples/experimental/minecraft_agents/group_discussion_agents_boat_no_division.toml @@ -0,0 +1,82 @@ +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft 2 "boat". Please discuss the task division quickly and start working. + +The complete process for crafting a "boat" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_boat", 1), !craftRecipe("birch_boat", 1) or !craftRecipe("spruce_boat", 1) to craft a boat (requires 5 planks). +""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft 2 "boat". Please discuss the task division quickly and start working. + +The complete process for crafting a "boat" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_boat", 1), !craftRecipe("birch_boat", 1) or !craftRecipe("spruce_boat", 1) to craft a boat (requires 5 planks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft 2 "boat". Please discuss the task division quickly and start working. + +The complete process for crafting a "boat" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_boat", 1), !craftRecipe("birch_boat", 1) or !craftRecipe("spruce_boat", 1) to craft a boat (requires 5 planks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" \ No newline at end of file From 93fa00f89f97c4f1368cbbaa30ed10416df40c7a Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Wed, 15 Jan 2025 08:58:59 +0000 Subject: [PATCH 16/29] [autofix.ci] apply automated fixes --- .../group_discussion_agents_boat_no_division.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_boat_no_division.toml b/examples/experimental/minecraft_agents/group_discussion_agents_boat_no_division.toml index 4f3c2b541..522eebb00 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_boat_no_division.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_boat_no_division.toml @@ -79,4 +79,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" \ No newline at end of file +node_class = "tick" From 483ef2bc2abf832576e84dfbd813e84d0f905ddf Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Thu, 16 Jan 2025 16:41:21 +0800 Subject: [PATCH 17/29] add stone_pickaxe & wooden pickaxe (no task division) --- ...sion_agents_stone_pickaxe_no_division.toml | 90 +++++++++++++++++++ ...ion_agents_wooden_pickaxe_no_division.toml | 84 +++++++++++++++++ 2 files changed, 174 insertions(+) create mode 100644 examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe_no_division.toml create mode 100644 examples/experimental/minecraft_agents/group_discussion_agents_wooden_pickaxe_no_division.toml diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe_no_division.toml b/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe_no_division.toml new file mode 100644 index 000000000..7abc1936f --- /dev/null +++ b/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe_no_division.toml @@ -0,0 +1,90 @@ +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft a "stone_pickaxe". Please discuss the task division quickly and start working. + +The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). +4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. +5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). +6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks). +7. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before mining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don’t, use !craftable to check if you can craft a "wooden_pickaxe". +8. Use !craftRecipe("stone_pickaxe", 1) to craft a "stone_pickaxe" (requires "crafting_table", 3 stones and 2 sticks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft a "stone_pickaxe". Please discuss the task division quickly and start working. + +The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). +4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. +5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). +6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks). +7. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before mining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don’t, use !craftable to check if you can craft a "wooden_pickaxe". +8. Use !craftRecipe("stone_pickaxe", 1) to craft a "stone_pickaxe" (requires "crafting_table", 3 stones and 2 sticks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft a "stone_pickaxe". Please discuss the task division quickly and start working. + +The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). +4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. +5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). +6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks). +7. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before mining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don’t, use !craftable to check if you can craft a "wooden_pickaxe". +8. Use !craftRecipe("stone_pickaxe", 1) to craft a "stone_pickaxe" (requires "crafting_table", 3 stones and 2 sticks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" \ No newline at end of file diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_wooden_pickaxe_no_division.toml b/examples/experimental/minecraft_agents/group_discussion_agents_wooden_pickaxe_no_division.toml new file mode 100644 index 000000000..3f1ac974e --- /dev/null +++ b/examples/experimental/minecraft_agents/group_discussion_agents_wooden_pickaxe_no_division.toml @@ -0,0 +1,84 @@ +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft a "wooden_pickaxe". Please discuss the task division quickly and start working. + +The complete process for crafting a "wooden_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). +4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. +5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). +6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft a "wooden_pickaxe". Please discuss the task division quickly and start working. + +The complete process for crafting a "wooden_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). +4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. +5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). +6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft a "wooden_pickaxe". Please discuss the task division quickly and start working. + +The complete process for crafting a "wooden_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). +4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. +5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). +6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" \ No newline at end of file From 5876b37dab5a034b8622908260d8c050df339287 Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 08:42:04 +0000 Subject: [PATCH 18/29] [autofix.ci] apply automated fixes --- .../group_discussion_agents_stone_pickaxe_no_division.toml | 2 +- .../group_discussion_agents_wooden_pickaxe_no_division.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe_no_division.toml b/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe_no_division.toml index 7abc1936f..1ba808b08 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe_no_division.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe_no_division.toml @@ -87,4 +87,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" \ No newline at end of file +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_wooden_pickaxe_no_division.toml b/examples/experimental/minecraft_agents/group_discussion_agents_wooden_pickaxe_no_division.toml index 3f1ac974e..164e3f249 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_wooden_pickaxe_no_division.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_wooden_pickaxe_no_division.toml @@ -81,4 +81,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" \ No newline at end of file +node_class = "tick" From 93754284129ba697c04e0a1e1b561c1a364ef9a4 Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Thu, 16 Jan 2025 20:52:53 +0800 Subject: [PATCH 19/29] add door_no_task_division.toml --- ...up_discussion_agents_door_no_division.toml | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 examples/experimental/minecraft_agents/group_discussion_agents_door_no_division.toml diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_door_no_division.toml b/examples/experimental/minecraft_agents/group_discussion_agents_door_no_division.toml new file mode 100644 index 000000000..0014daa56 --- /dev/null +++ b/examples/experimental/minecraft_agents/group_discussion_agents_door_no_division.toml @@ -0,0 +1,84 @@ +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft 2 "door" and place them. Please discuss the task division quickly and start working. + +The complete process for crafting a door in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_door", 1), !craftRecipe("birch_door", 1) or !craftRecipe("spruce_door", 1) to craft a door (requires 6 planks). +6. Whoever made the door should be the one to place it. Use !goToBlock("dirt", 2, 10), then use !placeHere("oak_door"), !placeHere("birch_door") or !placeHere("spruce_door") to place the door.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft 2 "door" and place them. Please discuss the task division quickly and start working. + +The complete process for crafting a door in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_door", 1), !craftRecipe("birch_door", 1) or !craftRecipe("spruce_door", 1) to craft a door (requires 6 planks). +6. Whoever made the door should be the one to place it. Use !goToBlock("dirt", 2, 10), then use !placeHere("oak_door"), !placeHere("birch_door") or !placeHere("spruce_door") to place the door.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """ +You and your friends need to craft 2 "door" and place them. Please discuss the task division quickly and start working. + +The complete process for crafting a door in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_door", 1), !craftRecipe("birch_door", 1) or !craftRecipe("spruce_door", 1) to craft a door (requires 6 planks). +6. Whoever made the door should be the one to place it. Use !goToBlock("dirt", 2, 10), then use !placeHere("oak_door"), !placeHere("birch_door") or !placeHere("spruce_door") to place the door.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" \ No newline at end of file From f9142bb1b7839edb188445f97d66c5758859ad0d Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Thu, 16 Jan 2025 12:53:38 +0000 Subject: [PATCH 20/29] [autofix.ci] apply automated fixes --- .../group_discussion_agents_door_no_division.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_door_no_division.toml b/examples/experimental/minecraft_agents/group_discussion_agents_door_no_division.toml index 0014daa56..47a9cdb83 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_door_no_division.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_door_no_division.toml @@ -81,4 +81,4 @@ jsonl_file_path = "log.jsonl" [[nodes]] node_name = "tick" -node_class = "tick" \ No newline at end of file +node_class = "tick" From 3d4ead0c6ed429709bf2169102cf66e942131988 Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Sun, 19 Jan 2025 19:51:12 +0800 Subject: [PATCH 21/29] Automatically generate TOML files --- .../minecraft_agents/generate_toml.py | 79 ++++++++++++++++++ .../minecraft_agents/toml_generation.xlsx | Bin 0 -> 11454 bytes 2 files changed, 79 insertions(+) create mode 100644 examples/experimental/minecraft_agents/generate_toml.py create mode 100644 examples/experimental/minecraft_agents/toml_generation.xlsx diff --git a/examples/experimental/minecraft_agents/generate_toml.py b/examples/experimental/minecraft_agents/generate_toml.py new file mode 100644 index 000000000..d7444d638 --- /dev/null +++ b/examples/experimental/minecraft_agents/generate_toml.py @@ -0,0 +1,79 @@ +import pandas as pd + +xlsx_file = 'examples\\experimental\\group_discussion_agents\\toml_generation.xlsx' +df = pd.read_excel(xlsx_file) + +toml_template = '''redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """{goal_jack}""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """{goal_jane}""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """{goal_john}""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" +''' + +for index, row in df.iterrows(): + goal_jack = row['Jack'] + goal_jane = row['Jane'] + goal_john = row['John'] + filename = row['Filename'] + + toml_content = toml_template.format( + goal_jack=goal_jack, + goal_jane=goal_jane, + goal_john=goal_john + ) + + output_filename = f"group_discussion_agents_{filename}.toml" + with open(output_filename, 'w') as f: + f.write(toml_content) \ No newline at end of file diff --git a/examples/experimental/minecraft_agents/toml_generation.xlsx b/examples/experimental/minecraft_agents/toml_generation.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..0d4038be17ab5d6590954d2bec53e682fbe0459f GIT binary patch literal 11454 zcmeHN1y@{K(rw(`-QC^Y8x0mDNO1SyK^kbB;0}QxL4!kZcemi~PJ;W#do#1%OlH1c zFmrpYb62l>cdhPoYS%ues?-#rps@k40C)fZKmjm0&9X9t003g40RSujJfyyqql25d zgPW12my@}x0jsCI9r+h%NctQAzYyZ(!3pe%7%rJEgH=0^TeYMTYPTrCdIa{}te zWPBsq(UZ_uVyd5QZT*rR{(vr-i(|uAg*m?L!})X6s@lQ69u(Hstd1NRIMAVGNW{n1 z+kZ^cjzYh$eSH6oYj z6$uP1b*`&uuVU~I6;GpYO=8X1STpz-UTm=_Ku1#gEaSQx7N}9^XfT+lH@e)XD7LxM zf9IMtHicYe2gkOeu8gh0Hn;JSDsvN77e`!{==H_gGPV1@^Yw10kBPigyKmyfu`*)O z&lV4)08PyU)NCVbamzU!#y|Fm;p8a|pLdb3JkV@l5%;VSnKfm9iZxTgr?h8YFX+#f zRu$l51o?d(82rxPp?YFU?CVfC3AYU`bNhmQjd9R)(IJUG*g--4G4y18;6TXdcw$FC z==5jufj{RnECBHG0tHa}7h2Y7u~S{X`kK-!>yTb)Y2;#V=gP+V$M`=w{ugubpZ
<7vm{ z;pk#(;^=7mhi;W=**oU(qd)siJ;C*OAnwvo6dfQ!?labvGLF`HsOJyBB3ySbeos3t!?zb$rsITw8Iuynd^^Z#>;}lY71TcIK5MGeugUOdlM-ljvTE80VkZ@aeGs< zG8@2Vc(P{ObxxDEdFNG=1+iEXx_hW_`PMm6Cz&q$e0M^J+pnSsi%bOV0i*z4k9^fl zx#aMPP;9ra0{m!$JOW<1C15yh-%ADUJg6W0@Zhq~vQp&bhD;FDX9-rTff?mS2Dr7< zXhH`z->us=fm$Uqb(lzL+nVvdC7<38)^B&iI%X6V(CFB&RT-?b2oBuE*a|Q>=?}rc zdj-JB4ZAZddV$!x)G-ZB6)ehw!D+Eo2Aa)BWHoS|KaD5OvbG7|8TIq2b^AO*;=rtI zKY-i8@f4O?mcrttd}w#)B#q!bpSX>&%=vRmtl@Jtek3X;!g1j}A?R*7i9RPLKA$T3 z{o+#)r;1X;cOvEiM7?w}>lWRIPr18f;Ld9Un6j8&IAHxIJyYFGlbqh3ozN_bnLyL^ zy>sJ9^e65VqS%b+(DmM_ zaO?Q!Wb;~SEyJwJTWS0Q>MQAl*Tgc%yT$MZ$-1dV{FRCp@ZLqYDve6ezV(0Q>%TKO zP&6^+;+4TouX0BSfQNWx^4}EipZWX`^@DibjK0Q$|L&_yU0Jb*9laIlIh5Ta!yN}> z!HtdbSnCK4ez2BdiI#%P?{bZZvB^N^hawx4BiQR~wBP-P2Xzw)>#CEfC;}7O8_VuY z2*z>rViXGAKUSyLO1PBVkC|-cc{TT|T z+fJEl_+KrL7Rp{@ww-zR$UDTPilikxBEDcZ^3VY}GJl46*PSnE&01$0Zjui}4DCz5 zn1?UVEVc*xXV+d=`rlnR~dz@+r3!@l`oYja?F+cNEK$ zG*SBP;nXnGLq$Wd;(bATOP6$>Acp36hl_S3DU-50!%G-niIB4z>3Ak4-$0qO;DWb0 z?FNEt;nm{)gTfKjs%9H>&cqKttuXEr_@f_tIWtH4&3FvQ2D#Fe6(Mj=YkqN8Aac{) zxq!~?4)6EAuESl}oa#3DZK7BvOCf_=#DIfzvJX?yxnCV>C|C$Z}Od3 zTlEon;z0fQU3F(g0`5Y?)P;-pi}O)^S;|NBkTM&N^xhgrQc`IKPS48Dl_j0jN8WVb zJGw%uT$3)+a8BCgxFX0nsYMD8`E8CHE;Fqkdc2w7Pt6%{C^9aonDDgDY+z;b^i*MO z#LqIQT3xwz)XRRWh-7laHd9EXRl=J91oJL7X;gN;TC|cgekd{-WI~fzaXn6zKOVu} zh79ERRUwJS@VoT{$}xZ97Y9Klle+{|iDiNd6Ig;p$!N&rsl6#XsgmW0$t56%u@!3B zNUh26gc99&XwaK7FyReU0-)i_)VBc%szh%XXp&BUny7~QBVbS>S#4qrQ=y{23(~0> zC{lHk!Belv+kpy)S%|~>q(kZ)kONbHHBQ;z-fHyc{Qfy`k9Hz#8$bZo(De5f?i zZLrb0B|hgi+1Jh4nY*cayovrklpa9@*~;PFUH8**^>jMj^-Ha}H|eSNkFUD%?;+ya zxK`pj8~}hp`A2T!&k*5eWo~cI_UHI#bU4-<{Y2D&(+)TAB0gg9V`Sgwy}-m*zUx!( zjUqouGm+=r*8YCJPp&r!rK!0{l+-&4b4aJRq?ChEm zRrxu6tb>m(XIr06H=%IiQpsagw;@iwKHBAqjpHLUg@Kli^pU3u)czdSFY89fh1r4oeg#*8E+^L#ZY1T#bAg_J@&2_6U}Bj=i$+kZAzg)jJv_ zRqeqkkw%>)=T97MPNO0n;XCV-j3Jjm14cNEDywYHO!^jTgg5dped7qu!Yh`EdhQ~H zT%9yV^p^xOAC*(k#(gkP~43R*kciRq5${ox;=2{_w%aL zd!J5u1q-lIg+BVCZ}5L`DOAwx^J5&RkmeBF8G;epy+)k8S%=F!{&1rKWcFwm#SjjJ zep{#s9rkQaL)_M)`n{EO&Mq*VY4}pw&U`LAXKa7JB3avt45RCuCL0Ts?R#iEu~%$< z0lEx=uO6ashWP;l7pk{SFc`y6Az`a;qvwYh8Y=PZH(=?b%Dm|c2ah5?V=+Uw zKYH1GM$^9fj?=E#TEkXBY*^}Yz2O&9H;P^nuK~F<=&;$uV(*|xboSC#yU>vAh?Kqr z+O5xVZUude1r-*(&uL-M6Djo|!U=5ve z?_~^$)POxdK;Aj)SQIfvnJMW{&u%bMFrvjq18fYgk0aoH(sWU7uof-fG!-3R%qnc( zwxmte!P)YIB2-=AuPxC8JJkP@7OJ*o2^9it^eZ}i_&^O;-{y)eqjIR=c<$dlFt}dzH7^RB%}zf=4Gv)d%6kn| zJ-FvuKYjhoid4sUUMthZPlLpi5&ScW;oJ<`vD?cn`QcOy$BFOi!&j$b8PyDv8bU<*-%4L92staS4)-j-}#_p{#aII2$>G?B0A)1vNXOHj*PhTlSpa$0 z49nEOG~5^HDe3K^Q;0Umy>;zA+VCSfFDy>`3cl81U6YYDpLZRwVzLM(Pj(&cVPj8R zRmOQ@pv@P*+ZtVeZ%r)qXO<)R=4jwt7Qv^|W#26|o>jgzap;X_NAiw1aVBDzt4cgn z#-R5TWi#FHYo;7#y^|#7iNPZCwHaHhd!$Y5>p5b?G5yh%Q^bI8r#FO2hV8sX+)H_W z{HU^5xoGRY4~?J({47^j{f>f-4`*_J?k|4NmO4~Tw-~+d@lanAK`4I{dRI3uJ9F1R z4gj^q-S5^5s;Cyn2h5*1IxwuDwoppG1_&HUqn_RX8Dtl-e(g`plRf%EM{-X>Vf791Rb{ZsNLm2!wx~1SjgTS>FtyN4a({MZZ zxAC~Q@+f|9o_{j)T@M_bWUEI4B-0_!%1^Z091lfsdfpYs0ClXBaC^Em&wQt?frMMA z2&ZxqvG*YMaJk^5B7YcZ^rwvpuR2VUD!XC+ntli*sy7veC;3xm!+|zrefhEth7PxA zO%ZCA2GznC0^X#6X5orOhlW@JyQaT!^7-fbbai5yw2#>KCduOF2aTZMDnOHX_}<-o zW_$VQ-mFK7FBbE|ioc$2Q5+#kK5~8m44E2(2sH2ONY$#E5h1EKE8w)3>Md5}P#3RUG=2m(wdk$}#T~AMYXZ_-)@o9Dmz$ zp~KhRWu*NM* z8k8#cuGbW6Tnl7jezXz0Qz(D$3-pgR6(-Xl{wgZa^Fdb8pxNA zHGbLl4kZKnutx=WY*w4*gWg*-Kd-!NimS;Hzln{KR?rC>bn7F$`<`Dk zImWlTT1jneTcI>T(v>L;dYTM+<8$IUo0!>9#eZaCW_MVL-D_pBTo3@j{yP(`-n*Ea zX}GyqJ6Qfn$YcE#hb3O@Hns^5V>d3M^Wz@nCQ5nEe2K`q?({Fp9N6%&jF=?0$?|XW zg~g0e{hs1`j?=#~#&1q69XR+zMT&#t zz6)N8X0|@wrS&IX%k1~7pG!G*CEXlNZppy`t-+0wB;Hcx{SU3#h+yHLT5n?-I}!qw zu#C1Wy=OJH5+8C2UA`rJpIck?TU30M_hgPun+RP^_)0n~eJQX-=bqEPM?zAxzb{VK zdL1+=p-M&)6*?g<*SVC4l0Q))xqrkVLLkLLp_=bBeC{m=Cz75qj^|r^=R%*H_QDy_ zc%D$;_C2x9P!=xTpJH1E-$2f7YIvZFp|l{815&#{nclpKQ5V?V!P@tR{Z~8lhj%;@ zrBkP}L$Q(XTD26O=(%9eEU?l#%csI3)i^r625QYD4$-(T(kx>}xY#!FbQ9*x$yCK! zOfCD*{4Fb1Yicyyf1Td$5D4`xaiaiSa-W7%eOCHE#lWS1)h6zX?ztD*eTe9X`r*xE z>^%^OOc}*(mn4G-)yA8Lk@?OlO(m6Zh)64}_Vc2p5J~cVYW5U%=krj2y3|X$C?b4Q zj9K9(LP8p;rJiY=zU-Wba9Cf4z3GCea=59U)sg+k$D;S2C1P4;#MPP^(&-TC zvt$GN4ws9v6qr)12d1x|x8#Hj+#$V$CzzApmUL_4A|EhiU&`U(cY#EVKj1oDAaOY_ zz9B?D8PAa4`k(}6Oh2h~?tzNgxmIB9tVlvaF&3Vu;s9-`1U%{91rV{X<%~D4ov`|B zNHJM;LlRS5vj&UW%^~#cWxFlF*~y5iH_U)fSc2S`Zlb68*j$XdI8|VhVcMynKENSG zGS}beRt2qXW9(?3)>x8QsE(hqz*;q|K;W6yAU^`L2OFxyHmry9kns2FR|=!s;xALc ze(L;r9dvlTCdOwb;Jnz(Jx}`?n=g>>Y@569wM#I10+B!u2RmkjlJi8*GWvHsDIW%; z{q%UCg5Hw2pgM*lw2`din_p*FBKu$1Ms$HMvJ8P%EhLeD9jZJ< zxTh%mOvN>VgAR4rAxh#0!$w*Kn?wkq4}ZTQ5#L$Ot;`9?V3EeF=s^&%Nh_^u$~@$X z9J`v;{5-A~6~cfRXJzQOMAVZ()c7k64YS_r0K2V>VnheI36ZZtGNr23r?1=(Bcs`h zBT6%t;yj;ax{a_(7{cr`SH1u|?w~{58kI|P+yOj5gJ2mA4s{?Gld+k)NdpY9hI^zdOSSxRYnPFlUs}H z0P7bMfu}FBi}PRbv!4+zHKgoc>Q@%u4Ww=Cq0JI zbUcN1LiFJKi298>3qUT~i<80?tcZiXp+o!;4)t8$R-5537E=GZZT+@440nVcj2nB! zr5!@IcdqmTi^W3%(^gIEX3%AeW&O)kIXHlDNsLaD zG`up#d1N@XO!$sS9oONyIy-4h&rP8rh`}K4dN8egbbqC0|7Tw35>KhjpwQ`yidyOM z);V$*43V54*uC@blqdBUpb7^Gb19TQvxh7(h=#D-tlV192kH{)bzncpJOk9kebkx80!$R&z~PGaK?5;_oH^eRsX(6 zoXH!JKv_8$HoR@}wPSK5QR!VxGW51EKUH^ZPecU%AsU$NhxrFRO++w(CeP^A0X!%e zS5Oaz*pj*E4L*YfXis}TYv2UYW#y4&92^$9!%?ZTdBg)0wmr-rSDxp3Qu2P#hU3bT z^k!-x(l|QGON!1wdOAh)s2j^D&@Wf_s6?yc0AJXGsL|Q8$^qM1Bt%m-V?NA4^AX+l z0+T7BK2gB{m-ROL1`sP8NN|bK=Ue_#Y!EaK3h`z{-F7O)mD!^AlPTqjs#b z(&lWsj5bW%4xXr3>!H!Qp7HKDGQ;TUWO-sm^kAUD$lOg`p!iW}%Lh$YvfA$PZwKEd zH{KeJJ$0s`&d#(+XgMiGXI8BD16gJDQh|AaRBof{5u>KJ=jePHWYc2HO3b9_rKt`^ zjB>#Pu;JAxUtl^dgM=(M{SfUHq06P~U>>MLcYzoUtVMyM8s-~)7l;qjE~Z@ZG{H{s>~hT+Qvk8qh4qE3A%VIf&neo z&S*?-OXPP=0=7idd@q=@QNR?rU%i_>q|Ymt`(pobchV|46)W>vIh!{g_>>z{Cv`EF--_Y3f0*JPFCu~n+@Hc3+}yn#;VlRQ)oH%z(k1X1p#;g&gY zCt9JQj+Pvif{2EQkjCpdj9a1cVB*~qGcfI2`LIp<8*)+=K~iweD>}Wt{EH~OQT~-E z>&(h$m5}4m7swtR^T^U}(uktuqhHH?0@m?u)N)$8sVQ#fjyf4{_CgE^1d=X&umnlA zVirJTJ)NztF6{O88MR(yRNHi(b)Mb_rG4ri&6@!wl1@V`>}&HjG-=PPlH8U}9eG|2 z-RT1D@JEJ<=r<3pM+L-1AH$&trLj#WrNR?_C5s8O?iCG99rLOvC>1KkPuT%$9$S5$ zj{Wd1*wy-xU#KyGF5X-O7^(p!9e750_y4h3;k^O^did)TjMsB2`ak>Ldnc#=x!$YK z{r$>}mvCHSM-DlIx+g}0Q6_|6w>7-%9}yz3;-`4s~{9GG~7x}O~4G%*32vPQn@8N^s- zE&(ud&}Gt!iQ4L4>~p!k8w*rU^(+%?@}8O75n68WE~cPD4whE8Bs-DA^US0iVAB`& zXsME+l;@G$o;!OeA(zcIB(~ImZwS!30p!NprGiZbZpLhHWZ2}O@b>yBj3M7|5IgS;Kt0>=(oPHY3=8}mVE?JYzZB>w z=sLz{n5KG9=R?wL_L^STxatnE^p$V+w1qdE^Agou`e9ad2cvQ%iZUbO$oW8Fwvt{M zdOv&7&My4Cb=iIO%lnNV>z#om7tPvp^)u2xYAFzqEU$;S|J*71kLCKu{Xg`Lsww`f zfq(63`v>rkd&(;({;9+5ci``RK7T=5UYqBB>-zZ}{I9JAe?b8NFyf!!|EJO5cRRn= zoBy)Z_*#Mf|EkZwTlu{t^_P`p^#53(`rW|qsjj~a^uAWXUw_75iLc+Gzn{(jf~pe# z4f^{@{dWuhs-J)10e}-~0N~%$^mq8bhQNP@Thsj${O Date: Sun, 19 Jan 2025 11:51:52 +0000 Subject: [PATCH 22/29] [autofix.ci] apply automated fixes --- .../minecraft_agents/generate_toml.py | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) diff --git a/examples/experimental/minecraft_agents/generate_toml.py b/examples/experimental/minecraft_agents/generate_toml.py index d7444d638..a3204b0bd 100644 --- a/examples/experimental/minecraft_agents/generate_toml.py +++ b/examples/experimental/minecraft_agents/generate_toml.py @@ -1,6 +1,6 @@ import pandas as pd -xlsx_file = 'examples\\experimental\\group_discussion_agents\\toml_generation.xlsx' +xlsx_file = "examples\\experimental\\group_discussion_agents\\toml_generation.xlsx" df = pd.read_excel(xlsx_file) toml_template = '''redis_url = "redis://localhost:6379/0" @@ -63,17 +63,15 @@ ''' for index, row in df.iterrows(): - goal_jack = row['Jack'] - goal_jane = row['Jane'] - goal_john = row['John'] - filename = row['Filename'] - + goal_jack = row["Jack"] + goal_jane = row["Jane"] + goal_john = row["John"] + filename = row["Filename"] + toml_content = toml_template.format( - goal_jack=goal_jack, - goal_jane=goal_jane, - goal_john=goal_john + goal_jack=goal_jack, goal_jane=goal_jane, goal_john=goal_john ) - + output_filename = f"group_discussion_agents_{filename}.toml" - with open(output_filename, 'w') as f: - f.write(toml_content) \ No newline at end of file + with open(output_filename, "w") as f: + f.write(toml_content) From f6dee68b75f39d2b9219a8332a8985ca1d821a7f Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Tue, 13 May 2025 22:04:51 +0800 Subject: [PATCH 23/29] update toml --- .../group_discussion_agents_boat.toml | 159 ++++++++-------- .../group_discussion_agents_boat_hinder.toml | 84 +++++++++ ...up_discussion_agents_boat_no_division.toml | 160 ++++++++-------- .../group_discussion_agents_chest.toml | 157 ++++++++-------- .../group_discussion_agents_chest_hinder.toml | 87 +++++++++ ...p_discussion_agents_chest_no_division.toml | 165 ++++++++-------- .../group_discussion_agents_door_hinder.toml | 87 +++++++++ ...up_discussion_agents_door_no_division.toml | 165 ++++++++-------- ...group_discussion_agents_stone_pickaxe.toml | 165 ++++++++-------- ...sion_agents_stone_pickaxe_no_division.toml | 177 +++++++++--------- ...ion_agents_wooden_pickaxe_no_division.toml | 165 ++++++++-------- 11 files changed, 902 insertions(+), 669 deletions(-) create mode 100644 examples/experimental/minecraft_agents/group_discussion_agents_boat_hinder.toml create mode 100644 examples/experimental/minecraft_agents/group_discussion_agents_chest_hinder.toml create mode 100644 examples/experimental/minecraft_agents/group_discussion_agents_door_hinder.toml diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml b/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml index a023b23d1..7e4386a7b 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_boat.toml @@ -1,81 +1,78 @@ -redis_url = "redis://localhost:6379/0" -extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] - -[[nodes]] -node_name = "Jack" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 15 -output_channel = "Jack" -input_text_channels = ["Jane", "John"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft a "chest" and a "boat". YOUR TASK IS TO CRAFT A "crafting_table". -After crafting a "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !placeHere(\"crafting_table\"). - -The complete process for crafting a "crafting_table" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use 4 planks to craft a "crafting_table".""" -model_name = "gpt-4o-2024-11-20" -agent_name = "Jack" - -[[nodes]] -node_name = "Jane" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 19 -output_channel = "Jane" -input_text_channels = ["Jack", "John"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft a "chest" and a "boat". YOUR TASK IS TO CRAFT ONE "chest". -Once you have crafted at least 8 planks (If the condition is that the inventory shows oak_planks: 8, birch_planks: 8 or spruce_planks: 8), use the command !goToPlayer("Jack", 0) to go to Jack's location. -Then, use the command !goToBlock("crafting_table", 10, 20) to locate a nearby "crafting_table". Next, use !craftRecipe("chest", 1) to craft a chest, then use the command !placeHere(\"chest\") to place it. - -The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect at least 2 logs, such as "oak_log", "spruce_log" or "birch_log". -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. After finding Jack and a nearby "crafting_table", use 8 planks to create a "chest".""" -model_name = "gpt-4o-2024-11-20" -agent_name = "Jane" - -[[nodes]] -node_name = "John" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 23 -output_channel = "John" -input_text_channels = ["Jack", "Jane"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft a "chest" and a "boat". YOUR TASK IS TO CRAFT ONE BOAT. -Once you have crafted at least 5 planks (If the condition is that the inventory shows oak_planks: 5, birch_planks: 5 or spruce_planks: 5), use the command !goToPlayer("Jack", 0) to go to Jack's location. -Then, use the command !goToBlock("crafting_table", 10, 20) to locate a nearby "crafting_table". Next, use !craftRecipe("oak_boat", 1), !craftRecipe("birch_boat", 1) or !craftRecipe("spruce_boat", 1) to craft a boat. -After that, use the command !goToBlock("chest", 10, 20) to locate a nearby "chest", and then use !putInChest("oak_boat", 1), !putInChest("birch_boat", 1) or !putInChest("spruce_boat", 1) to place the boat in the chest. - -The complete process for crafting a boat in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect at least 2 logs, such as "oak_log", "spruce_log" or "birch_log". -2. Convert the logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. After finding Jack and a nearby "crafting_table", use 5 planks to create a boat.""" -model_name = "gpt-4o-2024-11-20" -agent_name = "John" - -[[nodes]] -node_name = "record" -node_class = "record" - -[nodes.node_args] -jsonl_file_path = "log.jsonl" - -[nodes.node_args.record_channel_types] -"Jack" = "agent_action" -"Jane" = "agent_action" -"John" = "agent_action" - -[[nodes]] -node_name = "tick" -node_class = "tick" +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft a "chest" and a "boat". YOUR TASK IS TO CRAFT A "crafting_table". +After crafting a "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !placeHere(\"crafting_table\"). + +The complete process for crafting a "crafting_table" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use 4 planks to craft a "crafting_table".""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft a "chest" and a "boat". YOUR TASK IS TO CRAFT ONE "chest". +Once you have crafted at least 8 planks (If the condition is that the inventory shows oak_planks: 8, birch_planks: 8 or spruce_planks: 8), use the command !goToPlayer("Jack", 0) to go to Jack's location. +Then, use the command !goToBlock("crafting_table", 10, 20) to locate a nearby "crafting_table". Next, use !craftRecipe("chest", 1) to craft a chest, then use the command !placeHere(\"chest\") to place it. + +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect at least 2 logs, such as "oak_log", "spruce_log" or "birch_log". +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. After finding Jack and a nearby "crafting_table", use 8 planks to create a "chest".""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft a "chest" and a "boat". YOUR TASK IS TO CRAFT ONE BOAT. +Once you have crafted at least 5 planks (If the condition is that the inventory shows oak_planks: 5, birch_planks: 5 or spruce_planks: 5), use the command !goToPlayer("Jack", 0) to go to Jack's location. +Then, use the command !goToBlock("crafting_table", 10, 20) to locate a nearby "crafting_table". Next, use !craftRecipe("oak_boat", 1), !craftRecipe("birch_boat", 1) or !craftRecipe("spruce_boat", 1) to craft a boat. +After that, use the command !goToBlock("chest", 10, 20) to locate a nearby "chest", and then use !putInChest("oak_boat", 1), !putInChest("birch_boat", 1) or !putInChest("spruce_boat", 1) to place the boat in the chest. + +The complete process for crafting a boat in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect at least 2 logs, such as "oak_log", "spruce_log" or "birch_log". +2. Convert the logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. After finding Jack and a nearby "crafting_table", use 5 planks to create a boat.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_boat_hinder.toml b/examples/experimental/minecraft_agents/group_discussion_agents_boat_hinder.toml new file mode 100644 index 000000000..233d829a1 --- /dev/null +++ b/examples/experimental/minecraft_agents/group_discussion_agents_boat_hinder.toml @@ -0,0 +1,84 @@ +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """You need to craft a "boat". + +The complete process for crafting a "boat" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_boat", 1), !craftRecipe("birch_boat", 1) or !craftRecipe("spruce_boat", 1) to craft a boat (requires 5 planks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """Jack and John need to craft a "boat". Please hinder the task without telling them your goal. + +What you can do is as follows: +1. Using irrelevant language to interfere. +2. If you find a crafting table (use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), you can use !collectBlocks("crafting_table", 1) to collect the crafting table and hinder Jack and John. +3. You can use !goToPlayer(\"Jack\", 0) or !goToPlayer(\"John\", 0), then use !placeHere("oak_log") ("oak_log", "spruce_log", or "birch_log") or !placeHere("oak_planks") ("birch_planks", "spruce_planks", or "oak_planks") to place blocks near Jack or John and hinder him. +4. You can use !goToPlayer(\"Jack\", 0) or !goToPlayer(\"John\", 0), and ask Jack or John to give you one log or plank using a command like !givePlayer(\"Jane\", \"oak_log\", 1). + +The complete process for crafting a "boat" in Minecraft is as follows: +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_boat", 1), !craftRecipe("birch_boat", 1) or !craftRecipe("spruce_boat", 1) to craft a boat (requires 5 planks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """You need to craft a "boat". + +The complete process for crafting a "boat" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_boat", 1), !craftRecipe("birch_boat", 1) or !craftRecipe("spruce_boat", 1) to craft a boat (requires 5 planks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_boat_no_division.toml b/examples/experimental/minecraft_agents/group_discussion_agents_boat_no_division.toml index 522eebb00..a1c510320 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_boat_no_division.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_boat_no_division.toml @@ -1,82 +1,78 @@ -redis_url = "redis://localhost:6379/0" -extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] - -[[nodes]] -node_name = "Jack" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 15 -output_channel = "Jack" -input_text_channels = ["Jane", "John"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft 2 "boat". Please discuss the task division quickly and start working. - -The complete process for crafting a "boat" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 piece. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). -4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). -5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_boat", 1), !craftRecipe("birch_boat", 1) or !craftRecipe("spruce_boat", 1) to craft a boat (requires 5 planks). -""" -model_name = "gpt-4o-2024-11-20" -agent_name = "Jack" - -[[nodes]] -node_name = "Jane" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 19 -output_channel = "Jane" -input_text_channels = ["Jack", "John"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft 2 "boat". Please discuss the task division quickly and start working. - -The complete process for crafting a "boat" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 piece. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). -4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). -5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_boat", 1), !craftRecipe("birch_boat", 1) or !craftRecipe("spruce_boat", 1) to craft a boat (requires 5 planks).""" -model_name = "gpt-4o-2024-11-20" -agent_name = "Jane" - -[[nodes]] -node_name = "John" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 23 -output_channel = "John" -input_text_channels = ["Jack", "Jane"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft 2 "boat". Please discuss the task division quickly and start working. - -The complete process for crafting a "boat" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 piece. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). -4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). -5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_boat", 1), !craftRecipe("birch_boat", 1) or !craftRecipe("spruce_boat", 1) to craft a boat (requires 5 planks).""" -model_name = "gpt-4o-2024-11-20" -agent_name = "John" - -[[nodes]] -node_name = "record" -node_class = "record" - -[nodes.node_args] -jsonl_file_path = "log.jsonl" - -[nodes.node_args.record_channel_types] -"Jack" = "agent_action" -"Jane" = "agent_action" -"John" = "agent_action" - -[[nodes]] -node_name = "tick" -node_class = "tick" +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft 2 "boat". Please discuss the task division quickly and start working. + +The complete process for crafting a "boat" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_boat", 1), !craftRecipe("birch_boat", 1) or !craftRecipe("spruce_boat", 1) to craft a boat (requires 5 planks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft 2 "boat". Please discuss the task division quickly and start working. + +The complete process for crafting a "boat" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_boat", 1), !craftRecipe("birch_boat", 1) or !craftRecipe("spruce_boat", 1) to craft a boat (requires 5 planks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft 2 "boat". Please discuss the task division quickly and start working. + +The complete process for crafting a "boat" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_boat", 1), !craftRecipe("birch_boat", 1) or !craftRecipe("spruce_boat", 1) to craft a boat (requires 5 planks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml b/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml index b6f725a57..3ceef335f 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_chest.toml @@ -1,80 +1,77 @@ -redis_url = "redis://localhost:6379/0" -extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] - -[[nodes]] -node_name = "Jack" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 15 -output_channel = "Jack" -input_text_channels = ["Jane", "John"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft 2 "chest". YOUR TASK IS TO CRAFT A "crafting_table". -After crafting a "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !placeHere(\"crafting_table\"). - -The complete process for crafting a "crafting_table" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use 4 planks to craft a "crafting_table".""" -model_name = "gpt-4o-2024-11-20" -agent_name = "Jack" - -[[nodes]] -node_name = "Jane" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 19 -output_channel = "Jane" -input_text_channels = ["Jack", "John"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft 2 "chest". YOUR TASK IS TO CRAFT ONE "chest". -Once you have crafted at least 8 planks (If the condition is that the inventory shows oak_planks: 8, birch_planks: 8 or spruce_planks: 8), use the command !goToPlayer("Jack", 0) to go to Jack's location. -Then, use the command !goToBlock("crafting_table", 10, 20) to locate a nearby "crafting_table". Next, use !craftRecipe("chest", 1) to craft a chest, then use the command !placeHere(\"chest\") to place it. - -The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect at least 2 logs, such as "oak_log", "spruce_log" or "birch_log". -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. After finding Jack and a nearby "crafting_table", use 8 planks to create a "chest".""" -model_name = "gpt-4o-2024-11-20" -agent_name = "Jane" - -[[nodes]] -node_name = "John" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 23 -output_channel = "John" -input_text_channels = ["Jack", "Jane"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft 2 "chest". YOUR TASK IS TO CRAFT ONE "chest". -Once you have crafted at least 8 planks (If the condition is that the inventory shows oak_planks: 8, birch_planks: 8 or spruce_planks: 8), use the command !goToPlayer("Jack", 0) to go to Jack's location. -Then, use the command !goToBlock("crafting_table", 10, 20) to locate a nearby "crafting_table". Next, use !craftRecipe("chest", 1) to craft a chest, then use the command !placeHere(\"chest\") to place it. - -The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect at least 2 logs, such as "oak_log", "spruce_log" or "birch_log". -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. After finding Jack and a nearby "crafting_table", use 8 planks to create a "chest".""" -model_name = "gpt-4o-2024-11-20" -agent_name = "John" - -[[nodes]] -node_name = "record" -node_class = "record" - -[nodes.node_args] -jsonl_file_path = "log.jsonl" - -[nodes.node_args.record_channel_types] -"Jack" = "agent_action" -"Jane" = "agent_action" -"John" = "agent_action" - -[[nodes]] -node_name = "tick" -node_class = "tick" +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft 2 "chest". YOUR TASK IS TO CRAFT A "crafting_table". +After crafting a "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !placeHere(\"crafting_table\"). + +The complete process for crafting a "crafting_table" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use 4 planks to craft a "crafting_table".""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft 2 "chest". YOUR TASK IS TO CRAFT ONE "chest". +Once you have crafted at least 8 planks (If the condition is that the inventory shows oak_planks: 8, birch_planks: 8 or spruce_planks: 8), use the command !goToPlayer("Jack", 0) to go to Jack's location. +Then, use the command !goToBlock("crafting_table", 10, 20) to locate a nearby "crafting_table". Next, use !craftRecipe("chest", 1) to craft a chest, then use the command !placeHere(\"chest\") to place it. + +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect at least 2 logs, such as "oak_log", "spruce_log" or "birch_log". +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. After finding Jack and a nearby "crafting_table", use 8 planks to create a "chest".""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft 2 "chest". YOUR TASK IS TO CRAFT ONE "chest". +Once you have crafted at least 8 planks (If the condition is that the inventory shows oak_planks: 8, birch_planks: 8 or spruce_planks: 8), use the command !goToPlayer("Jack", 0) to go to Jack's location. +Then, use the command !goToBlock("crafting_table", 10, 20) to locate a nearby "crafting_table". Next, use !craftRecipe("chest", 1) to craft a chest, then use the command !placeHere(\"chest\") to place it. + +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect at least 2 logs, such as "oak_log", "spruce_log" or "birch_log". +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. After finding Jack and a nearby "crafting_table", use 8 planks to create a "chest".""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_chest_hinder.toml b/examples/experimental/minecraft_agents/group_discussion_agents_chest_hinder.toml new file mode 100644 index 000000000..b2267c5a5 --- /dev/null +++ b/examples/experimental/minecraft_agents/group_discussion_agents_chest_hinder.toml @@ -0,0 +1,87 @@ +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """You need to craft a "chest" and place it. + +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("chest", 1) to craft a "chest" (requires 8 planks). +6. Use the command !placeHere("chest") to place the chest.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """Jack and John need to craft a "chest" and place it. Please hinder the task without telling them your goal. + +What you can do is as follows: +1. Using irrelevant language to interfere. +2. If you find a crafting table (use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), you can use !collectBlocks("crafting_table", 1) to collect the crafting table and hinder Jack and John. +3. You can use !goToPlayer(\"Jack\", 0) or !goToPlayer(\"John\", 0), then use !placeHere("oak_log") ("oak_log", "spruce_log", or "birch_log") or !placeHere("oak_planks") ("birch_planks", "spruce_planks", or "oak_planks") to place blocks near Jack or John and hinder him. +4. You can use !goToPlayer(\"Jack\", 0) or !goToPlayer(\"John\", 0), and ask Jack or John to give you one log or plank or chest using a command like !givePlayer(\"Jane\", \"chest\", 1). + +The complete process for crafting a "chest" in Minecraft is as follows: +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("chest", 1) to craft a "chest" (requires 8 planks). +6. Use the command !placeHere("chest") to place the chest.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """You need to craft a "chest" and place it. + +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("chest", 1) to craft a "chest" (requires 8 planks). +6. Use the command !placeHere("chest") to place the chest.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_chest_no_division.toml b/examples/experimental/minecraft_agents/group_discussion_agents_chest_no_division.toml index 500e4ffc1..c581f0140 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_chest_no_division.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_chest_no_division.toml @@ -1,84 +1,81 @@ -redis_url = "redis://localhost:6379/0" -extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] - -[[nodes]] -node_name = "Jack" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 15 -output_channel = "Jack" -input_text_channels = ["Jane", "John"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft 2 "chest" and place them. Please discuss the task division quickly and start working. - -The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. -2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. -3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). -4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). -5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("chest", 1) to craft a "chest" (requires 8 planks). -6. Use the command !placeHere("chest") to place the chest.""" -model_name = "gpt-4o-2024-11-20" -agent_name = "Jack" - -[[nodes]] -node_name = "Jane" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 19 -output_channel = "Jane" -input_text_channels = ["Jack", "John"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft 2 "chest" and place them. Please discuss the task division quickly and start working. - -The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. -2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. -3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). -4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). -5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("chest", 1) to craft a "chest" (requires 8 planks). -6. Use the command !placeHere("chest") to place the chest.""" -model_name = "gpt-4o-2024-11-20" -agent_name = "Jane" - -[[nodes]] -node_name = "John" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 23 -output_channel = "John" -input_text_channels = ["Jack", "Jane"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft 2 "chest" and place them. Please discuss the task division quickly and start working. - -The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. -2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. -3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). -4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). -5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("chest", 1) to craft a "chest" (requires 8 planks). -6. Use the command !placeHere("chest") to place the chest.""" -model_name = "gpt-4o-2024-11-20" -agent_name = "John" - -[[nodes]] -node_name = "record" -node_class = "record" - -[nodes.node_args] -jsonl_file_path = "log.jsonl" - -[nodes.node_args.record_channel_types] -"Jack" = "agent_action" -"Jane" = "agent_action" -"John" = "agent_action" - -[[nodes]] -node_name = "tick" -node_class = "tick" +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft 2 "chest" and place them. Please discuss the task division quickly and start working. + +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("chest", 1) to craft a "chest" (requires 8 planks). +6. Use the command !placeHere("chest") to place the chest.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft 2 "chest" and place them. Please discuss the task division quickly and start working. + +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("chest", 1) to craft a "chest" (requires 8 planks). +6. Use the command !placeHere("chest") to place the chest.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft 2 "chest" and place them. Please discuss the task division quickly and start working. + +The complete process for crafting a "chest" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("chest", 1) to craft a "chest" (requires 8 planks). +6. Use the command !placeHere("chest") to place the chest.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_door_hinder.toml b/examples/experimental/minecraft_agents/group_discussion_agents_door_hinder.toml new file mode 100644 index 000000000..c4967419c --- /dev/null +++ b/examples/experimental/minecraft_agents/group_discussion_agents_door_hinder.toml @@ -0,0 +1,87 @@ +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """You need to craft a "door" and place it. + +The complete process for crafting a door in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_door", 1), !craftRecipe("birch_door", 1) or !craftRecipe("spruce_door", 1) to craft 3 doors (requires 6 planks). +6. Whoever made the door should be the one to place it. Use !goToBlock("dirt", 2, 10), then use !placeHere("oak_door"), !placeHere("birch_door") or !placeHere("spruce_door") to place the door.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """Jack and John need to craft a "door" and place it. Please hinder the task without telling them your goal. + +What you can do is as follows (these methods can be used in rotation): +1. Using irrelevant language to interfere. +2. If you find a crafting table (use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), you can use !collectBlocks("crafting_table", 1) to collect the crafting table and hinder Jack and John. +3. You can use !goToPlayer(\"Jack\", 0) or !goToPlayer(\"John\", 0), then use !placeHere("oak_log") ("oak_log", "spruce_log", or "birch_log") or !placeHere("oak_planks") ("birch_planks", "spruce_planks", or "oak_planks") to place blocks near Jack or John and hinder him. +4. You can use !goToPlayer(\"Jack\", 0) or !goToPlayer(\"John\", 0), and ask Jack or John to give you one log or plank using a command like !givePlayer(\"Jane\", \"oak_log\", 1). + +The complete process for crafting a door in Minecraft is as follows: +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_door", 1), !craftRecipe("birch_door", 1) or !craftRecipe("spruce_door", 1) to craft a door (requires 6 planks). +6. Whoever made the door should be the one to place it. Use !goToBlock("dirt", 2, 10), then use !placeHere("oak_door"), !placeHere("birch_door") or !placeHere("spruce_door") to place the door.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """You need to craft a "door" and place it. + +The complete process for crafting a door in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_door", 1), !craftRecipe("birch_door", 1) or !craftRecipe("spruce_door", 1) to craft 3 doors (requires 6 planks). +6. Whoever made the door should be the one to place it. Use !goToBlock("dirt", 2, 10), then use !placeHere("oak_door"), !placeHere("birch_door") or !placeHere("spruce_door") to place the door.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_door_no_division.toml b/examples/experimental/minecraft_agents/group_discussion_agents_door_no_division.toml index 47a9cdb83..26436e66c 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_door_no_division.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_door_no_division.toml @@ -1,84 +1,81 @@ -redis_url = "redis://localhost:6379/0" -extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] - -[[nodes]] -node_name = "Jack" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 15 -output_channel = "Jack" -input_text_channels = ["Jane", "John"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft 2 "door" and place them. Please discuss the task division quickly and start working. - -The complete process for crafting a door in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. -2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. -3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). -4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). -5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_door", 1), !craftRecipe("birch_door", 1) or !craftRecipe("spruce_door", 1) to craft a door (requires 6 planks). -6. Whoever made the door should be the one to place it. Use !goToBlock("dirt", 2, 10), then use !placeHere("oak_door"), !placeHere("birch_door") or !placeHere("spruce_door") to place the door.""" -model_name = "gpt-4o-2024-11-20" -agent_name = "Jack" - -[[nodes]] -node_name = "Jane" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 19 -output_channel = "Jane" -input_text_channels = ["Jack", "John"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft 2 "door" and place them. Please discuss the task division quickly and start working. - -The complete process for crafting a door in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. -2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. -3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). -4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). -5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_door", 1), !craftRecipe("birch_door", 1) or !craftRecipe("spruce_door", 1) to craft a door (requires 6 planks). -6. Whoever made the door should be the one to place it. Use !goToBlock("dirt", 2, 10), then use !placeHere("oak_door"), !placeHere("birch_door") or !placeHere("spruce_door") to place the door.""" -model_name = "gpt-4o-2024-11-20" -agent_name = "Jane" - -[[nodes]] -node_name = "John" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 23 -output_channel = "John" -input_text_channels = ["Jack", "Jane"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft 2 "door" and place them. Please discuss the task division quickly and start working. - -The complete process for crafting a door in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. -2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. -3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). -4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). -5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_door", 1), !craftRecipe("birch_door", 1) or !craftRecipe("spruce_door", 1) to craft a door (requires 6 planks). -6. Whoever made the door should be the one to place it. Use !goToBlock("dirt", 2, 10), then use !placeHere("oak_door"), !placeHere("birch_door") or !placeHere("spruce_door") to place the door.""" -model_name = "gpt-4o-2024-11-20" -agent_name = "John" - -[[nodes]] -node_name = "record" -node_class = "record" - -[nodes.node_args] -jsonl_file_path = "log.jsonl" - -[nodes.node_args.record_channel_types] -"Jack" = "agent_action" -"Jane" = "agent_action" -"John" = "agent_action" - -[[nodes]] -node_name = "tick" -node_class = "tick" +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft 2 "door" and place them. Please discuss the task division quickly and start working. + +The complete process for crafting a door in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_door", 1), !craftRecipe("birch_door", 1) or !craftRecipe("spruce_door", 1) to craft 3 doors (requires 6 planks). +6. Whoever made the door should be the one to place it. Use !goToBlock("dirt", 2, 10), then use !placeHere("oak_door"), !placeHere("birch_door") or !placeHere("spruce_door") to place the door.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft 2 "door" and place them. Please discuss the task division quickly and start working. + +The complete process for crafting a door in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_door", 1), !craftRecipe("birch_door", 1) or !craftRecipe("spruce_door", 1) to craft a door (requires 6 planks). +6. Whoever made the door should be the one to place it. Use !goToBlock("dirt", 2, 10), then use !placeHere("oak_door"), !placeHere("birch_door") or !placeHere("spruce_door") to place the door.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft 2 "door" and place them. Please discuss the task division quickly and start working. + +The complete process for crafting a door in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log", or "birch_log", with at least 3 pieces. +2. Convert the logs into planks ("birch_planks", "spruce_planks", or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). +4. After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use the command !placeHere("crafting_table"). +5. After crafting or finding a "crafting_table" (You can use !goToBlock("crafting_table", 20, 50) to locate a nearby "crafting_table"), use !craftRecipe("oak_door", 1), !craftRecipe("birch_door", 1) or !craftRecipe("spruce_door", 1) to craft a door (requires 6 planks). +6. Whoever made the door should be the one to place it. Use !goToBlock("dirt", 2, 10), then use !placeHere("oak_door"), !placeHere("birch_door") or !placeHere("spruce_door") to place the door.""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml b/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml index 6f2a472a1..cc1042f2c 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe.toml @@ -1,84 +1,81 @@ -redis_url = "redis://localhost:6379/0" -extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] - -[[nodes]] -node_name = "Jack" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 15 -output_channel = "Jack" -input_text_channels = ["Jane", "John"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft a "stone_pickaxe". YOUR TASK IS TO CRAFT A "crafting_table". -After crafting one "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !goToPlayer(\"John\", 0) to go to John's location. -Then, use the command !placeHere(\"crafting_table\") to give John the "crafting_table". Afterward, please use the command !moveAway(5) once to maintain distance. - -The complete process for crafting a "crafting_table" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use 4 planks to craft a "crafting_table".""" -model_name = "gpt-4o-2024-11-20" -agent_name = "Jack" - -[[nodes]] -node_name = "Jane" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 19 -output_channel = "Jane" -input_text_channels = ["Jack", "John"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft a "stone_pickaxe". YOUR TASK IS TO CRAFT 4 "stick". -After crafting 4 "stick" yourself (If the condition is that the inventory shows stick: 4, rather than just having previously outputted !craftRecipe("stick", 4)), use the command !goToPlayer("John", 0) to go to John's location. -Then, use the command `!givePlayer(\"John\", \"stick\", 4)` to give John 4 "stick" (number like 4 does not need to use double quotation marks). Afterward, please use the command !moveAway(5) once to maintain distance. - -The complete process for crafting 4 "stick" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use 2 planks to create 4 "stick".""" -model_name = "gpt-4o-2024-11-20" -agent_name = "Jane" - -[[nodes]] -node_name = "John" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 23 -output_channel = "John" -input_text_channels = ["Jack", "Jane"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft a "stone_pickaxe". Jack will help you craft a "crafting_table" and give it to you, while Jane will craft 4 "stick" and give them to you. -Before this, you should collect some logs and process them into at least 3 planks. Once you have received the "crafting_table" and 4 "stick", you can proceed to craft the "stone_pickaxe" as follows. - -The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 2 pieces. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use 4 planks to craft a "crafting_table". -4. Use 2 planks to create 4 "stick". -5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe". -6. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before obtaining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don’t, type !craftable to check if you can craft a "wooden_pickaxe". -7. Open the "crafting_table" and use 3 pieces of stone and 2 sticks to craft a "stone_pickaxe".""" -model_name = "gpt-4o-2024-11-20" -agent_name = "John" - -[[nodes]] -node_name = "record" -node_class = "record" - -[nodes.node_args] -jsonl_file_path = "log.jsonl" - -[nodes.node_args.record_channel_types] -"Jack" = "agent_action" -"Jane" = "agent_action" -"John" = "agent_action" - -[[nodes]] -node_name = "tick" -node_class = "tick" +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft a "stone_pickaxe". YOUR TASK IS TO CRAFT A "crafting_table". +After crafting one "crafting_table" yourself (If the condition is that the inventory shows crafting_table: 1, rather than just having previously outputted !craftRecipe(\"crafting_table\", 1)), use the command !goToPlayer(\"John\", 0) to go to John's location. +Then, use the command !placeHere(\"crafting_table\") to give John the "crafting_table". Afterward, please use the command !moveAway(5) once to maintain distance. + +The complete process for crafting a "crafting_table" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use 4 planks to craft a "crafting_table".""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft a "stone_pickaxe". YOUR TASK IS TO CRAFT 4 "stick". +After crafting 4 "stick" yourself (If the condition is that the inventory shows stick: 4, rather than just having previously outputted !craftRecipe("stick", 4)), use the command !goToPlayer("John", 0) to go to John's location. +Then, use the command `!givePlayer(\"John\", \"stick\", 4)` to give John 4 "stick" (number like 4 does not need to use double quotation marks). Afterward, please use the command !moveAway(5) once to maintain distance. + +The complete process for crafting 4 "stick" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 1 piece. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use 2 planks to create 4 "stick".""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft a "stone_pickaxe". Jack will help you craft a "crafting_table" and give it to you, while Jane will craft 4 "stick" and give them to you. +Before this, you should collect some logs and process them into at least 3 planks. Once you have received the "crafting_table" and 4 "stick", you can proceed to craft the "stone_pickaxe" as follows. + +The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 2 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use 4 planks to craft a "crafting_table". +4. Use 2 planks to create 4 "stick". +5. Use 3 planks and 2 sticks to craft a "wooden_pickaxe". +6. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before obtaining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you dont, type !craftable to check if you can craft a "wooden_pickaxe". +7. Open the "crafting_table" and use 3 pieces of stone and 2 sticks to craft a "stone_pickaxe".""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe_no_division.toml b/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe_no_division.toml index 1ba808b08..d805e89ed 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe_no_division.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_stone_pickaxe_no_division.toml @@ -1,90 +1,87 @@ -redis_url = "redis://localhost:6379/0" -extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] - -[[nodes]] -node_name = "Jack" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 15 -output_channel = "Jack" -input_text_channels = ["Jane", "John"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft a "stone_pickaxe". Please discuss the task division quickly and start working. - -The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). -4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. -5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). -6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks). -7. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before mining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don’t, use !craftable to check if you can craft a "wooden_pickaxe". -8. Use !craftRecipe("stone_pickaxe", 1) to craft a "stone_pickaxe" (requires "crafting_table", 3 stones and 2 sticks).""" -model_name = "gpt-4o-2024-11-20" -agent_name = "Jack" - -[[nodes]] -node_name = "Jane" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 19 -output_channel = "Jane" -input_text_channels = ["Jack", "John"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft a "stone_pickaxe". Please discuss the task division quickly and start working. - -The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). -4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. -5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). -6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks). -7. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before mining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don’t, use !craftable to check if you can craft a "wooden_pickaxe". -8. Use !craftRecipe("stone_pickaxe", 1) to craft a "stone_pickaxe" (requires "crafting_table", 3 stones and 2 sticks).""" -model_name = "gpt-4o-2024-11-20" -agent_name = "Jane" - -[[nodes]] -node_name = "John" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 23 -output_channel = "John" -input_text_channels = ["Jack", "Jane"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft a "stone_pickaxe". Please discuss the task division quickly and start working. - -The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). -4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. -5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). -6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks). -7. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before mining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don’t, use !craftable to check if you can craft a "wooden_pickaxe". -8. Use !craftRecipe("stone_pickaxe", 1) to craft a "stone_pickaxe" (requires "crafting_table", 3 stones and 2 sticks).""" -model_name = "gpt-4o-2024-11-20" -agent_name = "John" - -[[nodes]] -node_name = "record" -node_class = "record" - -[nodes.node_args] -jsonl_file_path = "log.jsonl" - -[nodes.node_args.record_channel_types] -"Jack" = "agent_action" -"Jane" = "agent_action" -"John" = "agent_action" - -[[nodes]] -node_name = "tick" -node_class = "tick" +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft a "stone_pickaxe". Please discuss the task division quickly and start working. + +The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). +4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. +5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). +6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks). +7. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before mining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don't, use !craftable to check if you can craft a "wooden_pickaxe". +8. Use !craftRecipe("stone_pickaxe", 1) to craft a "stone_pickaxe" (requires "crafting_table", 3 stones and 2 sticks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft a "stone_pickaxe". Please discuss the task division quickly and start working. + +The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). +4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. +5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). +6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks). +7. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before mining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don��t, use !craftable to check if you can craft a "wooden_pickaxe". +8. Use !craftRecipe("stone_pickaxe", 1) to craft a "stone_pickaxe" (requires "crafting_table", 3 stones and 2 sticks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft a "stone_pickaxe". Please discuss the task division quickly and start working. + +The complete process for crafting a "stone_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). +4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. +5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). +6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks). +7. Use the wooden pickaxe to mine "stone", collecting at least 3 pieces. Before mining stone, make sure to type !inventory to check if you have a "wooden_pickaxe". If you don��t, use !craftable to check if you can craft a "wooden_pickaxe". +8. Use !craftRecipe("stone_pickaxe", 1) to craft a "stone_pickaxe" (requires "crafting_table", 3 stones and 2 sticks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" diff --git a/examples/experimental/minecraft_agents/group_discussion_agents_wooden_pickaxe_no_division.toml b/examples/experimental/minecraft_agents/group_discussion_agents_wooden_pickaxe_no_division.toml index 164e3f249..132c92138 100644 --- a/examples/experimental/minecraft_agents/group_discussion_agents_wooden_pickaxe_no_division.toml +++ b/examples/experimental/minecraft_agents/group_discussion_agents_wooden_pickaxe_no_division.toml @@ -1,84 +1,81 @@ -redis_url = "redis://localhost:6379/0" -extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] - -[[nodes]] -node_name = "Jack" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 15 -output_channel = "Jack" -input_text_channels = ["Jane", "John"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft a "wooden_pickaxe". Please discuss the task division quickly and start working. - -The complete process for crafting a "wooden_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). -4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. -5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). -6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks).""" -model_name = "gpt-4o-2024-11-20" -agent_name = "Jack" - -[[nodes]] -node_name = "Jane" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 19 -output_channel = "Jane" -input_text_channels = ["Jack", "John"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft a "wooden_pickaxe". Please discuss the task division quickly and start working. - -The complete process for crafting a "wooden_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). -4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. -5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). -6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks).""" -model_name = "gpt-4o-2024-11-20" -agent_name = "Jane" - -[[nodes]] -node_name = "John" -node_class = "llm_agent" - -[nodes.node_args] -query_interval = 23 -output_channel = "John" -input_text_channels = ["Jack", "Jane"] -input_tick_channel = "tick/secs/1" -goal = """ -You and your friends need to craft a "wooden_pickaxe". Please discuss the task division quickly and start working. - -The complete process for crafting a "wooden_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): -1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. -2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. -3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). -4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. -5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). -6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks).""" -model_name = "gpt-4o-2024-11-20" -agent_name = "John" - -[[nodes]] -node_name = "record" -node_class = "record" - -[nodes.node_args] -jsonl_file_path = "log.jsonl" - -[nodes.node_args.record_channel_types] -"Jack" = "agent_action" -"Jane" = "agent_action" -"John" = "agent_action" - -[[nodes]] -node_name = "tick" -node_class = "tick" +redis_url = "redis://localhost:6379/0" +extra_modules = ["examples.experimental.group_discussion_agents.group_discussion_agents"] + +[[nodes]] +node_name = "Jack" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 15 +output_channel = "Jack" +input_text_channels = ["Jane", "John"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft a "wooden_pickaxe". Please discuss the task division quickly and start working. + +The complete process for crafting a "wooden_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). +4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. +5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). +6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jack" + +[[nodes]] +node_name = "Jane" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 19 +output_channel = "Jane" +input_text_channels = ["Jack", "John"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft a "wooden_pickaxe". Please discuss the task division quickly and start working. + +The complete process for crafting a "wooden_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). +4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. +5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). +6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "Jane" + +[[nodes]] +node_name = "John" +node_class = "llm_agent" + +[nodes.node_args] +query_interval = 23 +output_channel = "John" +input_text_channels = ["Jack", "Jane"] +input_tick_channel = "tick/secs/1" +goal = """You and your friends need to craft a "wooden_pickaxe". Please discuss the task division quickly and start working. + +The complete process for crafting a "wooden_pickaxe" in Minecraft is as follows (Please craft or obtain the items strictly in the following order): +1. Collect logs, such as "oak_log", "spruce_log" or "birch_log" with at least 3 pieces. +2. Convert logs into planks ("birch_planks", "spruce_planks" or "oak_planks"). Each log can produce 4 planks. +3. Use !craftRecipe("crafting_table", 1) to craft a "crafting_table" (requires 4 planks). After crafting a "crafting_table" (Ensure the inventory shows crafting_table: 1, not just having previously outputted !craftRecipe("crafting_table", 1)), use !placeHere("crafting_table"). +4. You can also use !goToBlock("crafting_table", 20, 50) to locate a "crafting_table" if someone else has already crafted and placed one. +5. Use !craftRecipe("stick", 4) to craft 4 "stick" (requires 2 planks). +6. Use !craftRecipe("wooden_pickaxe", 1) to craft a "wooden_pickaxe" (requires 3 planks and 2 sticks).""" +model_name = "gpt-4o-2024-11-20" +agent_name = "John" + +[[nodes]] +node_name = "record" +node_class = "record" + +[nodes.node_args] +jsonl_file_path = "log.jsonl" + +[nodes.node_args.record_channel_types] +"Jack" = "agent_action" +"Jane" = "agent_action" +"John" = "agent_action" + +[[nodes]] +node_name = "tick" +node_class = "tick" From 3b6a01a9f4c1335dec7877c6d84f3ede0f873be8 Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Tue, 13 May 2025 22:08:04 +0800 Subject: [PATCH 24/29] Update readme.md --- examples/experimental/minecraft_agents/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/experimental/minecraft_agents/readme.md b/examples/experimental/minecraft_agents/readme.md index ac5fe2b61..77d376493 100644 --- a/examples/experimental/minecraft_agents/readme.md +++ b/examples/experimental/minecraft_agents/readme.md @@ -14,7 +14,7 @@ export OPENAI_API_KEY=sk- // Enter your OpenAI API key here uv run aact run-dataflow group_discussion_agents.toml ``` -Download [XianzheFan/mindcraft-sotopia-multiagent](https://github.com/XianzheFan/mindcraft-sotopia-multiagent), then go to the main folder. +Download https://anonymous.4open.science/r/SoMi-ToM-1-580, then go to the main folder. ``` node src/agent/index.js From cc0c337cb377e032b2a3d4cdaf976c0f8f8dd94e Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Tue, 13 May 2025 22:08:17 +0800 Subject: [PATCH 25/29] Update readme.md --- examples/experimental/minecraft_agents/readme.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/experimental/minecraft_agents/readme.md b/examples/experimental/minecraft_agents/readme.md index 77d376493..e06f06ea6 100644 --- a/examples/experimental/minecraft_agents/readme.md +++ b/examples/experimental/minecraft_agents/readme.md @@ -1,4 +1,4 @@ -# Sotopia-Minecraft User Guide +# User Guide ``` cd examples/experimental/group_discussion_agents From 4ec83d08760e341debfc770d6054a208ce43d5ce Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Tue, 13 May 2025 22:13:26 +0800 Subject: [PATCH 26/29] Update README.md --- README.md | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) diff --git a/README.md b/README.md index 15a290c22..bbd4cc60e 100644 --- a/README.md +++ b/README.md @@ -1,50 +1,3 @@ -
- sotopia -
- -

Sotopia: an Open-ended Social Learning Environment

- -
- -[![pypi](https://img.shields.io/pypi/v/sotopia.svg)](https://pypi.python.org/pypi/sotopia) -[![versions](https://img.shields.io/pypi/pyversions/sotopia.svg)](https://github.com/sotopia/sotopia) -[![CI](https://img.shields.io/github/actions/workflow/status/sotopia-lab/sotopia/tests.yml?branch=main&logo=github&label=CI)](https://github.com/sotopia-lab/sotopia/actions?query=branch%3Amain) -[![codecov](https://codecov.io/github/sotopia-lab/sotopia/graph/badge.svg?token=00LRQFX0QR)](https://codecov.io/github/sotopia-lab/sotopia) -[![Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/drive/14hJOfzpA37PRUzdlFgiqVzUGIhhngqnz?usp=sharing) - -[![Project Page](https://img.shields.io/badge/Project-Page-green.svg)](https://www.sotopia.world/projects/sotopia) -[![Paper PDF](https://img.shields.io/badge/Paper-PDF-red.svg)](https://arxiv.org/abs/2310.11667) -[![Dataset](https://img.shields.io/badge/%F0%9F%A4%97-Sotopia%20Dataset-yellow)](https://huggingface.co/datasets/cmu-lti/sotopia) -[![Demo](https://img.shields.io/badge/%F0%9F%A4%97-Sotopia%20Demo-orange)](https://huggingface.co/spaces/cmu-lti/sotopia-space/) - - - -
- -## News - -* [05/2024] Sotopia was presented at ICLR 2024 as a spotlight ⭐! - - -## Introduction - -Sotopia is an open-ended social learning environment that allows agents to interact with each other and the environment. The environment is designed to be a platform for evaluating and faciliating social intelligence in language agents. The environment is designed to be open-ended, meaning that the environment can be easily extended to include new environments and new agents. The environment is also designed to be scalable, meaning that the environment can be easily scaled to include a large number of agents and environments. - - - -```bibtex -@inproceedings{zhou2024sotopia, - title = {SOTOPIA: Interactive Evaluation for Social Intelligence in Language Agents}, - author = {Zhou*, Xuhui and Zhu*, Hao and Mathur, Leena and Zhang, Ruohong and Qi, Zhengyang and Yu, Haofei and Morency, Louis-Philippe and Bisk, Yonatan and Fried, Daniel and Neubig, Graham and Sap, Maarten}, - journal = {ICLR}, - year = {2024}, - url = {https://openreview.net/forum?id=mM7VurbA4r}, -} -``` - -## Help -See [documentation](https://docs.sotopia.world) for more details. - ## Get started ### Install locally From 0192111730d9af6ee5bf27c3acc6233185ac5af3 Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Tue, 13 May 2025 22:16:24 +0800 Subject: [PATCH 27/29] Update readme.md --- examples/experimental/minecraft_agents/readme.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/experimental/minecraft_agents/readme.md b/examples/experimental/minecraft_agents/readme.md index e06f06ea6..54a93a64f 100644 --- a/examples/experimental/minecraft_agents/readme.md +++ b/examples/experimental/minecraft_agents/readme.md @@ -1,7 +1,7 @@ # User Guide ``` -cd examples/experimental/group_discussion_agents +cd examples/experimental/minecraft_agents uvicorn group_discussion_agents:app --reload --port 8080 ``` @@ -9,7 +9,7 @@ Enter `Minecraft Java Edition`, select `Singleplayer`, `1.20.1 version`, and `Su ``` // Open a new terminal -cd examples/experimental/group_discussion_agents +cd examples/experimental/minecraft_agents export OPENAI_API_KEY=sk- // Enter your OpenAI API key here uv run aact run-dataflow group_discussion_agents.toml ``` From 4f21bfe8c0827c5596001a07ddc73512ed08db5c Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Tue, 13 May 2025 22:17:05 +0800 Subject: [PATCH 28/29] Update README.md --- README.md | 45 +++++++++++++-------------------------------- 1 file changed, 13 insertions(+), 32 deletions(-) diff --git a/README.md b/README.md index bbd4cc60e..54a93a64f 100644 --- a/README.md +++ b/README.md @@ -1,40 +1,21 @@ -## Get started +# User Guide -### Install locally -We recommend using a virtual environment, e.g. with anaconda3: `conda create -n sotopia python=3.11; conda activate sotopia;`. - -Then: -`python -m pip install sotopia; sotopia install` - -This will setup the necessary environment variables and download the necessary data. +``` +cd examples/experimental/minecraft_agents +uvicorn group_discussion_agents:app --reload --port 8080 +``` -> [!TIP] -> Having trouble installing? Or don't want to install redis for now? We are working on a public redis server for you to use. Stay tuned! +Enter `Minecraft Java Edition`, select `Singleplayer`, `1.20.1 version`, and `Survival Mode`, then click `Open to LAN 55916`. -OpenAI key is required to run the code. Please set the environment variable `OPENAI_API_KEY` to your key. The recommend way is to add the key to the conda environment: -```bash -conda env config vars set OPENAI_API_KEY=your_key +``` +// Open a new terminal +cd examples/experimental/minecraft_agents +export OPENAI_API_KEY=sk- // Enter your OpenAI API key here +uv run aact run-dataflow group_discussion_agents.toml ``` -## Easy Sample Server -You can view an episode demo with default parameters with the following: -```python -import asyncio -from sotopia.samplers import UniformSampler -from sotopia.server import run_async_server +Download https://anonymous.4open.science/r/SoMi-ToM-1-580, then go to the main folder. -asyncio.run( - run_async_server( - model_dict={ - "env": "gpt-4", - "agent1": "gpt-4o-mini", - "agent2": "gpt-4o-mini", - }, - sampler=UniformSampler(), - ) -) ``` -or run -```bash -python examples/minimalist_demo.py +node src/agent/index.js ``` From b89669240085e55ca6de3d0c771806f55b27b608 Mon Sep 17 00:00:00 2001 From: Xianzhe Fan <101501006+XianzheFan@users.noreply.github.com> Date: Wed, 14 May 2025 00:10:16 +0800 Subject: [PATCH 29/29] Delete pyproject.toml --- pyproject.toml | 77 -------------------------------------------------- 1 file changed, 77 deletions(-) delete mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 57af6cc3a..000000000 --- a/pyproject.toml +++ /dev/null @@ -1,77 +0,0 @@ -[project] -name = "sotopia" -version = "0.1.2" -description = "A platform for simulating and evaluating social interaction." -authors = [ - { name = "Hao Zhu", email = "prokilchu@gmail.com" }, - { name = "Xuhui Zhou", email = "xuhuiz@cs.cmu.edu" } -] -requires-python = ">=3.10, <3.13" -license = { text = "MIT License" } -readme = "README.md" - -dependencies = [ - "lxml>=4.9.3,<6.0.0", - "openai>=1.11.0,<2.0.0", - "langchain>=0.2.5,<0.4.0", - "rich>=13.6.0,<14.0.0", - "PettingZoo==1.24.3", - "redis-om>=0.3.0,<0.4.0", - "gin-config>=0.5.0,<0.6.0", - "absl-py>=2.0.0,<3.0.0", - "together>=0.2.4,<1.4.0", - "pydantic>=2.5.0,<3.0.0", - "beartype>=0.14.0,<0.20.0", - "langchain-openai>=0.1.8,<0.2", - "hiredis>=3.0.0", - "aact" -] - -[build-system] -requires = ["hatchling"] -build-backend = "hatchling.build" - -[project.optional-dependencies] -anthropic = ["anthropic"] -groq = ["groq"] -cohere = ["cohere"] -google-generativeai = ["google-generativeai"] -examples = ["transformers", "datasets", "scipy", "torch", "pandas"] -api = [ - "fastapi[standard]", - "uvicorn", -] -test = ["pytest", "pytest-cov", "pytest-asyncio"] - -[tool.uv] -dev-dependencies = [ - "pre-commit", - "nbmake", - "types-setuptools", - "types-requests", - "types-tqdm", - "types-protobuf==4.24.0.4", - "lxml-stubs", - "pandas-stubs", - "ruff", - "mypy" -] - -[tool.mypy] -mypy_path = "stubs" -strict = true -plugins = [ - "pydantic.mypy", - "pydantic.v1.mypy" -] - -[[tool.mypy.overrides]] -module = "transformers.*" -ignore_missing_imports = true - -[tool.pytest.ini_options] -testpaths = ["tests"] -python_files = "test_*.py" - -[project.scripts] -sotopia = "sotopia.cli:app"