diff options
| author | MohamedBassem <me@mbassem.com> | 2024-10-12 17:25:01 +0000 |
|---|---|---|
| committer | MohamedBassem <me@mbassem.com> | 2024-10-12 17:37:42 +0000 |
| commit | 1b09682685f54f29957163be9b9f9fc2de3b49cc (patch) | |
| tree | 7f10a7635cf984acd45147c24ec3e1d35798e8ba /apps/workers/utils.ts | |
| parent | c16173ea0fdbf6cc47b13756c0a77e8399669055 (diff) | |
| download | karakeep-1b09682685f54f29957163be9b9f9fc2de3b49cc.tar.zst | |
feature: Allow customizing the inference's context length
Diffstat (limited to 'apps/workers/utils.ts')
| -rw-r--r-- | apps/workers/utils.ts | 9 |
1 files changed, 0 insertions, 9 deletions
diff --git a/apps/workers/utils.ts b/apps/workers/utils.ts index 2372684e..8d297e05 100644 --- a/apps/workers/utils.ts +++ b/apps/workers/utils.ts @@ -36,12 +36,3 @@ export async function readPDFText(buffer: Buffer): Promise<{ pdfParser.parseBuffer(buffer); }); } - -export function truncateContent(content: string, length = 1500) { - let words = content.split(" "); - if (words.length > length) { - words = words.slice(0, length); - content = words.join(" "); - } - return content; -} |
