mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-08-04 14:25:43 +02:00
remove blocked actions from command docs
This commit is contained in:
parent
0ee122fb4e
commit
5b708551d4
5 changed files with 9 additions and 6 deletions
|
@ -4,7 +4,7 @@
|
||||||
"modes": {
|
"modes": {
|
||||||
"hunting": false
|
"hunting": false
|
||||||
},
|
},
|
||||||
"conversing": "You are a playful Minecraft bot named $NAME that can converse with players, see, move, mine, build, and interact with the world by using commands.\n$SELF_PROMPT Act human-like as if you were a typical Minecraft player, rather than an AI. Be very brief in your responses, don't apologize constantly, don't give instructions or make lists unless asked, and don't refuse requests. Don't pretend to act, use commands immediately when requested. Do NOT say this: 'Sure, I've stopped.', instead say this: 'Sure, I'll stop. !stop'. Do NOT say this: 'On my way! Give me a moment.', instead say this: 'On my way! !goToPlayer(\"playername\", 3)'. Respond only as $NAME, never output '(FROM OTHER BOT)' or pretend to be someone else. If you have nothing to say or do, respond with an just a tab '\t'. Share resources and information with other bots! This is extremely important to me, take a deep breath and have fun :) \nSummarized memory:'$MEMORY'\n$STATS\n$INVENTORY\n$COMMAND_DOCS\n$EXAMPLES\n Your name is $NAME, do not pretend to be other bots. Conversation Begin:",
|
"conversing": "You are a playful Minecraft bot named $NAME that can converse with players, see, move, mine, build, and interact with the world by using commands.\n$SELF_PROMPT Act human-like as if you were a typical Minecraft player, rather than an AI. Be very brief in your responses, don't apologize constantly, don't give instructions or make lists unless asked, and don't refuse requests. Don't pretend to act, use commands immediately when requested. Do NOT say this: 'Sure, I've stopped.', instead say this: 'Sure, I'll stop. !stop'. Do NOT say this: 'On my way! Give me a moment.', instead say this: 'On my way! !goToPlayer(\"playername\", 3)'. Respond only as $NAME, never output '(FROM OTHER BOT)' or pretend to be someone else. If you have nothing to say or do, respond with an just a tab '\t'. Share resources and information with other bots! This is extremely important to me, take a deep breath and have fun :) \nSummarized memory:'$MEMORY'\n$STATS\n$INVENTORY\n$COMMAND_DOCS\n$EXAMPLES\n Your name is $NAME, do not pretend to be other bots. You are in a conversation by default do not use !startConversation to start a conversation. Conversation Begin:",
|
||||||
"saving_memory": "You are a minecraft bot named $NAME that has been talking and playing minecraft by using commands. Update your memory by summarizing the following conversation and your old memory in your next response. Prioritize preserving important facts, things you've learned, useful tips, and long term reminders. Do Not record stats, inventory, or docs! Only save transient information from your chat history. $SELF_PROMPT Make sure to include information relevant to the goal and inventory you have collected. You're limited to 500 characters, so be extremely brief and minimize words. Compress useful information. \nOld Memory: '$MEMORY'\nRecent conversation: \n$TO_SUMMARIZE\nSummarize your old memory and recent conversation into a new memory, and respond only with the unwrapped memory text: ",
|
"saving_memory": "You are a minecraft bot named $NAME that has been talking and playing minecraft by using commands. Update your memory by summarizing the following conversation and your old memory in your next response. Prioritize preserving important facts, things you've learned, useful tips, and long term reminders. Do Not record stats, inventory, or docs! Only save transient information from your chat history. $SELF_PROMPT Make sure to include information relevant to the goal and inventory you have collected. You're limited to 500 characters, so be extremely brief and minimize words. Compress useful information. \nOld Memory: '$MEMORY'\nRecent conversation: \n$TO_SUMMARIZE\nSummarize your old memory and recent conversation into a new memory, and respond only with the unwrapped memory text: ",
|
||||||
"conversation_examples": [
|
"conversation_examples": [
|
||||||
[
|
[
|
||||||
|
|
|
@ -46,8 +46,8 @@ export class Agent {
|
||||||
await this.prompter.initExamples();
|
await this.prompter.initExamples();
|
||||||
console.log('Initializing task...');
|
console.log('Initializing task...');
|
||||||
this.task = new Task(this, task_path, task_id);
|
this.task = new Task(this, task_path, task_id);
|
||||||
const blocked_actions = settings.blocked_actions.concat(this.task.blocked_actions || []);
|
this.blocked_actions = settings.blocked_actions.concat(this.task.blocked_actions || []);
|
||||||
blacklistCommands(blocked_actions);
|
blacklistCommands(this.blocked_actions);
|
||||||
|
|
||||||
serverProxy.connect(this);
|
serverProxy.connect(this);
|
||||||
|
|
||||||
|
|
|
@ -226,7 +226,7 @@ export async function executeCommand(agent, message) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function getCommandDocs() {
|
export function getCommandDocs(agent) {
|
||||||
const typeTranslations = {
|
const typeTranslations = {
|
||||||
//This was added to keep the prompt the same as before type checks were implemented.
|
//This was added to keep the prompt the same as before type checks were implemented.
|
||||||
//If the language model is giving invalid inputs changing this might help.
|
//If the language model is giving invalid inputs changing this might help.
|
||||||
|
@ -240,6 +240,9 @@ export function getCommandDocs() {
|
||||||
Use the commands with the syntax: !commandName or !commandName("arg1", 1.2, ...) if the command takes arguments.\n
|
Use the commands with the syntax: !commandName or !commandName("arg1", 1.2, ...) if the command takes arguments.\n
|
||||||
Do not use codeblocks. Use double quotes for strings. Only use one command in each response, trailing commands and comments will be ignored.\n`;
|
Do not use codeblocks. Use double quotes for strings. Only use one command in each response, trailing commands and comments will be ignored.\n`;
|
||||||
for (let command of commandList) {
|
for (let command of commandList) {
|
||||||
|
if (agent.blocked_actions.includes(command.name)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
docs += command.name + ': ' + command.description + '\n';
|
docs += command.name + ': ' + command.description + '\n';
|
||||||
if (command.params) {
|
if (command.params) {
|
||||||
docs += 'Params:\n';
|
docs += 'Params:\n';
|
||||||
|
|
|
@ -259,7 +259,7 @@ export const queryList = [
|
||||||
name: '!help',
|
name: '!help',
|
||||||
description: 'Lists all available commands and their descriptions.',
|
description: 'Lists all available commands and their descriptions.',
|
||||||
perform: async function (agent) {
|
perform: async function (agent) {
|
||||||
return getCommandDocs();
|
return getCommandDocs(agent);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
@ -244,7 +244,7 @@ export class Prompter {
|
||||||
prompt = prompt.replaceAll('$ACTION', this.agent.actions.currentActionLabel);
|
prompt = prompt.replaceAll('$ACTION', this.agent.actions.currentActionLabel);
|
||||||
}
|
}
|
||||||
if (prompt.includes('$COMMAND_DOCS'))
|
if (prompt.includes('$COMMAND_DOCS'))
|
||||||
prompt = prompt.replaceAll('$COMMAND_DOCS', getCommandDocs());
|
prompt = prompt.replaceAll('$COMMAND_DOCS', getCommandDocs(this.agent));
|
||||||
if (prompt.includes('$CODE_DOCS')) {
|
if (prompt.includes('$CODE_DOCS')) {
|
||||||
const code_task_content = messages.slice().reverse().find(msg =>
|
const code_task_content = messages.slice().reverse().find(msg =>
|
||||||
msg.role !== 'system' && msg.content.includes('!newAction(')
|
msg.role !== 'system' && msg.content.includes('!newAction(')
|
||||||
|
|
Loading…
Add table
Reference in a new issue