diff --git a/src/modules/functions.js b/src/modules/functions.js index f40162f..bf82b33 100644 --- a/src/modules/functions.js +++ b/src/modules/functions.js @@ -109,6 +109,14 @@ const functions = { .setDescription("Generating a response, please stand by.") .setFooter({ text: "Ligma balls" }); return { embeds: [embed] }; + }, + sysPrompt(sysPrompt, model) { + const sysPromptEmbed = new EmbedBuilder() + .setColor(strings.embeds.color) + .setTitle('System Prompt') + .setDescription(sysPrompt) + .setFooter({ text: `Model: ${model}` }); + return { embeds: [sysPromptEmbed] }; } } }, diff --git a/src/slash-commands/sysprompt.js b/src/slash-commands/sysprompt.js new file mode 100644 index 0000000..aac2f19 --- /dev/null +++ b/src/slash-commands/sysprompt.js @@ -0,0 +1,21 @@ +const { SlashCommandBuilder, PermissionFlagsBits } = require('discord.js'); +const fn = require('../modules/functions.js'); +const strings = require('../data/strings.json'); + +module.exports = { + data: new SlashCommandBuilder() + .setName('sysprompt') + .setDescription('View the current system prompt') + .setDefaultMemberPermissions(PermissionFlagsBits.Administrator), + async execute(interaction) { + try { + await interaction.deferReply({ephemeral: true}); + const sysPrompt = await fn.localLLM.getSysPrompt().catch(e => console.error(e)); + const sysPromptEmbed = fn.builders.embeds.sysPrompt(sysPrompt); + await interaction.editReply(sysPromptEmbed); + } catch (e) { + console.error(e); + await interaction.editReply("An error occurred while fetching the system prompt."); + } + }, +}; \ No newline at end of file