/** * A cross-environment transcription {@link @nhtio/adk/batteries/media/contracts!MediaEngine} * backed by `@huggingface/transformers` Whisper (ONNX in Node, WASM/WebGPU in browsers). * * @module @nhtio/adk/batteries/media/engines/transformers_asr * * @remarks * The local-by-default speech-to-text engine: no external API, no binary. Declares one * convert capability: the virtual `pcm` token to `txt`/`srt`/`vtt`/`json` (transcription is a * format conversion — PCM in, text out). The Whisper model id is REQUIRED — models are * multi-hundred-megabyte downloads on first use and the battery never triggers one silently * (the loud-config rule). Input is 16 kHz mono PCM, exactly what the transcribe step * supplies; `lang`/`translate` ride `request.options`. `srt`/`vtt` output is assembled from * chunk timestamps; `json` returns the chunk structure verbatim. * * `@huggingface/transformers` is an optional peer dependency, lazily imported on first * actual use. */ import type * as TransformersNS from '@huggingface/transformers'; import type { MediaEngine } from "../contracts"; type TransformersModule = typeof TransformersNS; /** Options for {@link transformersAsrEngine}. */ export interface TransformersAsrEngineOptions { /** * The Whisper model id, e.g. `onnx-community/whisper-base`. REQUIRED — no default, no * surprise downloads. */ model: string; /** Override the module resolution. Default: `import('@huggingface/transformers')`. */ transformers?: () => TransformersModule | Promise; /** Extra options forwarded to `pipeline()` (device, dtype, cache_dir…). */ pipelineOptions?: Record; } /** * Construct the transformers.js Whisper ASR engine. * * @param options - Model id (required) and overrides. * @returns The engine. */ export declare const transformersAsrEngine: (options: TransformersAsrEngineOptions) => MediaEngine; export {};