File size: 744 Bytes
ffe59ba
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import type { DonutEntity, ExtractedField } from "./types.js";

export type PipelineEvent =
  | { type: "models"; data: { extractor: string; recognition: string; structured: string } }
  | { type: "recognition_start"; data: { model: string } }
  | { type: "recognition_chunk"; data: { textLen: number } }
  | { type: "recognition_done"; data: { markdown: string; ms: number } }
  | { type: "donut_start" }
  | { type: "donut_done"; data: { entities: DonutEntity[]; rawData: unknown; ms: number } }
  | { type: "gliner_start"; data: { labels: string[] } }
  | { type: "gliner_done"; data: { fields: ExtractedField[]; ms: number } }
  | { type: "done"; data: { totalMs: number } }
  | { type: "error"; data: { message: string; stage: string } };