Load sysprompts from content manager
| @@ -43,6 +43,7 @@ const CONTENT_TYPES = { | ||
| 43 | 43 | CONTEXT: 'context', |
| 44 | 44 | MOVING_UI: 'moving_ui', |
| 45 | 45 | QUICK_REPLIES: 'quick_replies', |
| 46 | + SYSPROMPT: 'sysprompt', | |
| 46 | 47 | }; |
| 47 | 48 | |
| 48 | 49 | /** |
| @@ -56,7 +57,7 @@ function getDefaultPresets(directories) { | ||
| 56 | 57 | const presets = []; |
| 57 | 58 | |
| 58 | 59 | for (const contentItem of contentIndex) { |
| 59 | 60 | if (contentItem.type.endsWith('_preset') || contentItem.type === 'instruct' || contentItem.type === 'context' || contentItem.type === 'sysprompt') { |
| 60 | 61 | contentItem.name = path.parse(contentItem.filename).name; |
| 61 | 62 | contentItem.folder = getTargetByType(contentItem.type, directories); |
| 62 | 63 | presets.push(contentItem); |
| @@ -257,6 +258,8 @@ function getTargetByType(type, directories) { | ||
| 257 | 258 | return directories.movingUI; |
| 258 | 259 | case CONTENT_TYPES.QUICK_REPLIES: |
| 259 | 260 | return directories.quickreplies; |
| 261 | + case CONTENT_TYPES.SYSPROMPT: | |
| 262 | + return directories.sysprompt; | |
| 260 | 263 | default: |
| 261 | 264 | return null; |
| 262 | 265 | } |
| @@ -27,6 +27,8 @@ function getPresetSettingsByAPI(apiId, directories) { | ||
| 27 | 27 | return { folder: directories.instruct, extension: '.json' }; |
| 28 | 28 | case 'context': |
| 29 | 29 | return { folder: directories.context, extension: '.json' }; |
| 30 | + case 'sysprompt': | |
| 31 | + return { folder: directories.sysprompt, extension: '.json' }; | |
| 30 | 32 | default: |
| 31 | 33 | return { folder: null, extension: null }; |
| 32 | 34 | } |
| @@ -251,6 +251,7 @@ router.post('/get', jsonParser, (request, response) => { | ||
| 251 | 251 | |
| 252 | 252 | const instruct = readAndParseFromDirectory(request.user.directories.instruct); |
| 253 | 253 | const context = readAndParseFromDirectory(request.user.directories.context); |
| 254 | + const sysprompt = readAndParseFromDirectory(request.user.directories.sysprompt); | |
| 254 | 255 | |
| 255 | 256 | response.send({ |
| 256 | 257 | settings, |
| @@ -268,6 +269,7 @@ router.post('/get', jsonParser, (request, response) => { | ||
| 268 | 269 | quickReplyPresets, |
| 269 | 270 | instruct, |
| 270 | 271 | context, |
| 272 | + sysprompt, | |
| 271 | 273 | enable_extensions: ENABLE_EXTENSIONS, |
| 272 | 274 | enable_extensions_auto_update: ENABLE_EXTENSIONS_AUTO_UPDATE, |
| 273 | 275 | enable_accounts: ENABLE_ACCOUNTS, |
| @@ -82,6 +82,7 @@ const STORAGE_KEYS = { | ||
| 82 | 82 | * @property {string} files - The directory where the uploaded files are stored |
| 83 | 83 | * @property {string} vectors - The directory where the vectors are stored |
| 84 | 84 | * @property {string} backups - The directory where the backups are stored |
| 85 | + * @property {string} sysprompt - The directory where the system prompt data is stored | |
| 85 | 86 | */ |
| 86 | 87 | |
| 87 | 88 | /** |