chonkie
Version:
🦛 CHONK your texts in TS with Chonkie!✨The no-nonsense lightweight and efficient chunking library.
45 lines (44 loc) • 1.18 kB
TypeScript
import { RecursiveChunk } from './recursive';
/** Interface for LateChunk data */
interface LateChunkData {
text: string;
startIndex: number;
endIndex: number;
tokenCount: number;
embedding?: number[];
}
/** Class to represent the late chunk
*
* @class LateChunk
*/
export declare class LateChunk extends RecursiveChunk {
/** The embedding of the chunk */
embedding?: number[];
constructor(data: {
text: string;
startIndex: number;
endIndex: number;
tokenCount: number;
embedding?: number[];
});
/**
* Return a string representation of the LateChunk
*
* @returns {string} The string representation of the LateChunk.
*/
toString(): string;
/**
* Return the LateChunk as a dictionary-like object
*
* @returns {LateChunkData} The dictionary-like object.
*/
toDict(): LateChunkData;
/**
* Create a LateChunk object from a dictionary-like object.
*
* @param {LateChunkData} data - The dictionary-like object.
* @returns {LateChunk} The LateChunk object.
*/
static fromDict(data: LateChunkData): LateChunk;
}
export {};