mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-09-10 12:02:59 +02:00
self prompt won't reprompt for every message
This commit is contained in:
parent
ee7c715786
commit
a3541c6886
2 changed files with 8 additions and 2 deletions
|
@ -117,6 +117,9 @@ export class Agent {
|
|||
if (max_responses === null) {
|
||||
max_responses = settings.max_commands === -1 ? Infinity : settings.max_commands;
|
||||
}
|
||||
if (max_responses === -1){
|
||||
max_responses = Infinity;
|
||||
}
|
||||
|
||||
let self_prompt = source === 'system' || source === this.name;
|
||||
|
||||
|
|
|
@ -32,9 +32,9 @@ export class SelfPrompter {
|
|||
let no_command_count = 0;
|
||||
const MAX_NO_COMMAND = 3;
|
||||
while (!this.interrupt) {
|
||||
let msg = `You are self-prompting with the goal: '${this.prompt}'. Your next response MUST contain a command !withThisSyntax. Respond:`;
|
||||
const msg = `You are self-prompting with the goal: '${this.prompt}'. Your next response MUST contain a command !withThisSyntax. Respond:`;
|
||||
|
||||
let used_command = await this.agent.handleMessage('system', msg, 1);
|
||||
let used_command = await this.agent.handleMessage('system', msg, -1);
|
||||
if (!used_command) {
|
||||
no_command_count++;
|
||||
if (no_command_count >= MAX_NO_COMMAND) {
|
||||
|
@ -69,6 +69,9 @@ export class SelfPrompter {
|
|||
this.idle_time = 0;
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.idle_time = 0;
|
||||
}
|
||||
}
|
||||
|
||||
async stopLoop() {
|
||||
|
|
Loading…
Add table
Reference in a new issue