@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
47 lines (46 loc) • 2.12 kB
TypeScript
import type { AIProviderName } from "../constants/enums.js";
import { BaseProvider } from "../core/baseProvider.js";
import type { EmbedInput, NeurolinkCredentials, StreamOptions, StreamResult, ValidationSchema } from "../types/index.js";
import type { LanguageModel } from "../types/index.js";
/**
* Voyage AI Provider — embedding-only.
*
* Top-tier RAG embedder. Native API at api.voyageai.com/v1/embeddings.
* Chat / streaming / tool calling are not supported — `executeStream` and
* `getAISDKModel` throw a friendly error so callers get an actionable
* message instead of a runtime crash deep in the streaming layer.
*
* @see https://docs.voyageai.com/docs/embeddings
*/
export declare class VoyageProvider extends BaseProvider {
private readonly apiKey;
private readonly baseURL;
private readonly proxyFetch;
constructor(modelName?: string, sdk?: unknown, _region?: string, credentials?: NeurolinkCredentials["voyage"]);
protected getProviderName(): AIProviderName;
protected getDefaultModel(): string;
supportsTools(): boolean;
protected getDefaultEmbeddingModel(): string | undefined;
/**
* Voyage is embedding-only — chat models do not exist on this endpoint.
* Caller surface stays consistent: returns an `AbortError`-shaped failure
* via `BaseProvider.handleProviderError`, not a TypeScript-level cast.
*/
protected getAISDKModel(): LanguageModel;
protected executeStream(_options: StreamOptions, _analysisSchema?: ValidationSchema): Promise<StreamResult>;
protected formatProviderError(error: unknown): Error;
embed(input: string | EmbedInput, modelName?: string): Promise<number[]>;
embedMany(texts: string[], modelName?: string): Promise<number[][]>;
/**
* POST /embeddings — Voyage accepts up to 128 inputs per request.
* Caller batches above that (see `embedMany`).
*/
private callEmbeddings;
validateConfiguration(): Promise<boolean>;
getConfiguration(): {
provider: AIProviderName;
model: string;
defaultModel: string;
baseURL: string;
};
}