@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
18 lines (17 loc) • 1.17 kB
TypeScript
import type { CompileErrorRulesOptions, ProviderErrorContext, ProviderErrorRule, ProviderRuleErrorJson, ProviderRuleErrors, ProviderRuleTemplateVars } from "../../types/index.js";
/**
* Replaces `{name}` placeholders; unknown names are left as written. A value
* the provider supplies wins over the built-in one, so a provider can keep
* its exact wording (for example `{model}` printed as `undefined`).
*/
export declare function fillErrorTemplate(template: string, ctx: ProviderErrorContext, vars: ProviderRuleTemplateVars): string;
/**
* Compiles JSON rules, in order. The caller appends the shared defaults
* (`DEFAULT_ERROR_RULES`) when the provider used them before.
*/
export declare function compileErrorRules(rules: readonly ProviderRuleErrorJson[], options?: CompileErrorRulesOptions): ProviderErrorRule[];
/**
* Classifies an error with a provider's `errors` block: its timeout override,
* its rules in order, then the shared defaults unless it opts out.
*/
export declare function classifyWithProviderRules(error: unknown, errors: ProviderRuleErrors, provider: string, modelName: string | undefined, options?: CompileErrorRulesOptions): Error;