diff --git a/profiles/_default.json b/profiles/_default.json index 3d91ae2..7773e91 100644 --- a/profiles/_default.json +++ b/profiles/_default.json @@ -115,12 +115,17 @@ {"role": "system", "content": "Agent action stopped."}, {"role": "assistant", "content": "I've stopped! What next?"} ], - + [ {"role": "system", "content": "Code output: Action failed."}, {"role": "assistant", "content": "Apologies, I made an error. Let me try again. !newAction(\"Try again to complete the task.\")"} ], - + + [ + {"role": "system", "content": "Code output: Could not find any oak_log in 20 blocks."}, + {"role": "assistant", "content": "I'll have to search a wider area. !searchForBlock(\"oak_log\", 100)"} + ], + [ {"role": "user", "content": "trixy88: craft some sticks"}, {"role": "assistant", "content": "!craftRecipe(\"stick\", 4)"}, diff --git a/src/agent/commands/actions.js b/src/agent/commands/actions.js index a9e08b0..32a1523 100644 --- a/src/agent/commands/actions.js +++ b/src/agent/commands/actions.js @@ -386,8 +386,8 @@ export const actionsList = [ 'message': { type: 'string', description: 'The message to send.' }, }, perform: async function (agent, player_name, message) { - if (convoManager.inConversation() && !convoManager.inConversation(player_name)) - return 'You are already talking to someone else.'; + if (convoManager.inConversation()) + return 'You are already talking to ' + convoManager.activeConversation.name; if (!convoManager.isOtherAgent(player_name)) return player_name + ' is not a bot, cannot start conversation.'; convoManager.startConversation(player_name, message); diff --git a/src/agent/commands/index.js b/src/agent/commands/index.js index d163ce4..76dd117 100644 --- a/src/agent/commands/index.js +++ b/src/agent/commands/index.js @@ -14,8 +14,8 @@ export function getCommand(name) { return commandMap[name]; } -const commandRegex = /!(\w+)(?:\(((?:-?\d+|true|false|"[^"]*")(?:\s*,\s*(?:-?\d+|true|false|"[^"]*"))*)\))?/ -const argRegex = /-?\d+|true|false|"[^"]*"/g; +const commandRegex = /!(\w+)(?:\(((?:-?\d+(?:\.\d+)?|true|false|"[^"]*")(?:\s*,\s*(?:-?\d+(?:\.\d+)?|true|false|"[^"]*"))*)\))?/ +const argRegex = /-?\d+(?:\.\d+)?|true|false|"[^"]*"/g; export function containsCommand(message) { const commandMatch = message.match(commandRegex); diff --git a/src/models/grok.js b/src/models/grok.js index 00f6477..ddc6cd9 100644 --- a/src/models/grok.js +++ b/src/models/grok.js @@ -45,7 +45,8 @@ export class Grok { res = 'My brain disconnected, try again.'; } } - return res; + // sometimes outputs special token <|separator|>, just replace it + return res.replace(/<\|separator\|>/g, '.'); } async embed(text) {