@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
51 lines (50 loc) • 2.26 kB
TypeScript
import type { ServerSTTEvalBatchRequest, ServerSTTEvalBatchResponse, ServerSTTEvalCallSummary, ServerSTTEvalOptions, ServerSTTEvalReport } from "../../types/index.js";
export declare class STTEvalStore {
private readonly _dir;
private readonly _maxCalls;
private readonly _maxSegments;
private readonly _maxBytes;
private _totalBytes;
private readonly _calls;
/** Per call: the tail of its accept queue, so batches apply and append in arrival order. */
private readonly _queues;
private _ready;
private readonly _langfuse;
constructor(options?: ServerSTTEvalOptions);
/** Bytes of segments held in memory right now, across every call. */
get heldBytes(): number;
/**
* Take a batch. `owner` is the authenticated caller, when the server
* identified one: a call created with an owner accepts batches only from
* that owner, and `undefined` is returned for anyone else's.
*/
accept(batch: ServerSTTEvalBatchRequest, owner?: string): Promise<ServerSTTEvalBatchResponse | undefined>;
/** Calls visible to `owner`: theirs and the unowned ones (see `_visibleTo`). */
list(owner?: string): Promise<ServerSTTEvalCallSummary[]>;
report(callId: string, includeSegments?: boolean, owner?: string): Promise<ServerSTTEvalReport | undefined>;
/**
* A call an identified caller created is theirs alone. A call with no owner
* (made under no authentication or a shared key) is visible to everyone, as
* every call was before owners existed.
*/
private _visibleTo;
private _reportOf;
/** Runs `task` after every earlier task for the same call has settled. */
private _serial;
private _create;
private _apply;
private _callFor;
private _charge;
/**
* Drop the least recently updated calls while there are more than
* `maxCalls`, or while the held segments exceed `maxBytes`; a dropped call
* is still on disk when there is a directory. The newest call is never
* dropped, so a single call larger than the budget stays.
*/
private _evict;
private _fileFor;
/** Replays the directory once; every caller awaits the same load. */
private _load;
private _loadDir;
private _replay;
}