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

24 lines (23 loc) • 1.01 kB
/** Bind a session to the account that just served it, refreshing its idle clock. */ export declare function bind(sessionId: string, accountKey: string, now: number): void; /** * The account a session is bound to, or undefined if unbound or idle-expired. * A read never refreshes the binding — only a served request (bind) does, * since the idle TTL counts from the session's last served request. */ export declare function get(sessionId: string, now: number, idleTtlMs: number): string | undefined; export declare function clear(): void; export declare function size(): number; /** * Sessions whose binding has not idle-expired. Expired entries are dropped * here as on read, since otherwise they would linger until the cap evicted * them. */ export declare function countActive(now: number, idleTtlMs: number): number; export declare const sessionAffinity: Readonly<{ bind: typeof bind; get: typeof get; clear: typeof clear; size: typeof size; countActive: typeof countActive; }>;