human ai cooking and crafting tasks

This commit is contained in:
Isadora White 2025-04-25 19:16:00 -07:00
parent 181d628033
commit aac00bc893
7 changed files with 1722 additions and 11 deletions

View file

@ -194,6 +194,7 @@ export class Agent {
if (!this.task || !this.task.agent_names) {
return;
}
console.log(this.task.agent_names)
const missingPlayers = this.task.agent_names.filter(name => !this.bot.players[name]);
if (missingPlayers.length > 0) {

View file

@ -430,12 +430,43 @@ export class Task {
let initialInventory = {};
// Handle multi-agent inventory assignment
if (this.data.agent_count > 1) {
initialInventory = this.data.initial_inventory[this.agent.count_id.toString()] || {};
console.log("Initial inventory for agent", this.agent.count_id, ":", initialInventory);
} else {
initialInventory = this.data.initial_inventory;
console.log("Initial inventory:", initialInventory);
// function hasSubDictionary(obj) {
// for (let key in obj) {
// if (typeof obj[key] === 'object' && obj[key] !== null) {
// return true;
// }
// }
// return false;
// }
// const hasSubDictionaryResult = hasSubDictionary(this.data.initial_inventory);
// const firstKey = Object.keys(initialInventory)[0];
// console.log(firstKey);
// console.log(hasSubDictionaryResult);
// if (typeof this.data.initial_inventory[firstKey] === 'object') {
initialInventory = this.data.initial_inventory[this.agent.count_id.toString()] || {};
console.log("Initial inventory for agent", this.agent.count_id, ":", initialInventory);
if (this.data.human_count > 0 && this.agent.count_id === 0) {
// this.num_humans = num_keys - this.data.num_agents;
if (this.data.human_count !== this.data.usernames.length) {
console.log(`Number of human players ${this.human_count} does not match the number of usernames provided. ${this.data.usernames.length}`);
throw new Error(`Number of human players ${this.human_count} does not match the number of usernames provided. ${this.data.usernames.length}`);
return;
}
const starting_idx = this.data.agent_count;
for (let i = 0; i < this.data.human_count; i++) {
const username = this.data.usernames[i];
console.log(`Giving ${username} ${this.data.initial_inventory[starting_idx + i]}`);
const inventory = this.data.initial_inventory[starting_idx + i];
console.log(Object.keys(inventory));
for (let key of Object.keys(inventory)) {
const itemName = key.toLowerCase();
const quantity = inventory[key];
console.log(`Give ${username} ${quantity} ${itemName}`);
await this.agent.bot.chat(`/give ${username} ${itemName} ${quantity}`);
}
}
}
console.log(this.data.initial_inventory);
@ -474,7 +505,7 @@ export class Task {
await new Promise((resolve) => setTimeout(resolve, 1000));
waitCount++;
}
if (other_name === undefined) {
if (other_name === undefined && this.agent_count > 1) {
console.log('No other agents found. Task unsuccessful.');
this.agent.killAll();
}

View file

@ -0,0 +1,803 @@
{
"multiagent_crafting_pink_wool_full_plan__depth_0": {
"goal": "Collaborate with other agents to craft an pink_wool",
"conversation": "Let's work together to craft an pink_wool.",
"initial_inventory": {
"0": {
"pink_dye": 1
},
"1": {
"black_wool": 1
}
},
"agent_count": 1,
"target": "pink_wool",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 0,
"timeout": 300,
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"human_count": 1,
"usernames":[
"izzycw"
],
"requires_ctable": false
},
"multiagent_crafting_lime_wool_partial_plan__depth_0": {
"goal": "Collaborate with other agents to craft an lime_wool",
"conversation": "Let's work together to craft an lime_wool.",
"initial_inventory": {
"0": {
"lime_dye": 1
},
"1": {
"black_wool": 1
}
},
"agent_count": 1,
"target": "lime_wool",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 0,
"timeout": 300,
"blocked_actions": {
"0": [
],
"1": ["!getCraftingPlan"]
},
"human_count": 1,
"usernames":[
"izzycw"
],
"missing_items": [
],
"requires_ctable": false
},
"multiagent_crafting_purple_banner_full_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft an purple_banner",
"conversation": "Let's work together to craft an purple_banner.",
"initial_inventory": {
"0": {
"purple_wool": 4,
"stick": 1
},
"1": {
"purple_wool": 3,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "purple_banner",
"number_of_target": 1,
"type": "techtree",
"max_depth": 3,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_soul_campfire_partial_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft an soul_campfire",
"conversation": "Let's work together to craft an soul_campfire.",
"initial_inventory": {
"0": {
"oak_planks": 2,
"soul_sand": 1,
"dark_oak_log": 2
},
"1": {
"oak_planks": 1,
"dark_oak_log": 1,
"crafting_table": 1
}
},
"agent_count": 2,
"target": "soul_campfire",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_bookshelf_full_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a bookshelf",
"conversation": "Let's work together to craft a bookshelf.",
"initial_inventory": {
"0": {
"oak_planks": 4,
"book": 2
},
"1": {
"oak_planks": 2,
"book": 1,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "bookshelf",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_compass_partial_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a compass",
"conversation": "Let's work together to craft a compass.",
"initial_inventory": {
"0": {
"iron_ingot": 2
},
"1": {
"iron_ingot": 2,
"redstone": 1,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "compass",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_fishing_rod_full_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a fishing_rod",
"conversation": "Let's work together to craft a fishing_rod.",
"initial_inventory": {
"0": {
"string": 1,
"oak_planks": 2
},
"1": {
"string": 1,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "fishing_rod",
"number_of_target": 1,
"type": "techtree",
"max_depth": 3,
"depth": 1,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [
],
"requires_ctable": true
},
"multiagent_crafting_cake_partial_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a cake",
"conversation": "Let's work together to craft a cake.",
"initial_inventory": {
"0": {
"wheat": 2,
"sugar": 1,
"egg": 1
},
"1": {
"wheat": 1,
"milk_bucket": 2,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "cake",
"number_of_target": 1,
"type": "techtree",
"max_depth": 3,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_golden_carrot_full_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a golden_carrot",
"conversation": "Let's work together to craft a golden_carrot.",
"initial_inventory": {
"0": {
"gold_nugget": 5,
"carrot": 1
},
"1": {
"gold_nugget": 3,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "golden_carrot",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_map_partial_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a map",
"conversation": "Let's work together to craft a map.",
"initial_inventory": {
"0": {
"paper": 5
},
"1": {
"paper": 3,
"compass": 1,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "map",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_blue_wool_full_plan__depth_0": {
"goal": "Collaborate with other agents to craft blue_wool",
"conversation": "Let's work together to craft blue_wool.",
"initial_inventory": {
"0": {
"blue_dye": 1
},
"1": {
"white_wool": 1
}
},
"agent_count": 2,
"target": "blue_wool",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": false
},
"multiagent_crafting_lime_wool_partial_plan__depth_2": {
"goal": "Collaborate with other agents to craft lime_wool",
"conversation": "Let's work together to craft lime_wool.",
"initial_inventory": {
"0": {
"green_dye": 1
},
"1": {
"white_wool": 1,
"bone_meal": 1
}
},
"agent_count": 2,
"target": "lime_wool",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 1,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [
],
"requires_ctable": false
},
"multiagent_crafting_magenta_wool_full_plan__depth_2": {
"goal": "Collaborate with other agents to craft magenta_wool",
"conversation": "Let's work together to craft magenta_wool.",
"initial_inventory": {
"0": {
"rose_red": 1,
"lapis_lazuli": 1
},
"1": {
"white_wool": 1,
"bone_meal": 1
}
},
"agent_count": 1,
"target": "magenta_wool",
"number_of_target": 1,
"type": "techtree",
"max_depth": 3,
"depth": 2,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [
],
"requires_ctable": false
},
"multiagent_crafting_chest_full_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a chest",
"conversation": "Let's work together to craft a chest.",
"initial_inventory": {
"0": {
"oak_log": 1
},
"1": {
"oak_planks": 4,
"crafting_table": 1
}
},
"agent_count": 2,
"target": "chest",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 1,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_barrel_partial_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a barrel",
"conversation": "Let's work together to craft a barrel.",
"initial_inventory": {
"0": {
"spruce_planks": 3,
"crafting_table": 1
},
"1": {
"spruce_planks": 3,
"wooden_slab": 1
}
},
"agent_count": 2,
"target": "barrel",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 1,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [
],
"requires_ctable": true
},
"multiagent_crafting_lectern_full_plan_requires_ctable__depth_2": {
"goal": "Collaborate with other agents to craft a lectern",
"conversation": "Let's work together to craft a lectern.",
"initial_inventory": {
"0": {
"birch_slab": 5,
"crafting_table": 1
},
"1": {
"birch_log": 2,
"book": 3
}
},
"agent_count": 1,
"target": "lectern",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 2,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [
],
"requires_ctable": true
},
"multiagent_crafting_clock_partial_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a clock",
"conversation": "Let's work together to craft a clock.",
"initial_inventory": {
"0": {
"gold_ingot": 2
},
"1": {
"gold_ingot": 2,
"redstone": 1,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "clock",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_firework_rocket_partial_plan__depth_0": {
"goal": "Collaborate with other agents to craft firework_rocket",
"conversation": "Let's work together to craft firework_rocket.",
"initial_inventory": {
"0": {
"paper": 1
},
"1": {
"gunpowder": 3
}
},
"agent_count": 2,
"target": "firework_rocket",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": false
},
"multiagent_crafting_enchanting_table_partial_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft an enchanting_table",
"conversation": "Let's work together to craft an enchanting_table.",
"initial_inventory": {
"0": {
"diamond": 2,
"obsidian": 2,
"crafting_table": 1
},
"1": {
"obsidian": 2,
"book": 1
}
},
"agent_count": 2,
"target": "enchanting_table",
"number_of_target": 1,
"type": "techtree",
"max_depth": 0,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_jukebox_full_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a jukebox",
"conversation": "Let's work together to craft a jukebox.",
"initial_inventory": {
"0": {
"diamond": 1
},
"1": {
"oak_log": 2,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "jukebox",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 1,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_light_gray_wool_full_plan__depth_1": {
"goal": "Collaborate with other agents to craft light_gray_wool",
"conversation": "Let's work together to craft light_gray_wool.",
"initial_inventory": {
"0": {
"black_dye": 1
},
"1": {
"white_wool": 1,
"white_dye": 2
}
},
"agent_count": 1,
"target": "light_gray_wool",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 1,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [
],
"requires_ctable": false
},
"multiagent_crafting_blast_furnace_full_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a blast_furnace",
"conversation": "Let's work together to craft a blast_furnace.",
"initial_inventory": {
"0": {
"iron_ingot": 5,
"smooth_stone": 3
},
"1": {
"cobblestone": 8,
"crafting_table": 1
}
},
"agent_count": 2,
"target": "blast_furnace",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 1,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [
],
"requires_ctable": true
},
"multiagent_crafting_activator_rail_full_plan_requires_ctable__depth_2": {
"goal": "Collaborate with other agents to craft activator_rail",
"conversation": "Let's work together to craft activator_rail.",
"initial_inventory": {
"0": {
"iron_ingot": 3,
"oak_planks": 6
},
"1": {
"redstone": 1,
"iron_ingot": 3,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "activator_rail",
"number_of_target": 1,
"type": "techtree",
"max_depth": 3,
"depth": 2,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [
],
"requires_ctable": true
},
"multiagent_crafting_campfire_partial_plan_requires_ctable__depth_2": {
"goal": "Collaborate with other agents to craft campfire",
"conversation": "Let's work together to craft campfire.",
"initial_inventory": {
"0": {
"oak_log": 8
},
"1": {
"coal": 1,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "campfire",
"number_of_target": 1,
"type": "techtree",
"max_depth": 3,
"depth": 2,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [
],
"requires_ctable": true
},
"multiagent_crafting_crossbow_full_plan_requires_ctable__depth_2": {
"goal": "Collaborate with other agents to craft a crossbow",
"conversation": "Let's work together to craft a crossbow.",
"initial_inventory": {
"0": {
"oak_planks": 8,
"iron_ingot": 2
},
"1": {
"string": 2,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "crossbow",
"number_of_target": 1,
"type": "techtree",
"max_depth": 3,
"depth": 2,
"timeout": 300,
"human_count": 1,
"usernames":[
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [
],
"requires_ctable": true
}
}

View file

@ -0,0 +1,793 @@
{
"multiagent_crafting_pink_wool_full_plan__depth_0": {
"goal": "Collaborate with other agents to craft an pink_wool",
"conversation": "Let's work together to craft an pink_wool.",
"initial_inventory": {
"0": {
"pink_dye": 1
},
"1": {
"black_wool": 1
}
},
"agent_count": 1,
"target": "pink_wool",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 0,
"timeout": 300,
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"human_count": 1,
"usernames": [
"izzycw"
],
"requires_ctable": false
},
"multiagent_crafting_lime_wool_partial_plan__depth_0": {
"goal": "Collaborate with other agents to craft an lime_wool",
"conversation": "Let's work together to craft an lime_wool.",
"initial_inventory": {
"0": {
"lime_dye": 1
},
"1": {
"black_wool": 1
}
},
"agent_count": 1,
"target": "lime_wool",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 0,
"timeout": 300,
"blocked_actions": {
"0": [],
"1": [
"!getCraftingPlan"
]
},
"human_count": 1,
"usernames": [
"izzycw"
],
"missing_items": [],
"requires_ctable": false
},
"multiagent_crafting_purple_banner_full_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft an purple_banner",
"conversation": "Let's work together to craft an purple_banner.",
"initial_inventory": {
"0": {
"purple_wool": 4,
"stick": 1
},
"1": {
"purple_wool": 3,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "purple_banner",
"number_of_target": 1,
"type": "techtree",
"max_depth": 3,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_soul_campfire_partial_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft an soul_campfire",
"conversation": "Let's work together to craft an soul_campfire.",
"initial_inventory": {
"0": {
"oak_planks": 2,
"soul_sand": 1,
"dark_oak_log": 2
},
"1": {
"oak_planks": 1,
"dark_oak_log": 1,
"crafting_table": 1
}
},
"agent_count": 2,
"target": "soul_campfire",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_bookshelf_full_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a bookshelf",
"conversation": "Let's work together to craft a bookshelf.",
"initial_inventory": {
"0": {
"oak_planks": 4,
"book": 2
},
"1": {
"oak_planks": 2,
"book": 1,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "bookshelf",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_compass_partial_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a compass",
"conversation": "Let's work together to craft a compass.",
"initial_inventory": {
"0": {
"iron_ingot": 2
},
"1": {
"iron_ingot": 2,
"redstone": 1,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "compass",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_fishing_rod_full_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a fishing_rod",
"conversation": "Let's work together to craft a fishing_rod.",
"initial_inventory": {
"0": {
"string": 1,
"oak_planks": 2
},
"1": {
"string": 1,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "fishing_rod",
"number_of_target": 1,
"type": "techtree",
"max_depth": 3,
"depth": 1,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_cake_partial_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a cake",
"conversation": "Let's work together to craft a cake.",
"initial_inventory": {
"0": {
"wheat": 2,
"sugar": 1,
"egg": 1
},
"1": {
"wheat": 1,
"milk_bucket": 2,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "cake",
"number_of_target": 1,
"type": "techtree",
"max_depth": 3,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_golden_carrot_full_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a golden_carrot",
"conversation": "Let's work together to craft a golden_carrot.",
"initial_inventory": {
"0": {
"gold_nugget": 5,
"carrot": 1
},
"1": {
"gold_nugget": 3,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "golden_carrot",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_map_partial_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a map",
"conversation": "Let's work together to craft a map.",
"initial_inventory": {
"0": {
"paper": 5
},
"1": {
"paper": 3,
"compass": 1,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "map",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_blue_wool_full_plan__depth_0": {
"goal": "Collaborate with other agents to craft blue_wool",
"conversation": "Let's work together to craft blue_wool.",
"initial_inventory": {
"0": {
"blue_dye": 1
},
"1": {
"white_wool": 1
}
},
"agent_count": 2,
"target": "blue_wool",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": false
},
"multiagent_crafting_lime_wool_partial_plan__depth_2": {
"goal": "Collaborate with other agents to craft lime_wool",
"conversation": "Let's work together to craft lime_wool.",
"initial_inventory": {
"0": {
"green_dye": 1
},
"1": {
"white_wool": 1,
"bone_meal": 1
}
},
"agent_count": 2,
"target": "lime_wool",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 1,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": false
},
"multiagent_crafting_magenta_wool_full_plan__depth_2": {
"goal": "Collaborate with other agents to craft magenta_wool",
"conversation": "Let's work together to craft magenta_wool.",
"initial_inventory": {
"0": {
"rose_red": 1,
"lapis_lazuli": 1
},
"1": {
"white_wool": 1,
"bone_meal": 1
}
},
"agent_count": 1,
"target": "magenta_wool",
"number_of_target": 1,
"type": "techtree",
"max_depth": 3,
"depth": 2,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": false
},
"multiagent_crafting_chest_full_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a chest",
"conversation": "Let's work together to craft a chest.",
"initial_inventory": {
"0": {
"oak_log": 1
},
"1": {
"oak_planks": 4,
"crafting_table": 1
}
},
"agent_count": 2,
"target": "chest",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 1,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_barrel_partial_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a barrel",
"conversation": "Let's work together to craft a barrel.",
"initial_inventory": {
"0": {
"spruce_planks": 3,
"crafting_table": 1
},
"1": {
"spruce_planks": 3,
"wooden_slab": 1
}
},
"agent_count": 2,
"target": "barrel",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 1,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_lectern_full_plan_requires_ctable__depth_2": {
"goal": "Collaborate with other agents to craft a lectern",
"conversation": "Let's work together to craft a lectern.",
"initial_inventory": {
"0": {
"birch_slab": 5,
"crafting_table": 1
},
"1": {
"birch_log": 2,
"book": 3
}
},
"agent_count": 1,
"target": "lectern",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 2,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_clock_partial_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft a clock",
"conversation": "Let's work together to craft a clock.",
"initial_inventory": {
"0": {
"gold_ingot": 2
},
"1": {
"gold_ingot": 2,
"redstone": 1,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "clock",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_firework_rocket_partial_plan__depth_0": {
"goal": "Collaborate with other agents to craft firework_rocket",
"conversation": "Let's work together to craft firework_rocket.",
"initial_inventory": {
"0": {
"paper": 1
},
"1": {
"gunpowder": 3
}
},
"agent_count": 2,
"target": "firework_rocket",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": false
},
"multiagent_crafting_enchanting_table_partial_plan_requires_ctable__depth_0": {
"goal": "Collaborate with other agents to craft an enchanting_table",
"conversation": "Let's work together to craft an enchanting_table.",
"initial_inventory": {
"0": {
"diamond": 2,
"obsidian": 2,
"crafting_table": 1
},
"1": {
"obsidian": 2,
"book": 1
}
},
"agent_count": 2,
"target": "enchanting_table",
"number_of_target": 1,
"type": "techtree",
"max_depth": 0,
"depth": 0,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_jukebox_full_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a jukebox",
"conversation": "Let's work together to craft a jukebox.",
"initial_inventory": {
"0": {
"diamond": 1
},
"1": {
"oak_log": 2,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "jukebox",
"number_of_target": 1,
"type": "techtree",
"max_depth": 1,
"depth": 1,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_light_gray_wool_full_plan__depth_1": {
"goal": "Collaborate with other agents to craft light_gray_wool",
"conversation": "Let's work together to craft light_gray_wool.",
"initial_inventory": {
"0": {
"black_dye": 1
},
"1": {
"white_wool": 1,
"white_dye": 2
}
},
"agent_count": 1,
"target": "light_gray_wool",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 1,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": false
},
"multiagent_crafting_blast_furnace_full_plan_requires_ctable__depth_1": {
"goal": "Collaborate with other agents to craft a blast_furnace",
"conversation": "Let's work together to craft a blast_furnace.",
"initial_inventory": {
"0": {
"iron_ingot": 5,
"smooth_stone": 3
},
"1": {
"cobblestone": 8,
"crafting_table": 1
}
},
"agent_count": 2,
"target": "blast_furnace",
"number_of_target": 1,
"type": "techtree",
"max_depth": 2,
"depth": 1,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_activator_rail_full_plan_requires_ctable__depth_2": {
"goal": "Collaborate with other agents to craft activator_rail",
"conversation": "Let's work together to craft activator_rail.",
"initial_inventory": {
"0": {
"iron_ingot": 3,
"oak_planks": 6
},
"1": {
"redstone": 1,
"iron_ingot": 3,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "activator_rail",
"number_of_target": 1,
"type": "techtree",
"max_depth": 3,
"depth": 2,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_campfire_partial_plan_requires_ctable__depth_2": {
"goal": "Collaborate with other agents to craft campfire",
"conversation": "Let's work together to craft campfire.",
"initial_inventory": {
"0": {
"oak_log": 8
},
"1": {
"coal": 1,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "campfire",
"number_of_target": 1,
"type": "techtree",
"max_depth": 3,
"depth": 2,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [
"!getCraftingPlan"
],
"1": []
},
"missing_items": [],
"requires_ctable": true
},
"multiagent_crafting_crossbow_full_plan_requires_ctable__depth_2": {
"goal": "Collaborate with other agents to craft a crossbow",
"conversation": "Let's work together to craft a crossbow.",
"initial_inventory": {
"0": {
"oak_planks": 8,
"iron_ingot": 2
},
"1": {
"string": 2,
"crafting_table": 1
}
},
"agent_count": 1,
"target": "crossbow",
"number_of_target": 1,
"type": "techtree",
"max_depth": 3,
"depth": 2,
"timeout": 300,
"human_count": 1,
"usernames": [
"izzycw"
],
"blocked_actions": {
"0": [],
"1": []
},
"missing_items": [],
"requires_ctable": true
}
}

View file

@ -743,6 +743,7 @@ def main():
parser.add_argument('--no-pruning', action='store_true', help='Disable pruning of the actions')
parser.add_argument('--block_conversation', action='store_true', help='Block conversation actions')
parser.add_argument('--check', metavar='FOLDER_PATH', help='Check and evaluate results in the specified folder without running experiments')
parser.add_argument('--usernames', default="", help='Comma-separated list of usernames for the agents')
args = parser.parse_args()
print(args)
@ -763,6 +764,22 @@ def main():
clean_up_server_files(args.num_parallel)
if args.add_keys:
update_keys_json()
# change task file to include usernames
with open(args.task_path, 'r') as f:
content = f.read()
task = json.loads(content)
# check if human count for first task is non zero
human_count = task[list(task.keys())[0]]["human_count"]
username_lst = args.usernames.replace(" ", "").split(",")
if len(username_lst) != human_count:
raise ValueError(f"Number of usernames provided ({len(username_lst)}) does not match human count ({human_count})")
if human_count > 0:
for task_id in task.keys():
task[task_id]["usernames"] = args.usernames.replace(" ", "").split(",")
# dump to task_path
with open(args.task_path, 'w') as f:
json.dump(task, f, indent=4)
launch_parallel_experiments(args.task_path,
num_exp=args.num_exp,

View file

@ -21,7 +21,9 @@
"goal": "Just stand at a place and don't do anything",
"agent_count": 1,
"initial_inventory": {
"iron_ingot": 1
"0" : {
"iron_ingot": 1
}
},
"type": "debug",
"timeout": 60
@ -111,7 +113,9 @@
"debug_inventory_restriction": {
"goal": "Place 1 oak plank, then place 1 stone brick",
"initial_inventory": {
"oak_planks": 20
"0" : {
"oak_planks": 20
}
},
"type": "debug",
"restrict_to_inventory": true
@ -120,13 +124,17 @@
"type": "construction",
"goal": "Build a house",
"initial_inventory": {
"oak_planks": 20
"0" : {
"oak_planks": 20
}
}
},
"techtree_1_shears_with_2_iron_ingot": {
"goal": "Build a shear.",
"initial_inventory": {
"iron_ingot": 2
"0": {
"iron_ingot": 2
}
},
"target": "shears",
"number_of_target": 1,

58
tasks/human_ai_tasks.py Normal file
View file

@ -0,0 +1,58 @@
# run all tasks in a given file
import os
import json
import argparse
import subprocess
import time
def run_task(task_path, task_id, profiles=None):
"""Run a single task using main.js"""
# Convert task_path to absolute path if it's relative
if not os.path.isabs(task_path):
task_path = os.path.abspath(task_path)
cmd = ["node", "main.js", "--task_path", task_path, "--task_id", task_id]
# Add profiles if provided
if profiles:
cmd.extend(["--profiles", *profiles])
print(f"Running task: {task_id}")
project_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
# Execute the command from the project root directory
process = subprocess.run(cmd, check=True, cwd=project_root)
return process.returncode == 0
def main():
parser = argparse.ArgumentParser(description='Run all tasks in a JSON file sequentially')
parser.add_argument('--task_path', required=True, help='Path to the task file')
parser.add_argument('--profiles', nargs='+', help='List of agent profile paths')
parser.add_argument('--delay', type=int, default=2, help='Delay in seconds between tasks')
args = parser.parse_args()
# Load the task file
with open(args.task_path, 'r') as f:
tasks = json.load(f)
print(f"Found {len(tasks)} tasks in {args.task_path}")
# Run each task sequentially
successful_tasks = 0
for task_id in tasks:
success = run_task(args.task_path, task_id, args.profiles)
if success:
successful_tasks += 1
# Wait between tasks
time.sleep(args.delay)
print(f"Completed {successful_tasks}/{len(tasks)} tasks successfully")
if __name__ == "__main__":
main()