@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
39 lines (38 loc) • 1.6 kB
TypeScript
import type { ProviderErrorLike, EnvVarValidationResult } from "../types/index.js";
/**
* Get the best available provider based on real-time availability checks
* Enhanced version consolidated from providerUtils-fixed.ts
* @param requestedProvider - Optional preferred provider name
* @returns The best provider name to use
*/
export declare function getBestProvider(requestedProvider?: string): Promise<string>;
/**
* Validate environment variable values for a provider
* Addresses GitHub Copilot comment about adding environment variable validation
* @param provider - Provider name to validate
* @returns Validation result with detailed information
*/
export declare function validateProviderEnvVars(provider: string): EnvVarValidationResult;
/**
* Check if a provider has the minimum required environment variables
* NOTE: This only checks if variables exist, not if they're valid
* For validation, use validateProviderEnvVars instead
* @param provider - Provider name to check
* @returns True if the provider has required environment variables
*/
export declare function hasProviderEnvVars(provider: string): boolean;
/**
* Get available provider names
* @returns Array of available provider names
*/
export declare function getAvailableProviders(): string[];
/**
* Validate provider name
* @param provider - Provider name to validate
* @returns True if provider name is valid
*/
export declare function isValidProvider(provider: string): boolean;
/**
* Type guard for provider error
*/
export declare function isProviderError(error: unknown): error is ProviderErrorLike;