@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
53 lines (52 loc) • 2.15 kB
TypeScript
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";
/**
* Cohere Provider
*
* Routes Command R / Command R+ chat completions through Cohere's OpenAI-
* compatible endpoint. Embed v3 and Rerank v3 are top-tier for RAG but are
* accessed via the Cohere native SDK / dedicated embedding routes (out of
* scope for the LLM provider).
*
* @see https://docs.cohere.com/docs/compatibility-api
*/
export declare class CohereProvider extends BaseProvider {
private model;
private apiKey;
private baseURL;
constructor(modelName?: string, sdk?: unknown, _region?: string, credentials?: NeurolinkCredentials["cohere"]);
protected executeStream(options: StreamOptions, _analysisSchema?: ValidationSchema): Promise<StreamResult>;
private executeStreamInner;
protected getProviderName(): AIProviderName;
protected getDefaultModel(): string;
protected getAISDKModel(): LanguageModel;
protected formatProviderError(error: unknown): Error;
validateConfiguration(): Promise<boolean>;
getConfiguration(): {
provider: AIProviderName;
model: string;
defaultModel: string;
baseURL: string;
};
/**
* Default embedding model for Cohere.
*/
protected getDefaultEmbeddingModel(): string;
/**
* Generate an embedding for a single text via Cohere's native /v2/embed
* endpoint. Returns the float[] embedding vector.
*
* The shared OpenAI-compatible /compatibility/v1 path is chat-only; embed
* lives on the native API (POST /v2/embed). Documented at
* https://docs.cohere.com/reference/embed.
*/
embed(text: string, modelName?: string): Promise<number[]>;
/**
* Batch embedding via Cohere's native /v2/embed endpoint. Cohere caps at
* 96 inputs per request; larger batches are chunked.
*/
embedMany(texts: string[], modelName?: string): Promise<number[][]>;
}
export default CohereProvider;