chonkie
Version:
🦛 CHONK your texts in TS with Chonkie!✨The no-nonsense lightweight and efficient chunking library.
16 lines (15 loc) • 554 B
TypeScript
/** Code chunker client for Chonkie API. */
import { CloudClient, ChunkerInput } from "./base";
import { CodeChunk } from "../types/code";
export interface CodeChunkerConfig {
tokenizerOrTokenCounter?: string;
chunkSize?: number;
language: string;
includeNodes?: boolean;
}
export declare class CodeChunker extends CloudClient {
private readonly config;
constructor(apiKey: string, config: CodeChunkerConfig);
chunk(input: ChunkerInput): Promise<CodeChunk[]>;
chunkBatch(inputs: ChunkerInput[]): Promise<CodeChunk[][]>;
}