mirror of
https://github.com/kolbytn/mindcraft.git
synced 2025-07-23 16:35:19 +02:00
parse floats, better grok, better examples
This commit is contained in:
parent
030d5beefa
commit
5b63aef57d
4 changed files with 13 additions and 7 deletions
|
@ -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)"},
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue