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

41 lines (40 loc) • 2.17 kB
import type { DecisionError, DecisionState, NeurolinkCredentials } from "../types/index.js"; import { SystemOneDecisionProvider } from "./systemOneDecision.js"; /** * Laya Provider — the `decide` inference type only. * * Laya is Convai Innovations' open-weights "System One" decision model: the * same typed `noul` / `choice` / `score` questions as TypeSafe's Jev, answered * by an encoder in one forward pass, on the same wire. The request loop, * retries, auth circuit breaker and answer parsing are shared with every * decision provider in {@link SystemOneDecisionProvider}. * * Its encoders read far less than Jev: 1,024 tokens on the `typed-decisions` * and `multilingual` checkpoints, 512 on `english`. The descriptor's * `decisionLimits` refuses what does not fit rather than letting the server * cut the state off silently. * * @see https://github.com/NandhaKishorM/laya */ export declare class LayaProvider extends SystemOneDecisionProvider { private readonly apiKey; private readonly baseURL; constructor(modelName?: string, sdk?: unknown, _region?: string, credentials?: NeurolinkCredentials["laya"]); protected getDefaultModel(): string; protected vendorLabel(): string; protected vendorDisplayName(): string; protected decisionApiKey(): string; protected missingKeyMessage(): string; protected missingConfigMessage(): string | undefined; protected decisionEndpoint(): string; protected decisionHeaders(): Record<string, string>; /** `auto` means "let Laya's router choose", which it does when no model is named. */ protected buildDecisionBody(state: DecisionState, questions: Record<string, Record<string, unknown>>, model: string): Record<string, unknown>; protected parseDecisionError(status: number, payload: unknown, requestId: string | undefined): DecisionError; protected readRequestId(headers: Headers): string | undefined; /** * The checkpoint that actually answered is `routing.model` — the one Laya's * router picked when the request said `auto`. */ protected resolveResponseModel(payload: Record<string, unknown>, requestedModel: string): string; }