Add smart models

This commit is contained in:
Aslan 2026-01-24 05:05:05 -05:00
parent edc8204412
commit a711aec42b
2 changed files with 11 additions and 4 deletions

View file

@ -4,7 +4,12 @@ import { config } from "../../config.js";
import { getTextGemini, getImageGemini } from "../../services/ai/ai.js"; import { getTextGemini, getImageGemini } from "../../services/ai/ai.js";
import { alts } from "./alts.js"; import { alts } from "./alts.js";
import type { IAIInstructions } from "./types.js"; import type { IAIInstructions } from "./types.js";
import { changePersonality, getUserById, getUserName } from "../../helpers.js"; import {
changePersonality,
checkRoles,
getUserById,
getUserName,
} from "../../helpers.js";
import { prices } from "./prices.js"; import { prices } from "./prices.js";
import { state } from "../../store/store.js"; import { state } from "../../store/store.js";
@ -46,7 +51,8 @@ const onAI = async (
let personality = config.app.ai.personalities[state.personality.index]; let personality = config.app.ai.personalities[state.personality.index];
const useSmartModel = text.startsWith("!aipro"); const useSmartModel =
text.startsWith("!aipro") && checkRoles(["MODERATOR", "ADMIN"], sender);
let textMod = text.replace("!aipro", "").replace("!ai", "").trim(); let textMod = text.replace("!aipro", "").replace("!ai", "").trim();
let instructions = { let instructions = {
@ -103,7 +109,9 @@ const onAI = async (
const onImageGen = async (text: string, roomId: string, sender: string) => { const onImageGen = async (text: string, roomId: string, sender: string) => {
const user = getUserById(sender); const user = getUserById(sender);
const useSmartModel = text.startsWith("!imgpro"); const useSmartModel =
text.startsWith("!imgpro") &&
checkRoles(["MODERATOR", "ADMIN"], sender);
let textMod = text let textMod = text
.replace("!imgpro", "") .replace("!imgpro", "")

View file

@ -13,7 +13,6 @@ import { registerModuleAI } from "./ai/ai.js";
import { registerModuleGame } from "./game/game.js"; import { registerModuleGame } from "./game/game.js";
import { checkRoles, getUserById, log } from "../helpers.js"; import { checkRoles, getUserById, log } from "../helpers.js";
import { onAnyMessage, onMissingRole } from "./global.js"; import { onAnyMessage, onMissingRole } from "./global.js";
import { config } from "../config.js";
const callbacks: ICallbackStore = { const callbacks: ICallbackStore = {
messageCallbacks: [], messageCallbacks: [],