update
This commit is contained in:
parent
932474ec63
commit
f211fe2d67
@ -214,7 +214,7 @@ async function generateResponse(conversation, message) {
|
|||||||
}
|
}
|
||||||
if (pageContent) {
|
if (pageContent) {
|
||||||
const MAX_CONTENT_LENGTH = process.env.MAX_CONTENT_LENGTH;
|
const MAX_CONTENT_LENGTH = process.env.MAX_CONTENT_LENGTH;
|
||||||
let plainTextContent = $('<div>').html(pageContent).text().trim().replace(/[\r\n]+/g, ' ');
|
let plainTextContent = $('<div>').html(pageContent).text().trim().replace(/[\r\n\t]+/g, ' ');
|
||||||
|
|
||||||
if (plainTextContent.length > MAX_CONTENT_LENGTH) {
|
if (plainTextContent.length > MAX_CONTENT_LENGTH) {
|
||||||
plainTextContent = plainTextContent.substring(0, MAX_CONTENT_LENGTH) + '...';
|
plainTextContent = plainTextContent.substring(0, MAX_CONTENT_LENGTH) + '...';
|
||||||
|
Loading…
Reference in New Issue
Block a user