UNPKG

chonkie

Version:

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

32 lines (31 loc) • 1.25 kB
/** ChromaHandshake to integrate Chonkie with Chroma. */ import { BaseHandshake } from "./base"; import { ChromaClient } from "chromadb"; import { Chunk } from "../types/base"; /** * ChromaHandshake to integrate Chonkie with Chroma. * * @param client - The ChromaClient to use. * @param collectionName - The name of the collection to use. * @param path - The path to the Chroma database. Can point to the running instance, Docker or Cloud. * @param logLevel - The log level ('verbose' or 'silent'). Default: 'verbose'. */ export declare class ChromaHandshake extends BaseHandshake { private client; private collectionName; private logLevel; constructor(client?: ChromaClient, collectionName?: string, path?: string, logLevel?: 'verbose' | 'silent'); private _getId; /** * Write chunks to the collection provided in the constructor. * @param chunks - The chunks to write. */ write(chunks: Chunk[]): Promise<void>; /** * Query the collection provided in the constructor. * @param query - The query to search for. * @param nResults - The number of results to return. * @returns The chunks that match the query. */ query(query: string, nResults?: number): Promise<Chunk[]>; }