diff --git a/settings.js b/settings.js index a4681fa..761e3cb 100644 --- a/settings.js +++ b/settings.js @@ -32,7 +32,7 @@ export default "show_bot_views": false, // show bot's view in browser at localhost:3000, 3001... "allow_insecure_coding": false, // allows newAction command and model can write/run code on your computer. enable at own risk - "code_timeout_mins": 10, // minutes code is allowed to run. -1 for no timeout + "code_timeout_mins": -1, // minutes code is allowed to run. -1 for no timeout "max_messages": 15, // max number of messages to keep in context "num_examples": 2, // number of examples to give to the model diff --git a/src/agent/library/skills.js b/src/agent/library/skills.js index be5882f..726ef18 100644 --- a/src/agent/library/skills.js +++ b/src/agent/library/skills.js @@ -1269,12 +1269,17 @@ export async function tillAndSow(bot, x, y, z, seedType=null) { * let position = world.getPosition(bot); * await skills.till(bot, position.x, position.y - 1, position.x); **/ - console.log(x, y, z) x = Math.round(x); y = Math.round(y); z = Math.round(z); let block = bot.blockAt(new Vec3(x, y, z)); - console.log(x, y, z) + + if (bot.modes.isOn('cheat')) { + placeBlock(bot, x, y, z, 'farmland'); + placeBlock(bot, x, y+1, z, seedType); + return true; + } + if (block.name !== 'grass_block' && block.name !== 'dirt' && block.name !== 'farmland') { log(bot, `Cannot till ${block.name}, must be grass_block or dirt.`); return false; diff --git a/src/models/gpt.js b/src/models/gpt.js index da29ef1..dfd5e22 100644 --- a/src/models/gpt.js +++ b/src/models/gpt.js @@ -54,6 +54,8 @@ export class GPT { } async embed(text) { + if (text.length > 8191) + text = text.slice(0, 8191); const embedding = await this.openai.embeddings.create({ model: this.model_name || "text-embedding-3-small", input: text, diff --git a/src/server/mind_server.js b/src/server/mind_server.js index 5d99290..b94cccf 100644 --- a/src/server/mind_server.js +++ b/src/server/mind_server.js @@ -111,7 +111,9 @@ export function createMindServer(port = 8080) { for (let manager of Object.values(agentManagers)) { manager.emit('shutdown'); } - process.exit(0); + setTimeout(() => { + process.exit(0); + }, 2000); }); });