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

49 lines (48 loc) • 2.56 kB
import type { DecisionError, DecisionPreparedMedia, DecisionState, NeurolinkCredentials } from "../types/index.js"; import { SystemOneDecisionProvider } from "./systemOneDecision.js"; /** * XOR Provider — the `decide` inference type only. * * XOR is Juspay's open-weights "System One" decision model, post-trained from * Qwen3.6-35B-A3B: the same typed `noul` / `choice` / `score` questions as * TypeSafe's Jev, on the same wire, in one batched pass. Unlike Jev and Laya it * also reads images and one video. The request loop, retries, auth circuit * breaker and answer parsing are shared with every decision provider in * {@link SystemOneDecisionProvider}. * * @see https://huggingface.co/juspay/xor */ export declare class XorProvider extends SystemOneDecisionProvider { private readonly apiKey; private readonly baseURL; constructor(modelName?: string, sdk?: unknown, _region?: string, credentials?: NeurolinkCredentials["xor"]); 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>; /** * `model` is always sent. A LiteLLM proxy checks team access against the * body's `model`, and refuses a request that names none. `images` is * omitted rather than sent empty, which the server rejects. */ protected buildDecisionBody(state: DecisionState, questions: Record<string, Record<string, unknown>>, model: string, media?: DecisionPreparedMedia): Record<string, unknown>; /** * A 403 is deliberately NOT `authentication`: on a LiteLLM proxy it means the * team's allow-list lacks the model, which an admin can fix at any time, and * `authentication` would trip the per-instance breaker and keep XOR disabled * until restart even after access is granted. A 402 (a budget) is the same * kind of fixable gap. `DecisionErrorKind` has no billing kind, so both map * to `invalid_request`. */ protected parseDecisionError(status: number, payload: unknown, requestId: string | undefined): DecisionError; /** * XOR's server sets `x-request-id` and `x-typesafe-request-id` to one value. * A proxy in front may replace or drop them, so its own call id is the last * resort. */ protected readRequestId(headers: Headers): string | undefined; }