From 59d54b37fb4a83d5bafa1f51c6905922b2caf809c9949d613cfd90e45b0614aa Mon Sep 17 00:00:00 2001 From: aslan Date: Sun, 28 Dec 2025 18:15:13 +0100 Subject: [PATCH] AI Improvements --- src/modules/ai/ai.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/modules/ai/ai.ts b/src/modules/ai/ai.ts index d29ea41..233a390 100644 --- a/src/modules/ai/ai.ts +++ b/src/modules/ai/ai.ts @@ -4,7 +4,7 @@ import { config } from "../../config.js"; import { getTextGemini, getImageGemini } from "../../services/ai/ai.js"; import { alts } from "./alts.js"; import type { IAdminInstructions } from "./types.js"; -import { getUserById } from "../../helpers.js"; +import { getUserById, getUserName } from "../../helpers.js"; import { prices } from "./prices.js"; let client: MatrixClient; @@ -37,11 +37,13 @@ const onAI = async (text: string, roomId: string, sender: string) => { let textMod = text.replace("!ai", "").trim().toLowerCase(); let instructions = { prefferedLanguages: ["english", "slovak"], - adminText: "Be concise, try to keep text as short as possible", + 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", alts: alts, } as IAdminInstructions; - textMod = `Admin Instructions:\n${JSON.stringify(instructions)}\nPrompt:\n${textMod}`; + const username = getUserName(user); + textMod = `Admin Instructions:\n${JSON.stringify(instructions)}\nPrompt by ${username}:\n${textMod}`; const responseAI = await getTextGemini(textMod);