* feat(triviaAI): initial commit * feat(triviaAI): configurable api endpoint * feat(triviaAI): better descriptions and stuff ig * feat(triviaAI): add decancer support * chore(triviaAI): set autorespond to false by default * refactor: use logger instead of console.log * chore: ai wants periods * unfeat: remove decancer because no external libs * chore: consistent imports * refactor: readability * refactor: error handling * refactor: simplify loop * refactor: import insertTextIntoChatInputBox from @utils/discord * feat: ok maybe toasts are not unnecessary * feat: check if api key, endpoint or models are set before doing anything * refactor: remove too many if statements
53 lines
1.8 KiB
TypeScript
53 lines
1.8 KiB
TypeScript
/*
|
|
* Vencord, a Discord client mod
|
|
* Copyright (c) 2026 Vendicated and contributors
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*/
|
|
|
|
import { definePluginSettings } from "@api/Settings";
|
|
import { OptionType } from "@utils/types";
|
|
|
|
export const settings = definePluginSettings({
|
|
apiKey: {
|
|
type: OptionType.STRING,
|
|
description: "API Key.",
|
|
default: "",
|
|
placeholder: "Enter API Key here for your AI endpoint.",
|
|
componentProps: {
|
|
type: "password"
|
|
}
|
|
},
|
|
model: {
|
|
type: OptionType.STRING,
|
|
description: "AI Model to use.",
|
|
default: "google/gemini-3-flash-preview",
|
|
placeholder: "e.g. google/gemini-3-flash-preview, inception/mercury, openai/gpt-5.2-chat, etc."
|
|
},
|
|
systemPrompt: {
|
|
type: OptionType.STRING,
|
|
description: "System Prompt for the AI.",
|
|
default: "You are a helpful assistant who answers questions for the user in a concise and short way while using the least amount of words and punctuation.",
|
|
placeholder: "Enter system prompt."
|
|
},
|
|
maxTokens: {
|
|
type: OptionType.NUMBER,
|
|
description: "Maximum number of tokens in the response.",
|
|
default: 500
|
|
},
|
|
endpoint: {
|
|
type: OptionType.STRING,
|
|
description: "OpenAI Compatible AI Endpoint.",
|
|
default: "https://openrouter.ai/api/v1/chat/completions",
|
|
placeholder: "Enter your OpenAI compatible AI endpoint here."
|
|
},
|
|
autoRespond: {
|
|
type: OptionType.BOOLEAN,
|
|
description: "Automatically respond to messages on receiving a response.",
|
|
default: false
|
|
},
|
|
supportImages: {
|
|
type: OptionType.BOOLEAN,
|
|
description: "Pass images to the AI for context (if any). This is not supported by all models.",
|
|
default: true
|
|
}
|
|
});
|