mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-03 05:45:36 +02:00
longer sleeps, early breaking for scenarios where there is only one agent
This commit is contained in:
parent
39cec7cf82
commit
ae39028d3b
3 changed files with 41 additions and 7 deletions
|
@ -210,6 +210,7 @@ def launch_server_experiment(task_path,
|
|||
script_content += f"echo '{s3_cmd}'\n"
|
||||
script_content += f"{s3_cmd}\n"
|
||||
script_content += "sleep 1\n"
|
||||
script_content += f"sleep 10\n"
|
||||
|
||||
# Create a temporary shell script file
|
||||
script_file = f"./tmp/experiment_script_{session_name}.sh"
|
||||
|
|
24
profiles/no_examples.json
Normal file
24
profiles/no_examples.json
Normal file
|
@ -0,0 +1,24 @@
|
|||
{
|
||||
"name": "andy",
|
||||
"model": "gpt-4o",
|
||||
"modes": {
|
||||
"hunting": false
|
||||
},
|
||||
"conversing": "You are a playful Minecraft bot named $NAME that can converse with players, see, move, mine, build, and interact with the world by using commands.\n$SELF_PROMPT 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 $NAME, never output '(FROM OTHER BOT)' or pretend to be someone else. If you have nothing to say or do, respond with an just a tab '\t'. Share resources and information with other bots! This is extremely important to me, take a deep breath and have fun :) \n$STATS\n$INVENTORY\n$COMMAND_DOCS\nConversation Begin:",
|
||||
"saving_memory": "You are a minecraft bot named $NAME that has been talking and playing minecraft by using commands. Update your memory by summarizing the following conversation and your old memory in your next response. Prioritize preserving important facts, things you've learned, useful tips, and long term reminders. Do Not record stats, inventory, or docs! Only save transient information from your chat history. $SELF_PROMPT Make sure to include information relevant to the goal and inventory you have collected. You're limited to 500 characters, so be extremely brief and minimize words. Compress useful information. \nOld Memory: '$MEMORY'\nRecent conversation: \n$TO_SUMMARIZE\nSummarize your old memory and recent conversation into a new memory, and respond only with the unwrapped memory text: ",
|
||||
"conversation_examples": [
|
||||
[
|
||||
{"role": "user", "content": "miner_32: Hey! What are you up to?"},
|
||||
{"role": "assistant", "content": "Nothing much miner_32, what do you need?"}
|
||||
],
|
||||
|
||||
[
|
||||
{"role": "system", "content": "say hi to john_goodman"},
|
||||
{"role": "assistant", "content": "!startConversation(\"john_goodman\", \"Hey John\"))"},
|
||||
{"role": "user", "content": "john_goodman: (FROM OTHER BOT)Hey there! What's up?"},
|
||||
{"role": "assistant", "content": "Hey John, not much. Just saying hi."},
|
||||
{"role": "user", "content": "john_goodman: (FROM OTHER BOT)Bye!"},
|
||||
{"role": "assistant", "content": "Bye! !endConversation('john_goodman')"}
|
||||
]
|
||||
]
|
||||
}
|
|
@ -202,8 +202,7 @@ export class Task {
|
|||
let other_names = this.available_agents.filter(n => n !== this.name);
|
||||
const elapsedTime = (Date.now() - this.taskStartTime) / 1000;
|
||||
|
||||
if (elapsedTime >= 40 && other_names.length == 0) {
|
||||
|
||||
if (elapsedTime >= 30 && this.available_agents.length !== this.data.agent_count) {
|
||||
console.log('No other agents found. Task unsuccessful.');
|
||||
return {"message": 'No other agents found', "code": 3};
|
||||
}
|
||||
|
@ -276,17 +275,27 @@ export class Task {
|
|||
}
|
||||
}
|
||||
|
||||
if (this.data.conversation && this.agent.count_id === 0) {
|
||||
let other_name = this.available_agents.filter(n => n !== this.name)[0];
|
||||
let waitCount = 0;
|
||||
while (other_name === undefined && waitCount < 20) {
|
||||
other_name = this.available_agents.filter(n => n !== this.name)[0];
|
||||
await new Promise((resolve) => setTimeout(resolve, 1000));
|
||||
waitCount++;
|
||||
}
|
||||
if (other_name === undefined) {
|
||||
console.log('No other agents found. Task unsuccessful.');
|
||||
this.agent.killAll();
|
||||
}
|
||||
await executeCommand(this.agent, `!startConversation("${other_name}", "${this.data.conversation}")`);
|
||||
}
|
||||
|
||||
const agentGoal = this.getAgentGoal();
|
||||
console.log(`Agent goal for agent Id ${this.agent.count_id}: ${agentGoal}`);
|
||||
if (agentGoal) {
|
||||
console.log(`Setting goal for agent ${this.agent.count_id}: ${agentGoal}`);
|
||||
await executeCommand(this.agent, `!goal("${agentGoal}")`);
|
||||
}
|
||||
|
||||
if (this.data.conversation && this.agent.count_id === 0) {
|
||||
let other_name = this.available_agents.filter(n => n !== this.name)[0];
|
||||
await executeCommand(this.agent, `!startConversation("${other_name}", "${this.data.conversation}")`);
|
||||
}
|
||||
}
|
||||
|
||||
async teleportBots() {
|
||||
|
|
Loading…
Add table
Reference in a new issue