UNPKG

ai-utils.js

Version:

Build AI applications, chatbots, and agents with JavaScript and TypeScript.

8 lines (7 loc) 421 B
import { DeltaEvent } from "./DeltaEvent.js"; export declare function extractTextDeltas<FULL_DELTA>({ deltaIterable, extractDelta, onDone, onError, }: { deltaIterable: AsyncIterable<DeltaEvent<FULL_DELTA>>; extractDelta: (fullDelta: FULL_DELTA) => string | undefined; onDone: (fullText: string, lastFullDelta: FULL_DELTA | undefined) => void; onError: (error: unknown) => void; }): AsyncIterable<string>;