mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 00:40:14 +01:00
* feat: add option to disable titling as well as decide what model to use for OpenAI titling refactor: truncate conversation text so it caps around 200 tokens for titling requests, optimize some of the title prompts * feat: disable bing titling with TITLE_CONVO as well
10 lines
211 B
JavaScript
10 lines
211 B
JavaScript
const MAX_CHAR = 255;
|
|
|
|
function truncateText(text) {
|
|
if (text.length > MAX_CHAR) {
|
|
return `${text.slice(0, MAX_CHAR)}... [text truncated for brevity]`;
|
|
}
|
|
return text;
|
|
}
|
|
|
|
module.exports = truncateText;
|