@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
17 lines (16 loc) • 948 B
TypeScript
import type { ProviderErrorRule } from "../types/index.js";
/**
* Shared error-rule builder for local-runtime OpenAI-compatible providers —
* Ollama, LM Studio, llama.cpp. All three had byte-identical connection-
* refused predicates (including the duck-typed `code`/`cause.code`
* extraction, since none of that lives on ProviderErrorContext) before this
* factored it out. A plain function, not a shared base class: the
* `neurolink/provider-base-class` lint rule requires every provider to
* extend BaseProvider or OpenAIChatCompletionsProvider directly, so the
* three keep their existing class hierarchy and just call this from their
* own `formatProviderError()`.
*
* `message` stays per-vendor (each provider's own exact wording, unchanged)
* — only the match predicate and errorClass were ever duplicated.
*/
export declare function buildLocalUnreachableErrorRule(error: unknown, message: () => string): ProviderErrorRule;