From 0bffe111b12b6d249d9677386ebd1db1570552dc Mon Sep 17 00:00:00 2001 From: Isadora White Date: Sun, 1 Jun 2025 18:43:28 -0500 Subject: [PATCH 1/2] fixing weird conversation thing maybe --- src/agent/tasks/tasks.js | 33 +++++++++++++++++---------------- src/models/vllm.js | 1 + 2 files changed, 18 insertions(+), 16 deletions(-) diff --git a/src/agent/tasks/tasks.js b/src/agent/tasks/tasks.js index 1c00d95..f2d0fb2 100644 --- a/src/agent/tasks/tasks.js +++ b/src/agent/tasks/tasks.js @@ -423,10 +423,24 @@ export class Task { 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]; + 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 && this.data.agent_count > 1) { + console.log('No other agents found. Task unsuccessful.'); + this.agent.killAll(); + } + await executeCommand(this.agent, `!startConversation("${other_name}", "${this.data.conversation}")`); + } } async initBotTask() { - await this.setAgentGoal(); await this.agent.bot.chat(`/clear ${this.name}`); console.log(`Cleared ${this.name}'s inventory.`); @@ -511,21 +525,8 @@ export class Task { this.agent.killAll(); } } - - 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 && this.data.agent_count > 1) { - console.log('No other agents found. Task unsuccessful.'); - this.agent.killAll(); - } - await executeCommand(this.agent, `!startConversation("${other_name}", "${this.data.conversation}")`); - } + await new Promise((resolve) => setTimeout(resolve, 500)); + await this.setAgentGoal(); } diff --git a/src/models/vllm.js b/src/models/vllm.js index 52e3e5b..e9116ef 100644 --- a/src/models/vllm.js +++ b/src/models/vllm.js @@ -38,6 +38,7 @@ export class VLLM { try { console.log('Awaiting openai api response...') // console.log('Messages:', messages); + // todo set max_tokens, temperature, top_p, etc. in pack let completion = await this.vllm.chat.completions.create(pack); if (completion.choices[0].finish_reason == 'length') throw new Error('Context length exceeded'); From 0503ee34097d80d965ef23091c6143a48597f736 Mon Sep 17 00:00:00 2001 From: Isadora White Date: Sun, 1 Jun 2025 18:46:50 -0500 Subject: [PATCH 2/2] remove the conversation thingie from the set agent goal command --- src/agent/tasks/tasks.js | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/src/agent/tasks/tasks.js b/src/agent/tasks/tasks.js index f2d0fb2..a7948f5 100644 --- a/src/agent/tasks/tasks.js +++ b/src/agent/tasks/tasks.js @@ -423,21 +423,6 @@ export class Task { 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]; - 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 && this.data.agent_count > 1) { - console.log('No other agents found. Task unsuccessful.'); - this.agent.killAll(); - } - await executeCommand(this.agent, `!startConversation("${other_name}", "${this.data.conversation}")`); - } } async initBotTask() { @@ -526,9 +511,21 @@ export class Task { } } await new Promise((resolve) => setTimeout(resolve, 500)); + 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 && this.data.agent_count > 1) { + console.log('No other agents found. Task unsuccessful.'); + this.agent.killAll(); + } + await executeCommand(this.agent, `!startConversation("${other_name}", "${this.data.conversation}")`); + } await this.setAgentGoal(); - - } async teleportBots() {