Skip to content

PersistentAI API Documentation / @persistent-ai/fireflow-nodes / findSplitPoint

Function: findSplitPoint()

findSplitPoint(text, maxLength?): number

Defined in: packages/fireflow-nodes/src/nodes/telegram/markdown.ts:33

Find the best split point within text at or before maxLength. Priority: paragraph boundary (\n\n) → line boundary (\n) → word boundary (space) → hard cut. Returns the number of characters to include in the first chunk.

Parameters

text

string

maxLength?

number = TELEGRAM_MAX_LENGTH

Returns

number

Licensed under BUSL-1.1