Interface: TesseractJsOcrAdapterOptions
Defined in: src/batteries/specialists/ocr/tesseract_js/types.ts:78
Constructor options for the tesseract.js OCR adapter.
Remarks
languages is REQUIRED with no default — language packs download on first use, so a deployment must never silently fetch packs for languages it didn't plan for (mirrors @nhtio/adk/batteries/media/engines/tesseract_js!TesseractJsEngineOptions).
Extends
Properties
| Property | Type | Description | Inherited from | Defined in |
|---|---|---|---|---|
cachePath? | string | Local cache directory for downloaded language data (forwarded to createWorker). | - | src/batteries/specialists/ocr/tesseract_js/types.ts:84 |
createWorker? | CreateTesseractJsWorker | Override worker creation entirely — the full worker-injection seam for tests. | - | src/batteries/specialists/ocr/tesseract_js/types.ts:96 |
isAvailable? | () => boolean | Override the availability probe. Default: true (tesseract.js is environment-neutral). | - | src/batteries/specialists/ocr/tesseract_js/types.ts:98 |
langPath? | string | Where language data is fetched from (forwarded to createWorker). | - | src/batteries/specialists/ocr/tesseract_js/types.ts:82 |
languages | readonly string[] | Languages to load, e.g. ['eng']. REQUIRED — language packs download on first use. | - | src/batteries/specialists/ocr/tesseract_js/types.ts:80 |
onCompiling? | BatteryLifecycleCallback | Engine/graph/shader compilation after download, before the first token. A COARSE marker: the on-device runtimes (LiteRT Engine.create, transformers.js from_pretrained) expose the boundary — download done, opaque WebGPU/WASM graph build about to run — but NOT a progress stream, so progress is usually absent. Often the slowest part of a cold start; without this it was invisible. | BatteryLifecycleHooks.onCompiling | src/batteries/llm/chat_common/lifecycle.ts:95 |
onComplete? | BatteryLifecycleCallback | After the turn's output is parsed + persisted, before ack (fires per turn). | BatteryLifecycleHooks.onComplete | src/batteries/llm/chat_common/lifecycle.ts:105 |
onError? | BatteryLifecycleCallback | A load or generation failure (paired with nack). | BatteryLifecycleHooks.onError | src/batteries/llm/chat_common/lifecycle.ts:107 |
onGenerating? | BatteryLifecycleCallback | The generate call is in progress (fires per turn). Fires once immediately before the provider call for most engines; engines that stream per-step generation progress (e.g. a diffusion denoise loop) fire it REPEATEDLY during generation, each carrying a progress in 0..1. | BatteryLifecycleHooks.onGenerating | src/batteries/llm/chat_common/lifecycle.ts:103 |
onLifecycle? | BatteryLifecycleCallback | Fires on EVERY phase transition (the firehose). | BatteryLifecycleHooks.onLifecycle | src/batteries/llm/chat_common/lifecycle.ts:86 |
onLoading? | BatteryLifecycleCallback | Weights/runtime loading — may fire repeatedly with progress as the provider reports it. | BatteryLifecycleHooks.onLoading | src/batteries/llm/chat_common/lifecycle.ts:88 |
onReady? | BatteryLifecycleCallback | Engine/pipeline resolved and cached, before the first generation. | BatteryLifecycleHooks.onReady | src/batteries/llm/chat_common/lifecycle.ts:97 |
tesseract? | CreateTesseractJsModule | Override the module resolution. Default: import('tesseract.js'). | - | src/batteries/specialists/ocr/tesseract_js/types.ts:94 |
workerOptions? | Record<string, unknown> | Escape hatch forwarded into createWorker's options object, spread in AFTER langPath / cachePath (so an explicit workerOptions.langPath/workerOptions.cachePath wins). Exists because some bundlers mis-resolve tesseract.js's default workerPath/corePath URLs — this lets a consumer supply the correct bundled asset URLs without the adapter needing bespoke options for every bundler quirk. | - | src/batteries/specialists/ocr/tesseract_js/types.ts:92 |