Add slash commands and connection profiles support

This commit is contained in:
Cohee
2024-09-17 12:14:13 +00:00
parent 912bebeb01
commit 0bc6a572c6
2 changed files with 139 additions and 1 deletions

View File

@ -33,6 +33,8 @@ const CC_COMMANDS = [
const TC_COMMANDS = [
...COMMON_COMMANDS,
'sysprompt',
'sysprompt-state',
'instruct',
'context',
'instruct-state',
@ -45,6 +47,8 @@ const FANCY_NAMES = {
'preset': 'Settings Preset',
'model': 'Model',
'proxy': 'Proxy Preset',
'sysprompt-state': 'Use System Prompt',
'sysprompt': 'System Prompt Name',
'instruct-state': 'Instruct Mode',
'instruct': 'Instruct Template',
'context': 'Context Template',
@ -180,6 +184,11 @@ async function readProfileFromCommands(mode, profile, cleanUp = false) {
}
if (cleanUp) {
for (const command of commands) {
if (command.endsWith('-state') && profile[command] === 'false') {
delete profile[command.replace('-state', '')];
}
}
for (const command of opposingCommands) {
if (commands.includes(command)) {
continue;