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

52 lines (51 loc) • 3.11 kB
import type { ProviderFieldRejection } from "../../types/index.js"; /** The base URL a provider uses when none is configured. */ export declare function getDefaultBaseURL(id: string): string; /** The header(s) carrying the API key, in the provider's scheme. */ export declare function authHeaders(id: string, key: string): Record<string, string>; /** Headers sent as null so an SDK's default is dropped. */ export declare function authClearHeaders(id: string): Record<string, null>; /** The Vertex AI REST host for a location. */ export declare function vertexHost(location: string): string; /** Models the health report lists for a provider ([] when none). */ export declare function getHealthCheckModels(provider: string): string[]; /** How long a discovered value is reused, by `provider.what`. */ export declare function getCacheDurationMs(key: string): number; /** The most cache_control markers Anthropic accepts in one request. */ export declare function getAnthropicMaxCacheBreakpoints(): number; /** Tool-capable model substrings used when discovery failed. */ export declare function getToolSupportFallback(provider: string): string[]; /** Vertex location env var names and the global location. */ export declare function getVertexLocationRules(): { globalEnv: string; imageEnv: string; global: string; }; /** Vertex models that mishandle maxTokens, when the model config has none. */ export declare function getVertexMaxTokensIssues(): string[]; /** How many images one call asks for: 1, or the request clamped to 1..maxN. */ export declare function imageCount(provider: string, model: string, requested: number): number; /** The size parameter for an aspect ratio on an image model. */ export declare function imageSize(provider: string, model: string, aspectRatio: string | undefined): string; /** The image URL path for a model; the id itself when nothing matches. */ export declare function imagePath(provider: string, model: string): string; /** Which embedding body kind a model takes. */ export declare function embeddingKind(provider: string, model: string): { novaMultimodal: boolean; multimodal: boolean; }; /** Context-overflow error patterns by provider, in checking order. */ export declare function getContextOverflowPatterns(): Array<{ provider: string; patterns: RegExp[]; }>; /** Tokens kept free when refitting max_tokens to a context window. */ export declare function getContextOverflowRefitMargin(): number; /** The structured-output recovery a provider scope applies to an error, if any. */ export declare function recoverAction(scope: string, error: unknown): "schemaInSystemPrompt" | "schemalessJson" | undefined; /** The fields a provider strips and retries after a rejecting 400. */ export declare function getFieldRejection(provider: string): ProviderFieldRejection; /** The Bedrock geography prefix for an AWS region, if one covers it. */ export declare function bedrockGeoPrefix(region: string): string | undefined; /** The worldwide Bedrock inference-profile prefix, tried last. */ export declare function bedrockFallbackPrefix(): string;