UNPKG

@juspay/neurolink

Version:

Universal AI Development Platform with working MCP integration, multi-provider support, voice (TTS/STT/realtime), and professional CLI. 58+ external MCP servers discoverable, multimodal file processing, RAG pipelines. Build, test, and deploy AI applicatio

60 lines (59 loc) 2.47 kB
import type { LanguageModel } from "ai"; import type { AIProviderName } from "../constants/enums.js"; import { BaseProvider } from "../core/baseProvider.js"; import type { NeurolinkCredentials, StreamOptions, StreamResult, ValidationSchema } from "../types/index.js"; /** * Jina AI Provider — embeddings + reranking. * * Native API at api.jina.ai/v1. Chat / streaming / tool calling are not * supported. Use `embed()` / `embedMany()` for embeddings, or call * `rerank()` directly for retrieval reranking (Jina's strength). * * @see https://jina.ai/embeddings/ */ export declare class JinaProvider extends BaseProvider { private readonly apiKey; private readonly baseURL; private readonly proxyFetch; constructor(modelName?: string, sdk?: unknown, _region?: string, credentials?: NeurolinkCredentials["jina"]); protected getProviderName(): AIProviderName; protected getDefaultModel(): string; supportsTools(): boolean; protected getDefaultEmbeddingModel(): string | undefined; protected getAISDKModel(): LanguageModel; protected executeStream(_options: StreamOptions, _analysisSchema?: ValidationSchema): Promise<StreamResult>; protected formatProviderError(error: unknown): Error; embed(text: string, modelName?: string): Promise<number[]>; embedMany(texts: string[], modelName?: string): Promise<number[][]>; /** * Rerank a list of documents against a query. * * Returns the documents sorted by relevance (highest first), with * score and original index preserved so callers can map back. * * Note: not exposed on `BaseProvider` — accessed by casting to * `JinaProvider` or via the dedicated rerank route on the public API * (`POST /api/agent/rerank` in the server module, when added). * * Per-call credentials can be supplied via `options.credentials?.jina`, * overriding the instance-level credentials for this request only. */ rerank(query: string, documents: string[], options?: { model?: string; topN?: number; credentials?: NeurolinkCredentials["jina"]; }): Promise<{ index: number; score: number; document: string; }[]>; private callEmbeddings; validateConfiguration(): Promise<boolean>; getConfiguration(): { provider: AIProviderName; model: string; defaultModel: string; baseURL: string; }; } export default JinaProvider;