AI Improvements

This commit is contained in:
Aslan 2025-12-28 18:15:13 +01:00
parent 00211a604f
commit 59d54b37fb

View file

@ -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);