customGpts persist through localStorage

This commit is contained in:
Daniel Avila 2023-03-04 17:39:06 -05:00
parent 62bb6ea8f8
commit 9c3a78f96b
22 changed files with 405 additions and 220 deletions

View file

@ -120,6 +120,15 @@ router.post('/', async (req, res) => {
gptResponse.sender = model === 'chatgptCustom' ? chatGptLabel : model;
gptResponse.final = true;
gptResponse.text = await detectCode(gptResponse.text);
if (chatGptLabel?.length > 0 && model === 'chatgptCustom') {
gptResponse.chatGptLabel = chatGptLabel;
}
if (promptPrefix?.length > 0 && model === 'chatgptCustom') {
gptResponse.promptPrefix = promptPrefix;
}
await saveMessage(gptResponse);
await saveConvo(gptResponse);
sendMessage(res, gptResponse);