mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
wip: feat: abort messages and continue conversation
fix(addToCache.js): remove unused variables and parameters feat(addToCache.js): add message to cache with id, parentMessageId, role, and text fix(askOpenAI.js): remove parentMessageId parameter from addToCache call feat(MessageHandler.jsx): add latestMessage to store on cancel of submission, and generate messageId and parentMessageId for latestMessage
This commit is contained in:
parent
a81bd27b39
commit
a953fc9f2b
3 changed files with 25 additions and 22 deletions
|
|
@ -10,7 +10,7 @@ const { handleError, sendMessage, createOnProgress, handleText } = require('./ha
|
|||
const abortControllers = new Map();
|
||||
|
||||
router.post('/abort', async (req, res) => {
|
||||
const { abortKey, latestMessage, parentMessageId } = req.body;
|
||||
const { abortKey, latestMessage } = req.body;
|
||||
console.log(`req.body`, req.body);
|
||||
if (!abortControllers.has(abortKey)) {
|
||||
return res.status(404).send('Request not found');
|
||||
|
|
@ -24,7 +24,7 @@ router.post('/abort', async (req, res) => {
|
|||
abortController.abort();
|
||||
abortControllers.delete(abortKey);
|
||||
console.log('Aborted request', abortKey, userMessage, endpointOption);
|
||||
await addToCache({ endpointOption, conversationId: abortKey, userMessage, latestMessage, parentMessageId });
|
||||
await addToCache({ endpointOption, userMessage, latestMessage });
|
||||
|
||||
res.status(200).send('Aborted');
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue