@juspay/neurolink
Version:
The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002
33 lines (32 loc) • 1.67 kB
TypeScript
/**
* Output languages: the transcript rendered in other languages and scripts.
*
* One structured model call renders every requested target for a batch of
* lines (an utterance, or up to 20 segments of a recording), from the
* native-script engine text plus its corrected form, with earlier lines and
* their renderings as context. Targets that are the transcript's own
* language and script need no call at all.
*
* A rendering is never allowed to cost the transcript anything: it runs
* after the text is settled, fails open, and reports what happened in its
* `status`. The guards refuse an answer that is empty, in the wrong script
* for its tag, or the source handed back untranslated; a refused target gets
* one retry on its own.
*
* @module voice/output/render
*/
import type { STTCorrectionDeps, STTOutputOptions, STTOutputRenderInput, STTOutputRendering } from "../../types/index.js";
/** Distinct targets accepted per request. */
export declare const MAX_OUTPUT_LANGUAGES = 8;
/** The tag that means "the transcript as it is". */
export declare const SOURCE_OUTPUT = "source";
/**
* The output languages in effect right now: read from a live source when
* one was given, trimmed, de-duplicated (case-insensitively) and capped.
*/
export declare function outputLanguagesOf(output: STTOutputOptions | undefined): string[];
/**
* Render one transcript (one or more lines) into every requested language.
* Returns one entry per requested tag, keyed by the tag as given. Never throws.
*/
export declare function renderOutputs(input: STTOutputRenderInput, deps: Pick<STTCorrectionDeps, "render">): Promise<Record<string, STTOutputRendering>>;