UNPKG

chonkie

Version:

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

22 lines (21 loc) • 787 B
/** Semantic chunker client for Chonkie API. */ import { CloudClient, ChunkerInput } from "./base"; import { SemanticChunk } from "../types/semantic"; export interface SemanticChunkerConfig { embeddingModel?: string; threshold?: number | "auto"; chunkSize?: number; similarityWindow?: number; minSentences?: number; minChunkSize?: number; minCharactersPerSentence?: number; thresholdStep?: number; delim?: string | string[]; includeDelim?: "prev" | "next" | null; } export declare class SemanticChunker extends CloudClient { private readonly config; constructor(apiKey: string, config?: SemanticChunkerConfig); chunk(input: ChunkerInput): Promise<SemanticChunk[]>; chunkBatch(inputs: ChunkerInput[]): Promise<SemanticChunk[][]>; }