llm-splitter
Version:
Efficient, configurable text chunking utility for LLM vectorization. Returns rich chunk metadata.
13 lines (12 loc) • 588 B
TypeScript
/**
* Get the text of a chunk from positional parameters.
*
* Note that for arrays, the returned result will be an array and that the first and/or last
* element of the array may be a substring of that array item's text.
*
* @param {string|string[]} input - The input (string or array of strings) to split.
* @param {number} start - The start of the chunk.
* @param {number} end - The end of the chunk.
* @returns {string|string[]} The text or array of texts of the chunk.
*/
export declare function getChunk(input: string | string[], start: number, end: number): typeof input;