mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
feat: syncs across document deletions
This commit is contained in:
parent
1dbfb0dab7
commit
97634865eb
4 changed files with 31 additions and 18 deletions
|
|
@ -19,25 +19,22 @@ router.get('/:conversationId', async (req, res) => {
|
|||
router.post('/gen_title', async (req, res) => {
|
||||
const { conversationId } = req.body.arg;
|
||||
|
||||
const convo = await getConvo(req?.session?.user?.username, conversationId)
|
||||
const firstMessage = (await getMessages({ conversationId }))[0]
|
||||
const secondMessage = (await getMessages({ conversationId }))[1]
|
||||
const convo = await getConvo(req?.session?.user?.username, conversationId);
|
||||
const firstMessage = (await getMessages({ conversationId }))[0];
|
||||
const secondMessage = (await getMessages({ conversationId }))[1];
|
||||
|
||||
const title = convo.jailbreakConversationId
|
||||
? await getConvoTitle(req?.session?.user?.username, conversationId)
|
||||
: await titleConvo({
|
||||
model: convo?.model,
|
||||
message: firstMessage?.text,
|
||||
response: JSON.stringify(secondMessage?.text || '')
|
||||
});
|
||||
model: convo?.model,
|
||||
message: firstMessage?.text,
|
||||
response: JSON.stringify(secondMessage?.text || '')
|
||||
});
|
||||
|
||||
await saveConvo(
|
||||
req?.session?.user?.username,
|
||||
{
|
||||
conversationId,
|
||||
title
|
||||
}
|
||||
)
|
||||
await saveConvo(req?.session?.user?.username, {
|
||||
conversationId,
|
||||
title
|
||||
});
|
||||
|
||||
res.status(200).send(title);
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue