@just-every/ensemble
Version:
LLM provider abstraction layer with unified streaming interface
14 lines • 670 B
TypeScript
export declare class DeltaBuffer {
private readonly step;
private readonly max;
private readonly timeLimitMs;
private buffer;
private startTimestamp;
private threshold;
constructor(step?: number, max?: number, initial?: number, timeLimitMs?: number);
add(chunk: string): string | null;
flush(): string | null;
}
export declare function bufferDelta<T>(store: Map<string, DeltaBuffer>, messageId: string, chunk: string, makeEvent: (content: string) => T): T[];
export declare function flushBufferedDeltas<T>(store: Map<string, DeltaBuffer>, makeEvent: (id: string, content: string) => T): T[];
//# sourceMappingURL=delta_buffer.d.ts.map