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

70 lines (69 loc) 1.94 kB
/** * LLM-powered Metadata Extractor * * Extracts structured metadata from document chunks using language models. * Supports title, summary, keywords, Q&A pairs, and custom schema extraction. */ import type { Chunk, ExtractParams, ExtractionResult } from "../../types/index.js"; /** * LLM-powered metadata extractor * Extracts title, summary, keywords, Q&A pairs, and custom schema data */ export declare class LLMMetadataExtractor { private provider; private modelName; constructor(options?: { provider?: string; modelName?: string; }); /** * Extract metadata from chunks based on configuration * @param chunks - Array of chunks to extract metadata from * @param params - Extraction parameters * @returns Array of extraction results, one per chunk */ extract(chunks: Chunk[], params: ExtractParams): Promise<ExtractionResult[]>; /** * Group chunks by document ID */ private groupByDocument; /** * Extract title from document chunks */ private extractTitle; /** * Extract summary from a chunk */ private extractSummary; /** * Extract keywords from a chunk */ private extractKeywords; /** * Extract Q&A pairs from a chunk */ private extractQuestions; /** * Extract custom schema data from a chunk */ private extractCustom; /** * Parse Q&A pairs from LLM response */ private parseQAPairs; /** * Call the LLM with a prompt */ private callLLM; } /** * Convenience function to extract metadata from chunks * @param chunks - Chunks to process * @param params - Extraction parameters * @param options - Extractor options * @returns Extraction results */ export declare function extractMetadata(chunks: Chunk[], params: ExtractParams, options?: { provider?: string; modelName?: string; }): Promise<ExtractionResult[]>;