mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-29 18:33:03 +02:00
fixed shouldInterrupt, added test task
This commit is contained in:
parent
b23f4776b1
commit
31bce024a2
2 changed files with 22 additions and 1 deletions
|
@ -72,5 +72,24 @@
|
|||
"number_of_target": 1,
|
||||
"type": "techtree",
|
||||
"timeout": 300
|
||||
},
|
||||
"multiagent_smelt_ingot": {
|
||||
"conversation": "Let's collaborate to smelt ingots",
|
||||
"goal": "Smelt 1 iron ingot and 1 copper ingot, use star emojis in every response",
|
||||
"agent_count": 2,
|
||||
"initial_inventory": {
|
||||
"0": {
|
||||
"furnace": 1,
|
||||
"coal": 2
|
||||
},
|
||||
"1": {
|
||||
"raw_iron": 1,
|
||||
"raw_copper": 1
|
||||
}
|
||||
},
|
||||
"target": "copper_ingot",
|
||||
"number_of_target": 1,
|
||||
"type": "techtree",
|
||||
"timeout": 300
|
||||
}
|
||||
}
|
|
@ -127,11 +127,13 @@ export class SelfPrompter {
|
|||
|
||||
async pause() {
|
||||
this.interrupt = true;
|
||||
await this.agent.actions.stop();
|
||||
this.stopLoop();
|
||||
this.state = PAUSED;
|
||||
}
|
||||
|
||||
shouldInterrupt(is_self_prompt) { // to be called from handleMessage
|
||||
return is_self_prompt && this.state === ACTIVE && this.interrupt;
|
||||
return is_self_prompt && (this.state === ACTIVE || this.state === PAUSED) && this.interrupt;
|
||||
}
|
||||
|
||||
handleUserPromptedCmd(is_self_prompt, is_action) {
|
||||
|
|
Loading…
Add table
Reference in a new issue