Add just a chat fields list from server

This commit is contained in:
Cohee 2024-06-06 02:05:26 +03:00
parent 76c35d269b
commit 671b7ef7cb
2 changed files with 6 additions and 0 deletions

View File

@ -7684,6 +7684,8 @@ window['SillyTavern'].getContext = function () {
setExtensionPrompt: setExtensionPrompt, setExtensionPrompt: setExtensionPrompt,
updateChatMetadata: updateChatMetadata, updateChatMetadata: updateChatMetadata,
saveChat: saveChatConditional, saveChat: saveChatConditional,
openCharacterChat: openCharacterChat,
openGroupChat: openGroupChat,
saveMetadata: saveMetadata, saveMetadata: saveMetadata,
sendSystemMessage: sendSystemMessage, sendSystemMessage: sendSystemMessage,
activateSendButtons, activateSendButtons,

View File

@ -956,6 +956,10 @@ router.post('/chats', jsonParser, async function (request, response) {
return; return;
} }
if (request.body.simple) {
return response.send(jsonFiles.map(file => ({ file_name: file })));
}
const jsonFilesPromise = jsonFiles.map((file) => { const jsonFilesPromise = jsonFiles.map((file) => {
return new Promise(async (res) => { return new Promise(async (res) => {
const pathToFile = path.join(request.user.directories.chats, characterDirectory, file); const pathToFile = path.join(request.user.directories.chats, characterDirectory, file);