mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-09-22 08:12:00 +02:00
23 lines
537 B
JavaScript
23 lines
537 B
JavaScript
![]() |
const { titleConvo } = require('../../../../app');
|
||
|
const { saveConvo } = require('../../../../models');
|
||
|
|
||
|
const addTitle = async (
|
||
|
req,
|
||
|
{ text, azure, response, newConvo, parentMessageId, openAIApiKey },
|
||
|
) => {
|
||
|
if (parentMessageId == '00000000-0000-0000-0000-000000000000' && newConvo) {
|
||
|
const title = await titleConvo({
|
||
|
text,
|
||
|
azure,
|
||
|
response,
|
||
|
openAIApiKey,
|
||
|
});
|
||
|
await saveConvo(req.user.id, {
|
||
|
conversationId: response.conversationId,
|
||
|
title,
|
||
|
});
|
||
|
}
|
||
|
};
|
||
|
|
||
|
module.exports = addTitle;
|