mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
fix: dont send gen_title twice
This commit is contained in:
parent
d73375958b
commit
8b00805d24
5 changed files with 29 additions and 18 deletions
|
|
@ -17,20 +17,23 @@ router.post('/gen_title', async (req, res) => {
|
|||
const firstMessage = (await getMessages({ conversationId }))[0]
|
||||
const secondMessage = (await getMessages({ conversationId }))[1]
|
||||
|
||||
const title = convo.jailbreakConversationId
|
||||
? await getConvoTitle(conversationId)
|
||||
: await titleConvo({
|
||||
model: convo?.model,
|
||||
message: firstMessage?.text,
|
||||
response: JSON.stringify(secondMessage?.text || '')
|
||||
});
|
||||
|
||||
await saveConvo({
|
||||
conversationId,
|
||||
title
|
||||
})
|
||||
|
||||
res.status(200).send(title);
|
||||
// if (convo.title == 'New Chat') {
|
||||
// const title = await titleConvo({
|
||||
// model: convo?.model,
|
||||
// message: firstMessage?.text,
|
||||
// response: JSON.stringify(secondMessage?.text || '')
|
||||
// });
|
||||
|
||||
// console.log('CONVERSATION TITLE', title);
|
||||
|
||||
// await saveConvo({
|
||||
// conversationId,
|
||||
// title
|
||||
// })
|
||||
|
||||
// res.status(200).send(title);
|
||||
// } else
|
||||
return res.status(200).send(convo.title);
|
||||
});
|
||||
|
||||
router.post('/clear', async (req, res) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue