mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 17:00:15 +01:00
fix: debounce title request and handle error with default title
This commit is contained in:
parent
96ca783517
commit
2fd50c99b8
7 changed files with 70 additions and 100 deletions
|
|
@ -1,9 +1,15 @@
|
|||
const express = require('express');
|
||||
const crypto = require('crypto');
|
||||
const router = express.Router();
|
||||
const { titleConvo, getCitations, citeText, askBing } = require('../../app/');
|
||||
const { getCitations, citeText, askBing } = require('../../app/');
|
||||
const { saveMessage, getConvoTitle, saveConvo } = require('../../models');
|
||||
const { handleError, sendMessage, createOnProgress, handleText } = require('./handlers');
|
||||
const {
|
||||
handleError,
|
||||
sendMessage,
|
||||
createOnProgress,
|
||||
genTitle,
|
||||
handleText
|
||||
} = require('./handlers');
|
||||
const citationRegex = /\[\^\d+?\^]/g;
|
||||
|
||||
router.post('/', async (req, res) => {
|
||||
|
|
@ -146,13 +152,7 @@ const ask = async ({
|
|||
res.end();
|
||||
|
||||
if (userParentMessageId == '00000000-0000-0000-0000-000000000000') {
|
||||
const title = await titleConvo({
|
||||
model,
|
||||
message: text,
|
||||
response: JSON.stringify(response?.text)
|
||||
});
|
||||
|
||||
console.log('CONVERSATION TITLE', title);
|
||||
const title = await genTitle({ model, text, response });
|
||||
|
||||
await saveConvo({
|
||||
conversationId,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue