@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.48 kB
JavaScript
import { buildCatalogEntries } from "./catalog/loader.js";
/**
* Config-driven catalog of the OpenAI-compatible providers whose only
* differences from each other are expressible as named, closed catalog
* quirks (messageContentFormat, timeoutErrorClass, responseFormatDowngrade)
* rather than real code. Each entry fully replaces what used to be a
* hand-written OpenAIChatCompletionsProvider subclass — see
* ConfiguredOpenAICompatProvider for the class that reads these entries,
* and providerRegistry.ts for the registration loop that consumes this
* array.
*
* The entries themselves are derived from the JSON catalog
* (src/lib/providers/catalog/<id>.json) via buildCatalogEntries() — that
* JSON is now the single source of truth for these providers' identity,
* models, error rules and wire config. See
* src/lib/providers/catalog/loader.ts for the derivation logic and
* docs/superpowers/plans/2026-08-28-provider-json-catalog-spec.md for the
* authoring format.
*
* To add a new OpenAI-compatible provider: add one JSON file under
* src/lib/providers/catalog/ (see provider-catalog.schema.json) and run
* `pnpm run codegen:catalog`. Do NOT add a provider here if it needs a real
* hook override beyond the 3 mandatory ones
* (getProviderName/getDefaultModel/formatProviderError) and the named
* catalog quirks above — write a dedicated subclass instead (see
* azureOpenai.ts).
*/
export const OPENAI_COMPAT_CATALOG = buildCatalogEntries();