UNPKG

chonkie

Version:

🦛 CHONK your texts in TS with Chonkie!✨The no-nonsense lightweight and efficient chunking library.

20 lines (19 loc) • 739 B
/** Sentence chunker client for Chonkie API. */ import { CloudClient, ChunkerInput } from "./base"; import { SentenceChunk } from "../types/sentence"; export interface SentenceChunkerConfig { tokenizerOrTokenCounter?: string; chunkSize?: number; chunkOverlap?: number; minSentencesPerChunk?: number; minCharactersPerSentence?: number; approximate?: boolean; delim?: string | string[]; includeDelim?: "prev" | "next" | null; } export declare class SentenceChunker extends CloudClient { private readonly config; constructor(apiKey: string, config?: SentenceChunkerConfig); chunk(input: ChunkerInput): Promise<SentenceChunk[]>; chunkBatch(inputs: ChunkerInput[]): Promise<SentenceChunk[][]>; }