mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
fix: generate title by backend
This commit is contained in:
parent
3e7ce67609
commit
27515cb00a
6 changed files with 40 additions and 26 deletions
|
|
@ -72,14 +72,6 @@ router.post('/', async (req, res) => {
|
|||
userMessage.invocationId = response.invocationId;
|
||||
await saveMessage(userMessage);
|
||||
|
||||
// if (!convo.conversationSignature) {
|
||||
// response.title = await titleConvo({
|
||||
// model,
|
||||
// message: text,
|
||||
// response: JSON.stringify(response.response)
|
||||
// });
|
||||
// }
|
||||
|
||||
response.text = response.response;
|
||||
delete response.response;
|
||||
// response.id = response.details.messageId;
|
||||
|
|
@ -104,6 +96,19 @@ router.post('/', async (req, res) => {
|
|||
responseMessage: gptResponse
|
||||
});
|
||||
res.end();
|
||||
|
||||
if (parentMessageId == '00000000-0000-0000-0000-000000000000') {
|
||||
const title = await titleConvo({
|
||||
model,
|
||||
message: text,
|
||||
response: JSON.stringify(gptResponse?.text)
|
||||
});
|
||||
|
||||
await saveConvo({
|
||||
conversationId,
|
||||
title
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
// await deleteMessages({ messageId: userMessageId });
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue