UNPKG

@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

29 lines (28 loc) • 1.6 kB
/** * Shared plumbing for the model files NeuroLink ships or fetches on first * use (Whistle's runtime and model, the Silero VAD model): where the * package's own `models/` directory is, whether a file on disk is the pinned * one, and a verified atomic download. Each model keeps its own manifest and * directory rules; this module only ever looks at one file at a time. * * @module voice/modelAssets */ import type { LocalModelAsset } from "../types/index.js"; /** Per-file download deadline; generous because Whistle's model is 17 MB. */ export declare const MODEL_DOWNLOAD_TIMEOUT_MS: number; /** * The package's own `models` directory, found by walking up from this module * to the directory holding NeuroLink's `package.json`. Works from the source * tree, from `dist/` and from the single-file bundles, since all of them sit * below the package root; `null` when nothing above looks like the package. */ export declare function packageModelsDir(): string | null; /** Whether the file at `path` is `asset`: size first (cheap), then the SHA-256. */ export declare function checkModelFile(path: string, asset: LocalModelAsset): Promise<"ok" | "missing" | "corrupt">; export declare function hashModelFile(path: string): Promise<string>; /** * Fetches `asset` into `dir`, verifying the SHA-256 before anything is * written and writing atomically (temp file + rename), so an interrupted * download never leaves a file that looks complete. `label` prefixes the log. */ export declare function downloadModelAsset(asset: LocalModelAsset, dir: string, label: string): Promise<void>;