@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
38 lines (37 loc) • 1.73 kB
TypeScript
import type { AIProviderName } from "../constants/enums.js";
import { BaseProvider } from "../core/baseProvider.js";
import type { EnhancedGenerateResult, NeurolinkCredentials, StreamOptions, StreamResult, TextGenerationOptions, ValidationSchema } from "../types/index.js";
import type { LanguageModel } from "../types/index.js";
/**
* Stability AI Provider — direct image generation.
*
* Hits api.stability.ai/v2beta/stable-image/generate/{model}. Returns
* base64 PNG. No chat / streaming / tool calling.
*
* The constructor no longer throws when `STABILITY_API_KEY` is absent so
* that per-call credentials (passed via `options.credentials.stability`) can
* be used without requiring a global env var at startup.
*
* @see https://platform.stability.ai/docs/api-reference
*/
export declare class StabilityProvider extends BaseProvider {
private readonly apiKey;
private readonly baseURL;
private readonly proxyFetch;
constructor(modelName?: string, sdk?: unknown, _region?: string, credentials?: NeurolinkCredentials["stability"]);
protected getProviderName(): AIProviderName;
protected getDefaultModel(): string;
supportsTools(): boolean;
protected getAISDKModel(): LanguageModel;
protected executeStream(_options: StreamOptions, _analysisSchema?: ValidationSchema): Promise<StreamResult>;
protected formatProviderError(error: unknown): Error;
protected executeImageGeneration(options: TextGenerationOptions): Promise<EnhancedGenerateResult>;
validateConfiguration(): Promise<boolean>;
getConfiguration(): {
provider: AIProviderName;
model: string;
defaultModel: string;
baseURL: string;
};
}
export default StabilityProvider;