mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-04-22 06:02:07 +02:00
commit
8e783ba75a
4 changed files with 13 additions and 4 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -111,7 +111,9 @@ export function createMindServer(port = 8080) {
|
|||
for (let manager of Object.values(agentManagers)) {
|
||||
manager.emit('shutdown');
|
||||
}
|
||||
setTimeout(() => {
|
||||
process.exit(0);
|
||||
}, 2000);
|
||||
});
|
||||
|
||||
});
|
||||
|
|
Loading…
Add table
Reference in a new issue