parse floats, better grok, better examples

This commit is contained in:
MaxRobinsonTheGreat 2024-12-07 22:47:39 -06:00
parent 030d5beefa
commit 5b63aef57d
4 changed files with 13 additions and 7 deletions

View file

@ -121,6 +121,11 @@
{"role": "assistant", "content": "Apologies, I made an error. Let me try again. !newAction(\"Try again to complete the task.\")"} {"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": "user", "content": "trixy88: craft some sticks"},
{"role": "assistant", "content": "!craftRecipe(\"stick\", 4)"}, {"role": "assistant", "content": "!craftRecipe(\"stick\", 4)"},

View file

@ -386,8 +386,8 @@ export const actionsList = [
'message': { type: 'string', description: 'The message to send.' }, 'message': { type: 'string', description: 'The message to send.' },
}, },
perform: async function (agent, player_name, message) { perform: async function (agent, player_name, message) {
if (convoManager.inConversation() && !convoManager.inConversation(player_name)) if (convoManager.inConversation())
return 'You are already talking to someone else.'; return 'You are already talking to ' + convoManager.activeConversation.name;
if (!convoManager.isOtherAgent(player_name)) if (!convoManager.isOtherAgent(player_name))
return player_name + ' is not a bot, cannot start conversation.'; return player_name + ' is not a bot, cannot start conversation.';
convoManager.startConversation(player_name, message); convoManager.startConversation(player_name, message);

View file

@ -14,8 +14,8 @@ export function getCommand(name) {
return commandMap[name]; return commandMap[name];
} }
const commandRegex = /!(\w+)(?:\(((?:-?\d+|true|false|"[^"]*")(?:\s*,\s*(?:-?\d+|true|false|"[^"]*"))*)\))?/ const commandRegex = /!(\w+)(?:\(((?:-?\d+(?:\.\d+)?|true|false|"[^"]*")(?:\s*,\s*(?:-?\d+(?:\.\d+)?|true|false|"[^"]*"))*)\))?/
const argRegex = /-?\d+|true|false|"[^"]*"/g; const argRegex = /-?\d+(?:\.\d+)?|true|false|"[^"]*"/g;
export function containsCommand(message) { export function containsCommand(message) {
const commandMatch = message.match(commandRegex); const commandMatch = message.match(commandRegex);

View file

@ -45,7 +45,8 @@ export class Grok {
res = 'My brain disconnected, try again.'; res = 'My brain disconnected, try again.';
} }
} }
return res; // sometimes outputs special token <|separator|>, just replace it
return res.replace(/<\|separator\|>/g, '.');
} }
async embed(text) { async embed(text) {