From a20e8c182f852d82391e1f20cb373d57b7c77022 Mon Sep 17 00:00:00 2001 From: Raven Date: Wed, 7 Aug 2024 02:16:30 -0400 Subject: [PATCH] Update max length according to new NCTX configured --- backend-server/backend-server.js | 4 ++-- backend-server/default.env | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/backend-server/backend-server.js b/backend-server/backend-server.js index 1acf036..b0bd105 100644 --- a/backend-server/backend-server.js +++ b/backend-server/backend-server.js @@ -180,7 +180,7 @@ app.post('/api/v1/chat', async (req, res) => { }); // Trim conversation history if it exceeds the token limit - const maxLength = 7800; + const maxLength = 14000; const tolerance = 25; trimConversationHistory(conversationHistory[ip], maxLength, tolerance); @@ -491,7 +491,7 @@ async function handleSearchPlugin(searchQuery, ip, conversationHistory) { searchResponse += `${i + 1}. ${result.title} - ${result.link}\n`; try { - const scrapeResult = await scrapeWebPage(result.link, 400); + const scrapeResult = await scrapeWebPage(result.link, 800); searchResponse += `Scraped Data: ${scrapeResult}\n`; scrapedContent += `Scraped Data from ${result.link}:\n${scrapeResult}\n`; } catch (scrapeErr) { diff --git a/backend-server/default.env b/backend-server/default.env index fe16468..8c3b8f9 100644 --- a/backend-server/default.env +++ b/backend-server/default.env @@ -1,6 +1,6 @@ # Key for AbuseDB ABUSE_KEY= # Max Content to fetch from given URLs -MAX_CONTENT_LENGTH=8000 +MAX_CONTENT_LENGTH=10000 PROMPT= \ No newline at end of file