diff --git a/main.js b/main.js index f31da8f..0e80a19 100644 --- a/main.js +++ b/main.js @@ -19,7 +19,7 @@ function getProfiles(args) { return args.profiles || settings.profiles; } -function main() { +async function main() { if (settings.host_mindserver) { const mindServer = createMindServer(); } @@ -32,6 +32,7 @@ function main() { for (let i=0; i setTimeout(resolve, 1000)); } } diff --git a/mandy.json b/mandy.json new file mode 100644 index 0000000..ce3319b --- /dev/null +++ b/mandy.json @@ -0,0 +1,6 @@ +{ + "name": "mandy", + + "model": "gpt-4o-2024-11-20" + +} \ No newline at end of file diff --git a/randy.json b/randy.json deleted file mode 100644 index fbce540..0000000 --- a/randy.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "name": "randy", - - "model": "gpt-4o-mini" - -} \ No newline at end of file diff --git a/settings.js b/settings.js index 962b7c5..456a010 100644 --- a/settings.js +++ b/settings.js @@ -12,7 +12,7 @@ export default "profiles": [ "./andy.json", - "./randy.json", + "./mandy.json", // "./profiles/gpt.json", // "./profiles/claude.json", // "./profiles/gemini.json", diff --git a/src/agent/agent.js b/src/agent/agent.js index b39afb8..28c53fb 100644 --- a/src/agent/agent.js +++ b/src/agent/agent.js @@ -43,15 +43,13 @@ export class Agent { this.memory_bank = new MemoryBank(); console.log('Initializing self prompter...'); this.self_prompter = new SelfPrompter(this); - initConversationManager(this); - - // After getting the name, register with MindServer via proxy - serverProxy.registerAgent(this.name); - + initConversationManager(this); console.log('Initializing examples...'); await this.prompter.initExamples(); - console.log('Logging into minecraft...'); + serverProxy.registerAgent(this.name); + + console.log(this.name, 'logging into minecraft...'); this.bot = initBot(this.name); initModes(this); diff --git a/src/agent/library/world.js b/src/agent/library/world.js index 01d54c3..1373f6f 100644 --- a/src/agent/library/world.js +++ b/src/agent/library/world.js @@ -293,7 +293,7 @@ export function shouldPlaceTorch(bot) { if (!nearest_torch) { const block = bot.blockAt(pos); let has_torch = bot.inventory.items().find(item => item.name === 'torch'); - return has_torch && block.name === 'air'; + return has_torch && block?.name === 'air'; } return false; } diff --git a/src/agent/prompter.js b/src/agent/prompter.js index d380b1a..1e91469 100644 --- a/src/agent/prompter.js +++ b/src/agent/prompter.js @@ -141,7 +141,6 @@ export class Prompter { } async initExamples() { - console.log('initializing examples...'); try { this.convo_examples = new Examples(this.embedding_model); this.coding_examples = new Examples(this.embedding_model); @@ -151,8 +150,8 @@ export class Prompter { this.convo_examples.load(this.profile.conversation_examples), this.coding_examples.load(this.profile.coding_examples) ]); - - console.log('done initializing examples.'); + + console.log('Examples initialized.'); } catch (error) { console.error('Failed to initialize examples:', error); throw error; diff --git a/src/utils/examples.js b/src/utils/examples.js index 2dd34d4..31ef3ab 100644 --- a/src/utils/examples.js +++ b/src/utils/examples.js @@ -34,7 +34,6 @@ export class Examples { if (!this.model) return; // Early return if no embedding model try { - console.log('embedding examples...'); // Create array of promises first const embeddingPromises = examples.map(example => { const turn_text = this.turnsToText(example); @@ -46,7 +45,6 @@ export class Examples { // Wait for all embeddings to complete await Promise.all(embeddingPromises); - console.log('done embedding examples.'); } catch (err) { console.warn('Error with embedding model, using word overlap instead:', err); this.model = null;