From dcd6778c19d375130d85dba48e7e23c4d741a4cd90579ccbefbb97b6105c5544 Mon Sep 17 00:00:00 2001 From: aslan Date: Sun, 28 Dec 2025 18:26:11 +0100 Subject: [PATCH] More AI improvements --- src/config.preset.json | 3 ++- src/modules/ai/ai.ts | 3 +-- src/modules/ai/alts.ts | 6 ++++++ src/modules/ai/types.ts | 1 + src/modules/user/user.ts | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/config.preset.json b/src/config.preset.json index 66ea18d..dbd7d75 100644 --- a/src/config.preset.json +++ b/src/config.preset.json @@ -24,7 +24,8 @@ "ai": { "api": { "key": "" - } + }, + "prompt": "Your name is Aslobot. Be concise, try to keep text as short as possible. Be helpful." } } } diff --git a/src/modules/ai/ai.ts b/src/modules/ai/ai.ts index 233a390..8743b21 100644 --- a/src/modules/ai/ai.ts +++ b/src/modules/ai/ai.ts @@ -37,8 +37,7 @@ const onAI = async (text: string, roomId: string, sender: string) => { let textMod = text.replace("!ai", "").trim().toLowerCase(); let instructions = { prefferedLanguages: ["english", "slovak"], - adminText: - "Your name is Aslobot. Be concise, try to keep text as short as possible. Be helpful, but you are encouraged to be sarcastic and make fun of people", + adminText: config.app.ai.prompt, alts: alts, } as IAdminInstructions; diff --git a/src/modules/ai/alts.ts b/src/modules/ai/alts.ts index f7b8ead..6a162d2 100644 --- a/src/modules/ai/alts.ts +++ b/src/modules/ai/alts.ts @@ -16,14 +16,17 @@ const alts: IAIAlt[] = [ "macag", ], alt: "black cat", + information: "an evil cat, married to white cat", }, { keys: ["macica", "macico"], alt: "white cat", + information: "married to black cat", }, { keys: ["gabor", "gaber", "martin", "marting"], alt: "hedgehog", + information: "married to ai", }, { keys: [ @@ -37,14 +40,17 @@ const alts: IAIAlt[] = [ "madek", ], alt: "beaver", + information: "likes shoot fetish", }, { keys: ["janys", "jano", "janeg", "janek", "aslanek", "aslan", "aslo"], alt: "lion", + information: "the creator", }, { keys: ["marek", "mareg", "macek", "maceg", "rod"], alt: "purple snake", + information: "drives fast", }, { keys: ["lara", "kostur", "kosturik"], diff --git a/src/modules/ai/types.ts b/src/modules/ai/types.ts index 7f57e3b..1189939 100644 --- a/src/modules/ai/types.ts +++ b/src/modules/ai/types.ts @@ -1,6 +1,7 @@ interface IAIAlt { keys: string[]; alt: string; + information?: string; } interface IAdminInstructions { diff --git a/src/modules/user/user.ts b/src/modules/user/user.ts index 1ad7770..f5038bd 100644 --- a/src/modules/user/user.ts +++ b/src/modules/user/user.ts @@ -82,7 +82,7 @@ const onAILeaderboard = (_text: string, roomId: string) => { const userNameMod = userName.charAt(0).toUpperCase() + userName.slice(1); - return `
  • ${userNameMod}: cost ${cost}
  • `; + return `
  • ${userNameMod}: cost ${cost.toFixed(2)}$
  • `; }; const users = state.users.sort(