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

35 lines (34 loc) 1.75 kB
/** * Message Builder Utility * Centralized logic for building message arrays from TextGenerationOptions * Enhanced with multimodal support for images */ import type { ModelMessage } from "ai"; import type { GenerateOptions, MultimodalChatMessage, StreamOptions, TextGenerationOptions } from "../types/index.js"; /** * Type-safe conversion from MultimodalChatMessage[] to ModelMessage[] * Filters out invalid content and ensures strict ModelMessage contract compliance */ export declare function convertToModelMessages(messages: MultimodalChatMessage[]): ModelMessage[]; /** * Build a properly formatted message array for AI providers * Combines system prompt, conversation history, and current user prompt * Supports both TextGenerationOptions and StreamOptions * Enhanced with CSV file processing support */ export declare function buildMessagesArray(options: TextGenerationOptions | StreamOptions): Promise<ModelMessage[]>; /** * Process the unified files array with auto-detection. * Handles lazy file registration, full processing, and preview injection. * * Exported so providers that bypass BaseProvider.generate() (e.g. * GoogleVertex's native @google/genai path) can still preprocess * `input.files` — without this, mimetype-hint and text-file inputs * would silently never reach the model on those paths. */ export declare function processUnifiedFilesArray(options: GenerateOptions, maxSize: number, provider: string): Promise<void>; /** * Build multimodal message array with image support * Detects when images are present and routes through provider adapter */ export declare function buildMultimodalMessagesArray(options: GenerateOptions, provider: string, model: string): Promise<MultimodalChatMessage[]>;