@retrivora-ai/rag-engine 2.5.6 → 2.5.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ILLMProvider-DwFj0h2u.d.mts → ILLMProvider-B2N3lMBc.d.mts} +10 -1
- package/dist/{ILLMProvider-DwFj0h2u.d.ts → ILLMProvider-B2N3lMBc.d.ts} +10 -1
- package/dist/handlers/index.d.mts +2 -2
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.js +961 -192
- package/dist/handlers/index.mjs +961 -192
- package/dist/{index-Cb0GsT16.d.ts → index-37V810a-.d.mts} +3 -3
- package/dist/{index-D1jN8KSF.d.mts → index-BxzDv2jd.d.ts} +3 -3
- package/dist/{index-Byv5MaYi.d.mts → index-CAGGPyI7.d.mts} +22 -2
- package/dist/{index-DP3_OpuB.d.ts → index-DdQxoIpu.d.ts} +22 -2
- package/dist/index.css +188 -4
- package/dist/index.d.mts +178 -20
- package/dist/index.d.ts +178 -20
- package/dist/index.js +735 -195
- package/dist/index.min.css +1 -1
- package/dist/index.mjs +731 -193
- package/dist/server.d.mts +100 -9
- package/dist/server.d.ts +100 -9
- package/dist/server.js +963 -192
- package/dist/server.mjs +962 -192
- package/package.json +6 -3
package/dist/server.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as RagConfig, v as UniversalRagConfig, V as VectorDBConfig, w as UpsertDocument, y as VectorMatch, G as GraphDBConfig, H as GraphNode, J as Edge, K as GraphSearchResult, L as LLMConfig, f as EmbeddingConfig, I as ILLMProvider, x as VectorDBProvider, i as LLMProvider, g as EmbeddingProvider, R as RAGConfig, u as UIConfig,
|
|
2
|
-
export { A as AuthMode, M as BarChartData, N as CarouselProduct, Q as IRetriever, j as LatencyBreakdown, S as LineChartDataPoint, X as MessageRole, Y as MetricCardData, O as ObservabilityTrace, Z as PieChartData, P as Product, k as ProjectAiSettings, l as ProjectAuthSettings, m as ProjectBrandingSettings, c as ProjectChatSettings, n as ProjectTelemetrySettings, o as ProjectWidgetSettings, q as RagMessage, r as RetrievalConfig, _ as RetrievalResult, s as RetrievedChunk, $ as RetrivoraChunkMetadata, a0 as RetrivoraIngestedDocument, a1 as ScatterPlotDataPoint, a2 as SuggestionsResponse, a3 as TableData, T as ThemeMode, t as TokenUsage, a as UseRagChatOptions, b as UseRagChatReturn, a4 as VisualizationType, W as WidgetPosition, z as WorkflowConfig, B as createDefaultProjectSettings, D as normalizeProjectSettings, F as projectSettingsToUiConfig } from './ILLMProvider-
|
|
3
|
-
import { o as DecisionContext, q as IntentCategory, I as IRenderRule, G as RenderDecision, p as IRendererStrategy } from './index-
|
|
4
|
-
export { V as ArchitectureCardProps, A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, e as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, i as Chunk, j as ChunkOptions, c as ClientConfig, m as ConfigFetcher, b as ConfigProviderProps, n as ConfigurationException, W as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, X as LicenseConfigResolver, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, M as MessageBubbleProps, Y as Pipeline, Z as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, v as ProviderCredentials, w as ProviderNotFoundException, _ as ProviderPill, x as RateLimitException, R as RemoteConfig, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, $ as RenderSectionDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, a0 as Snippet, S as SourceCardProps, a1 as wrapError } from './index-
|
|
5
|
-
import { I as IProviderValidator, a as IProviderHealthChecker, H as HealthCheckResult } from './index-
|
|
6
|
-
export { C as ConfigValidator, b as HandlerOptions, V as ValidationError, c as VectorPlugin, d as createChatHandler, e as createFeedbackHandler, f as createHealthHandler, g as createHistoryHandler, h as createIngestHandler, i as createRagHandler, j as createSessionsHandler, k as createStreamHandler, l as createUploadHandler, s as sseErrorFrame, m as sseFrame, n as sseMetaFrame, o as sseTextFrame } from './index-
|
|
1
|
+
import { p as RagConfig, v as UniversalRagConfig, V as VectorDBConfig, w as UpsertDocument, y as VectorMatch, G as GraphDBConfig, H as GraphNode, J as Edge, K as GraphSearchResult, L as LLMConfig, f as EmbeddingConfig, I as ILLMProvider, x as VectorDBProvider, i as LLMProvider, g as EmbeddingProvider, R as RAGConfig, u as UIConfig, C as ChatMessage, U as UITransformationResponse, d as ChatOptions, E as EmbedOptions, h as IngestDocument, e as ChatResponse } from './ILLMProvider-B2N3lMBc.mjs';
|
|
2
|
+
export { A as AuthMode, M as BarChartData, N as CarouselProduct, Q as IRetriever, j as LatencyBreakdown, S as LineChartDataPoint, X as MessageRole, Y as MetricCardData, O as ObservabilityTrace, Z as PieChartData, P as Product, k as ProjectAiSettings, l as ProjectAuthSettings, m as ProjectBrandingSettings, c as ProjectChatSettings, n as ProjectTelemetrySettings, o as ProjectWidgetSettings, q as RagMessage, r as RetrievalConfig, _ as RetrievalResult, s as RetrievedChunk, $ as RetrivoraChunkMetadata, a0 as RetrivoraIngestedDocument, a1 as ScatterPlotDataPoint, a2 as SuggestionsResponse, a3 as TableData, T as ThemeMode, t as TokenUsage, a as UseRagChatOptions, b as UseRagChatReturn, a4 as VisualizationType, W as WidgetPosition, z as WorkflowConfig, B as createDefaultProjectSettings, D as normalizeProjectSettings, F as projectSettingsToUiConfig } from './ILLMProvider-B2N3lMBc.mjs';
|
|
3
|
+
import { o as DecisionContext, q as IntentCategory, I as IRenderRule, G as RenderDecision, p as IRendererStrategy } from './index-CAGGPyI7.mjs';
|
|
4
|
+
export { V as ArchitectureCardProps, A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, e as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, i as Chunk, j as ChunkOptions, c as ClientConfig, m as ConfigFetcher, b as ConfigProviderProps, n as ConfigurationException, W as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, X as LicenseConfigResolver, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, M as MessageBubbleProps, Y as Pipeline, Z as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, v as ProviderCredentials, w as ProviderNotFoundException, _ as ProviderPill, x as RateLimitException, R as RemoteConfig, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, $ as RenderSectionDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, a0 as Snippet, S as SourceCardProps, a1 as wrapError } from './index-CAGGPyI7.mjs';
|
|
5
|
+
import { I as IProviderValidator, a as IProviderHealthChecker, H as HealthCheckResult } from './index-37V810a-.mjs';
|
|
6
|
+
export { C as ConfigValidator, b as HandlerOptions, V as ValidationError, c as VectorPlugin, d as createChatHandler, e as createFeedbackHandler, f as createHealthHandler, g as createHistoryHandler, h as createIngestHandler, i as createRagHandler, j as createSessionsHandler, k as createStreamHandler, l as createUploadHandler, s as sseErrorFrame, m as sseFrame, n as sseMetaFrame, o as sseTextFrame } from './index-37V810a-.mjs';
|
|
7
7
|
import 'react';
|
|
8
8
|
import 'next/server';
|
|
9
9
|
|
|
@@ -533,16 +533,107 @@ declare const VECTOR_PROFILES: {
|
|
|
533
533
|
|
|
534
534
|
/**
|
|
535
535
|
* DocumentParser — handles text extraction from various file formats.
|
|
536
|
-
* Supported:
|
|
536
|
+
* Supported:
|
|
537
|
+
* - PowerPoint: .pptx, .ppt, .odp
|
|
538
|
+
* - Word: .docx, .doc, .odt, .rtf
|
|
539
|
+
* - Excel: .xlsx, .xls, .ods, .csv, .tsv
|
|
540
|
+
* - PDF: .pdf
|
|
541
|
+
* - Text & Code: .txt, .md, .json, .yaml, .yml, .xml, .html, .htm, .log, .epub
|
|
537
542
|
*/
|
|
538
543
|
declare class DocumentParser {
|
|
544
|
+
/**
|
|
545
|
+
* Fast Magic-Bytes sniffer for instant file format identification (<1ms).
|
|
546
|
+
*/
|
|
547
|
+
static sniffMagicBytes(buffer: Buffer): 'pdf' | 'zip' | 'ole2' | 'json' | 'text' | null;
|
|
548
|
+
/**
|
|
549
|
+
* Convert spreadsheet sheets into high-fidelity, context-preserved tabular text.
|
|
550
|
+
* Every row retains its column and section context so vector embeddings achieve 100% semantic retrieval precision.
|
|
551
|
+
*/
|
|
552
|
+
private static formatSheetToContextualText;
|
|
539
553
|
/**
|
|
540
554
|
* Extract text from a File or Buffer based on its type.
|
|
541
555
|
*/
|
|
542
|
-
static parse(file: File | Buffer, fileName: string, mimeType
|
|
556
|
+
static parse(file: File | Buffer, fileName: string, mimeType?: string): Promise<string>;
|
|
557
|
+
/**
|
|
558
|
+
* Helper to strip XML tags and normalize inner text content.
|
|
559
|
+
*/
|
|
560
|
+
private static stripXmlTags;
|
|
561
|
+
/**
|
|
562
|
+
* Helper to strip HTML / XML tags while removing script and style blocks completely.
|
|
563
|
+
*/
|
|
564
|
+
private static stripHtmlAndXml;
|
|
565
|
+
/**
|
|
566
|
+
* Safe text extraction from non-OpenXML / legacy Excel spreadsheets (.xls, BIFF8, HTML tables, XML Spreadsheet 2003).
|
|
567
|
+
*/
|
|
568
|
+
private static parseLegacyExcelOrFallback;
|
|
569
|
+
/**
|
|
570
|
+
* Dynamically infer document domain and schema from extracted text, filename, and format.
|
|
571
|
+
*/
|
|
572
|
+
static inferDocumentDomainAndSchema(text: string, fileName?: string, mimeType?: string): {
|
|
573
|
+
domain: 'finance' | 'ecommerce' | 'timeseries' | 'legal' | 'healthcare' | 'tabular' | 'general';
|
|
574
|
+
schema?: Record<string, string>;
|
|
575
|
+
isCatalog: boolean;
|
|
576
|
+
isFinancial: boolean;
|
|
577
|
+
};
|
|
543
578
|
private static readAsText;
|
|
544
579
|
}
|
|
545
580
|
|
|
581
|
+
/**
|
|
582
|
+
* PromptOptimizer — Intelligent query normalizer and prompt enhancement engine.
|
|
583
|
+
*
|
|
584
|
+
* Solves user prompt failures where the model or vector retrieval is unable to
|
|
585
|
+
* process poorly phrased, ambiguous, typo-ridden, pronoun-heavy, or underspecified queries.
|
|
586
|
+
*
|
|
587
|
+
* Responsibilities:
|
|
588
|
+
* 1. Syntax & Text Normalization: Strips non-printable artifacts, fixes unclosed delimiters, normalizes colloquial abbreviations.
|
|
589
|
+
* 2. Pronoun & Coreference Resolution: Resolves pronouns ('it', 'they', 'this', 'that') against conversation history.
|
|
590
|
+
* 3. Short & Underspecified Query Expansion: Expands one-word/vague queries into clear semantic questions for high-recall RAG.
|
|
591
|
+
* 4. LLM-Assisted Query Enhancement: Optional deep reformulation using the fast router LLM for multi-turn RAG reasoning.
|
|
592
|
+
*/
|
|
593
|
+
|
|
594
|
+
interface PromptOptimizationOptions {
|
|
595
|
+
/** Whether to resolve pronouns and context from conversation history */
|
|
596
|
+
resolveHistory?: boolean;
|
|
597
|
+
/** Whether to expand short/underspecified keywords into complete questions */
|
|
598
|
+
expandKeywords?: boolean;
|
|
599
|
+
/** Optional LLM provider for deep reformulation on complex queries */
|
|
600
|
+
llmProvider?: ILLMProvider;
|
|
601
|
+
}
|
|
602
|
+
interface OptimizedPromptResult {
|
|
603
|
+
/** The final optimized prompt to send to the RAG retrieval and LLM synthesis */
|
|
604
|
+
optimizedPrompt: string;
|
|
605
|
+
/** The original raw user prompt */
|
|
606
|
+
originalPrompt: string;
|
|
607
|
+
/** Whether the prompt was modified during optimization */
|
|
608
|
+
wasModified: boolean;
|
|
609
|
+
/** List of optimization operations performed */
|
|
610
|
+
transformations: string[];
|
|
611
|
+
}
|
|
612
|
+
declare class PromptOptimizer {
|
|
613
|
+
private static readonly COMMON_ABBREVIATIONS;
|
|
614
|
+
private static readonly TOPIC_EXPANSIONS;
|
|
615
|
+
/**
|
|
616
|
+
* Optimizes a user prompt synchronously using fast heuristic rules and history resolution.
|
|
617
|
+
*/
|
|
618
|
+
static optimize(rawPrompt: string, history?: ChatMessage[], options?: PromptOptimizationOptions): OptimizedPromptResult;
|
|
619
|
+
/**
|
|
620
|
+
* Cleans text artifacts, fixes unclosed quotes/parentheses, and collapses whitespace.
|
|
621
|
+
*/
|
|
622
|
+
private static cleanText;
|
|
623
|
+
/**
|
|
624
|
+
* Replaces shorthand chat abbreviations with clear natural language.
|
|
625
|
+
*/
|
|
626
|
+
private static expandAbbreviations;
|
|
627
|
+
/**
|
|
628
|
+
* Resolves ambiguous pronouns ('it', 'this', 'they', 'the last one') against recent chat history.
|
|
629
|
+
*/
|
|
630
|
+
private static resolveCoreferences;
|
|
631
|
+
/**
|
|
632
|
+
* Deep LLM-powered prompt optimizer for complex, multi-hop, or highly ambiguous user queries.
|
|
633
|
+
*/
|
|
634
|
+
static optimizeWithLLM(rawPrompt: string, history?: ChatMessage[], llmProvider?: ILLMProvider): Promise<OptimizedPromptResult>;
|
|
635
|
+
}
|
|
636
|
+
|
|
546
637
|
interface DataSignals {
|
|
547
638
|
rowCount: number;
|
|
548
639
|
hasNumericFields: boolean;
|
|
@@ -1421,4 +1512,4 @@ declare function initializeTelemetryService(projectId: string, licenseKey: strin
|
|
|
1421
1512
|
*/
|
|
1422
1513
|
declare function shutdownTelemetryService(): Promise<void>;
|
|
1423
1514
|
|
|
1424
|
-
export { AnthropicProvider, BaseVectorProvider, CarouselRendererStrategy, ChartRendererStrategy, ChatMessage, ChatOptions, ChatResponse, ChromaDBProvider, ConfigBuilder, ConfigResolver, type CustomEmbeddingOptions, CustomEmbeddingProvider, DecisionContext, DocumentParser, Edge, EmbedOptions, EmbeddingConfig, EmbeddingProvider, EmbeddingStrategy, EmbeddingStrategyResolver, EventType, GraphNode, GraphSearchResult, GroqProvider, HealthCheckResult, ILLMProvider, IProviderHealthChecker, IProviderValidator, IRenderRule, IRendererStrategy, IngestDocument, IntentCategory, IntentClassifier, LLMConfig, LLMFactory, LLMProvider, LLM_PROFILES, type LicensePayload, LicenseVerifier, LicensedRetrivora, type LicensedRetrivoraOptions, MilvusProvider, MixedRendererStrategy, MongoDBProvider, MultiTablePostgresProvider, OllamaProvider, OpenAIProvider, PRESETS, PineconeProvider, PostgreSQLProvider, ProviderHealthCheck, ProviderRegistry, QdrantProvider, QwenProvider, RAGConfig, RagConfig, RedisProvider, RenderDecision, RendererRegistry, Rule1SpecificInfoRule, Rule2ComparisonRule, Rule3ProductDiscoveryRule, Rule4AnalyticalRule, Rule5MixedResponseRule, Rule6SmallResultSetRule, Rule7LargeTableRule, RuleEngine, type RuntimeTierConfig, TableRendererStrategy, type TelemetryEvent, TelemetryService, TextRendererStrategy, UIConfig, UITransformationResponse, UniversalLLMAdapter, UniversalRagConfig, UniversalVectorProvider, UpsertDocument, VECTOR_PROFILES, VectorDBConfig, VectorDBProvider, VectorMatch, VisualizationDecisionEngine, WeaviateProvider, createFromPreset, createRetrivora, decideVisualization, getRagConfig, getRuntimeConfig, getTelemetryService, initializeTelemetryService, injectRuntimeConfig, shutdownTelemetryService };
|
|
1515
|
+
export { AnthropicProvider, BaseVectorProvider, CarouselRendererStrategy, ChartRendererStrategy, ChatMessage, ChatOptions, ChatResponse, ChromaDBProvider, ConfigBuilder, ConfigResolver, type CustomEmbeddingOptions, CustomEmbeddingProvider, DecisionContext, DocumentParser, Edge, EmbedOptions, EmbeddingConfig, EmbeddingProvider, EmbeddingStrategy, EmbeddingStrategyResolver, EventType, GraphNode, GraphSearchResult, GroqProvider, HealthCheckResult, ILLMProvider, IProviderHealthChecker, IProviderValidator, IRenderRule, IRendererStrategy, IngestDocument, IntentCategory, IntentClassifier, LLMConfig, LLMFactory, LLMProvider, LLM_PROFILES, type LicensePayload, LicenseVerifier, LicensedRetrivora, type LicensedRetrivoraOptions, MilvusProvider, MixedRendererStrategy, MongoDBProvider, MultiTablePostgresProvider, OllamaProvider, OpenAIProvider, type OptimizedPromptResult, PRESETS, PineconeProvider, PostgreSQLProvider, type PromptOptimizationOptions, PromptOptimizer, ProviderHealthCheck, ProviderRegistry, QdrantProvider, QwenProvider, RAGConfig, RagConfig, RedisProvider, RenderDecision, RendererRegistry, Rule1SpecificInfoRule, Rule2ComparisonRule, Rule3ProductDiscoveryRule, Rule4AnalyticalRule, Rule5MixedResponseRule, Rule6SmallResultSetRule, Rule7LargeTableRule, RuleEngine, type RuntimeTierConfig, TableRendererStrategy, type TelemetryEvent, TelemetryService, TextRendererStrategy, UIConfig, UITransformationResponse, UniversalLLMAdapter, UniversalRagConfig, UniversalVectorProvider, UpsertDocument, VECTOR_PROFILES, VectorDBConfig, VectorDBProvider, VectorMatch, VisualizationDecisionEngine, WeaviateProvider, createFromPreset, createRetrivora, decideVisualization, getRagConfig, getRuntimeConfig, getTelemetryService, initializeTelemetryService, injectRuntimeConfig, shutdownTelemetryService };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { p as RagConfig, v as UniversalRagConfig, V as VectorDBConfig, w as UpsertDocument, y as VectorMatch, G as GraphDBConfig, H as GraphNode, J as Edge, K as GraphSearchResult, L as LLMConfig, f as EmbeddingConfig, I as ILLMProvider, x as VectorDBProvider, i as LLMProvider, g as EmbeddingProvider, R as RAGConfig, u as UIConfig,
|
|
2
|
-
export { A as AuthMode, M as BarChartData, N as CarouselProduct, Q as IRetriever, j as LatencyBreakdown, S as LineChartDataPoint, X as MessageRole, Y as MetricCardData, O as ObservabilityTrace, Z as PieChartData, P as Product, k as ProjectAiSettings, l as ProjectAuthSettings, m as ProjectBrandingSettings, c as ProjectChatSettings, n as ProjectTelemetrySettings, o as ProjectWidgetSettings, q as RagMessage, r as RetrievalConfig, _ as RetrievalResult, s as RetrievedChunk, $ as RetrivoraChunkMetadata, a0 as RetrivoraIngestedDocument, a1 as ScatterPlotDataPoint, a2 as SuggestionsResponse, a3 as TableData, T as ThemeMode, t as TokenUsage, a as UseRagChatOptions, b as UseRagChatReturn, a4 as VisualizationType, W as WidgetPosition, z as WorkflowConfig, B as createDefaultProjectSettings, D as normalizeProjectSettings, F as projectSettingsToUiConfig } from './ILLMProvider-
|
|
3
|
-
import { o as DecisionContext, q as IntentCategory, I as IRenderRule, G as RenderDecision, p as IRendererStrategy } from './index-
|
|
4
|
-
export { V as ArchitectureCardProps, A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, e as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, i as Chunk, j as ChunkOptions, c as ClientConfig, m as ConfigFetcher, b as ConfigProviderProps, n as ConfigurationException, W as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, X as LicenseConfigResolver, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, M as MessageBubbleProps, Y as Pipeline, Z as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, v as ProviderCredentials, w as ProviderNotFoundException, _ as ProviderPill, x as RateLimitException, R as RemoteConfig, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, $ as RenderSectionDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, a0 as Snippet, S as SourceCardProps, a1 as wrapError } from './index-
|
|
5
|
-
import { I as IProviderValidator, a as IProviderHealthChecker, H as HealthCheckResult } from './index-
|
|
6
|
-
export { C as ConfigValidator, b as HandlerOptions, V as ValidationError, c as VectorPlugin, d as createChatHandler, e as createFeedbackHandler, f as createHealthHandler, g as createHistoryHandler, h as createIngestHandler, i as createRagHandler, j as createSessionsHandler, k as createStreamHandler, l as createUploadHandler, s as sseErrorFrame, m as sseFrame, n as sseMetaFrame, o as sseTextFrame } from './index-
|
|
1
|
+
import { p as RagConfig, v as UniversalRagConfig, V as VectorDBConfig, w as UpsertDocument, y as VectorMatch, G as GraphDBConfig, H as GraphNode, J as Edge, K as GraphSearchResult, L as LLMConfig, f as EmbeddingConfig, I as ILLMProvider, x as VectorDBProvider, i as LLMProvider, g as EmbeddingProvider, R as RAGConfig, u as UIConfig, C as ChatMessage, U as UITransformationResponse, d as ChatOptions, E as EmbedOptions, h as IngestDocument, e as ChatResponse } from './ILLMProvider-B2N3lMBc.js';
|
|
2
|
+
export { A as AuthMode, M as BarChartData, N as CarouselProduct, Q as IRetriever, j as LatencyBreakdown, S as LineChartDataPoint, X as MessageRole, Y as MetricCardData, O as ObservabilityTrace, Z as PieChartData, P as Product, k as ProjectAiSettings, l as ProjectAuthSettings, m as ProjectBrandingSettings, c as ProjectChatSettings, n as ProjectTelemetrySettings, o as ProjectWidgetSettings, q as RagMessage, r as RetrievalConfig, _ as RetrievalResult, s as RetrievedChunk, $ as RetrivoraChunkMetadata, a0 as RetrivoraIngestedDocument, a1 as ScatterPlotDataPoint, a2 as SuggestionsResponse, a3 as TableData, T as ThemeMode, t as TokenUsage, a as UseRagChatOptions, b as UseRagChatReturn, a4 as VisualizationType, W as WidgetPosition, z as WorkflowConfig, B as createDefaultProjectSettings, D as normalizeProjectSettings, F as projectSettingsToUiConfig } from './ILLMProvider-B2N3lMBc.js';
|
|
3
|
+
import { o as DecisionContext, q as IntentCategory, I as IRenderRule, G as RenderDecision, p as IRendererStrategy } from './index-DdQxoIpu.js';
|
|
4
|
+
export { V as ArchitectureCardProps, A as AuthenticationException, B as BatchOptions, f as BatchProcessor, g as BatchResult, h as ChartType, e as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, i as Chunk, j as ChunkOptions, c as ClientConfig, m as ConfigFetcher, b as ConfigProviderProps, n as ConfigurationException, W as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, X as LicenseConfigResolver, L as LicenseTierConfig, r as LicenseValidationError, s as LicenseValidationRequest, t as LicenseValidationResponse, u as LicenseValidator, M as MessageBubbleProps, Y as Pipeline, Z as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, v as ProviderCredentials, w as ProviderNotFoundException, _ as ProviderPill, x as RateLimitException, R as RemoteConfig, y as RemoteEmbeddingConfig, z as RemoteLLMConfig, F as RemoteVectorConfig, $ as RenderSectionDecision, H as RenderType, J as RetrievalException, K as Retrivora, N as RetrivoraError, O as RetrivoraErrorCode, Q as SDKVersionUnsupportedError, T as SDK_VERSION, a0 as Snippet, S as SourceCardProps, a1 as wrapError } from './index-DdQxoIpu.js';
|
|
5
|
+
import { I as IProviderValidator, a as IProviderHealthChecker, H as HealthCheckResult } from './index-BxzDv2jd.js';
|
|
6
|
+
export { C as ConfigValidator, b as HandlerOptions, V as ValidationError, c as VectorPlugin, d as createChatHandler, e as createFeedbackHandler, f as createHealthHandler, g as createHistoryHandler, h as createIngestHandler, i as createRagHandler, j as createSessionsHandler, k as createStreamHandler, l as createUploadHandler, s as sseErrorFrame, m as sseFrame, n as sseMetaFrame, o as sseTextFrame } from './index-BxzDv2jd.js';
|
|
7
7
|
import 'react';
|
|
8
8
|
import 'next/server';
|
|
9
9
|
|
|
@@ -533,16 +533,107 @@ declare const VECTOR_PROFILES: {
|
|
|
533
533
|
|
|
534
534
|
/**
|
|
535
535
|
* DocumentParser — handles text extraction from various file formats.
|
|
536
|
-
* Supported:
|
|
536
|
+
* Supported:
|
|
537
|
+
* - PowerPoint: .pptx, .ppt, .odp
|
|
538
|
+
* - Word: .docx, .doc, .odt, .rtf
|
|
539
|
+
* - Excel: .xlsx, .xls, .ods, .csv, .tsv
|
|
540
|
+
* - PDF: .pdf
|
|
541
|
+
* - Text & Code: .txt, .md, .json, .yaml, .yml, .xml, .html, .htm, .log, .epub
|
|
537
542
|
*/
|
|
538
543
|
declare class DocumentParser {
|
|
544
|
+
/**
|
|
545
|
+
* Fast Magic-Bytes sniffer for instant file format identification (<1ms).
|
|
546
|
+
*/
|
|
547
|
+
static sniffMagicBytes(buffer: Buffer): 'pdf' | 'zip' | 'ole2' | 'json' | 'text' | null;
|
|
548
|
+
/**
|
|
549
|
+
* Convert spreadsheet sheets into high-fidelity, context-preserved tabular text.
|
|
550
|
+
* Every row retains its column and section context so vector embeddings achieve 100% semantic retrieval precision.
|
|
551
|
+
*/
|
|
552
|
+
private static formatSheetToContextualText;
|
|
539
553
|
/**
|
|
540
554
|
* Extract text from a File or Buffer based on its type.
|
|
541
555
|
*/
|
|
542
|
-
static parse(file: File | Buffer, fileName: string, mimeType
|
|
556
|
+
static parse(file: File | Buffer, fileName: string, mimeType?: string): Promise<string>;
|
|
557
|
+
/**
|
|
558
|
+
* Helper to strip XML tags and normalize inner text content.
|
|
559
|
+
*/
|
|
560
|
+
private static stripXmlTags;
|
|
561
|
+
/**
|
|
562
|
+
* Helper to strip HTML / XML tags while removing script and style blocks completely.
|
|
563
|
+
*/
|
|
564
|
+
private static stripHtmlAndXml;
|
|
565
|
+
/**
|
|
566
|
+
* Safe text extraction from non-OpenXML / legacy Excel spreadsheets (.xls, BIFF8, HTML tables, XML Spreadsheet 2003).
|
|
567
|
+
*/
|
|
568
|
+
private static parseLegacyExcelOrFallback;
|
|
569
|
+
/**
|
|
570
|
+
* Dynamically infer document domain and schema from extracted text, filename, and format.
|
|
571
|
+
*/
|
|
572
|
+
static inferDocumentDomainAndSchema(text: string, fileName?: string, mimeType?: string): {
|
|
573
|
+
domain: 'finance' | 'ecommerce' | 'timeseries' | 'legal' | 'healthcare' | 'tabular' | 'general';
|
|
574
|
+
schema?: Record<string, string>;
|
|
575
|
+
isCatalog: boolean;
|
|
576
|
+
isFinancial: boolean;
|
|
577
|
+
};
|
|
543
578
|
private static readAsText;
|
|
544
579
|
}
|
|
545
580
|
|
|
581
|
+
/**
|
|
582
|
+
* PromptOptimizer — Intelligent query normalizer and prompt enhancement engine.
|
|
583
|
+
*
|
|
584
|
+
* Solves user prompt failures where the model or vector retrieval is unable to
|
|
585
|
+
* process poorly phrased, ambiguous, typo-ridden, pronoun-heavy, or underspecified queries.
|
|
586
|
+
*
|
|
587
|
+
* Responsibilities:
|
|
588
|
+
* 1. Syntax & Text Normalization: Strips non-printable artifacts, fixes unclosed delimiters, normalizes colloquial abbreviations.
|
|
589
|
+
* 2. Pronoun & Coreference Resolution: Resolves pronouns ('it', 'they', 'this', 'that') against conversation history.
|
|
590
|
+
* 3. Short & Underspecified Query Expansion: Expands one-word/vague queries into clear semantic questions for high-recall RAG.
|
|
591
|
+
* 4. LLM-Assisted Query Enhancement: Optional deep reformulation using the fast router LLM for multi-turn RAG reasoning.
|
|
592
|
+
*/
|
|
593
|
+
|
|
594
|
+
interface PromptOptimizationOptions {
|
|
595
|
+
/** Whether to resolve pronouns and context from conversation history */
|
|
596
|
+
resolveHistory?: boolean;
|
|
597
|
+
/** Whether to expand short/underspecified keywords into complete questions */
|
|
598
|
+
expandKeywords?: boolean;
|
|
599
|
+
/** Optional LLM provider for deep reformulation on complex queries */
|
|
600
|
+
llmProvider?: ILLMProvider;
|
|
601
|
+
}
|
|
602
|
+
interface OptimizedPromptResult {
|
|
603
|
+
/** The final optimized prompt to send to the RAG retrieval and LLM synthesis */
|
|
604
|
+
optimizedPrompt: string;
|
|
605
|
+
/** The original raw user prompt */
|
|
606
|
+
originalPrompt: string;
|
|
607
|
+
/** Whether the prompt was modified during optimization */
|
|
608
|
+
wasModified: boolean;
|
|
609
|
+
/** List of optimization operations performed */
|
|
610
|
+
transformations: string[];
|
|
611
|
+
}
|
|
612
|
+
declare class PromptOptimizer {
|
|
613
|
+
private static readonly COMMON_ABBREVIATIONS;
|
|
614
|
+
private static readonly TOPIC_EXPANSIONS;
|
|
615
|
+
/**
|
|
616
|
+
* Optimizes a user prompt synchronously using fast heuristic rules and history resolution.
|
|
617
|
+
*/
|
|
618
|
+
static optimize(rawPrompt: string, history?: ChatMessage[], options?: PromptOptimizationOptions): OptimizedPromptResult;
|
|
619
|
+
/**
|
|
620
|
+
* Cleans text artifacts, fixes unclosed quotes/parentheses, and collapses whitespace.
|
|
621
|
+
*/
|
|
622
|
+
private static cleanText;
|
|
623
|
+
/**
|
|
624
|
+
* Replaces shorthand chat abbreviations with clear natural language.
|
|
625
|
+
*/
|
|
626
|
+
private static expandAbbreviations;
|
|
627
|
+
/**
|
|
628
|
+
* Resolves ambiguous pronouns ('it', 'this', 'they', 'the last one') against recent chat history.
|
|
629
|
+
*/
|
|
630
|
+
private static resolveCoreferences;
|
|
631
|
+
/**
|
|
632
|
+
* Deep LLM-powered prompt optimizer for complex, multi-hop, or highly ambiguous user queries.
|
|
633
|
+
*/
|
|
634
|
+
static optimizeWithLLM(rawPrompt: string, history?: ChatMessage[], llmProvider?: ILLMProvider): Promise<OptimizedPromptResult>;
|
|
635
|
+
}
|
|
636
|
+
|
|
546
637
|
interface DataSignals {
|
|
547
638
|
rowCount: number;
|
|
548
639
|
hasNumericFields: boolean;
|
|
@@ -1421,4 +1512,4 @@ declare function initializeTelemetryService(projectId: string, licenseKey: strin
|
|
|
1421
1512
|
*/
|
|
1422
1513
|
declare function shutdownTelemetryService(): Promise<void>;
|
|
1423
1514
|
|
|
1424
|
-
export { AnthropicProvider, BaseVectorProvider, CarouselRendererStrategy, ChartRendererStrategy, ChatMessage, ChatOptions, ChatResponse, ChromaDBProvider, ConfigBuilder, ConfigResolver, type CustomEmbeddingOptions, CustomEmbeddingProvider, DecisionContext, DocumentParser, Edge, EmbedOptions, EmbeddingConfig, EmbeddingProvider, EmbeddingStrategy, EmbeddingStrategyResolver, EventType, GraphNode, GraphSearchResult, GroqProvider, HealthCheckResult, ILLMProvider, IProviderHealthChecker, IProviderValidator, IRenderRule, IRendererStrategy, IngestDocument, IntentCategory, IntentClassifier, LLMConfig, LLMFactory, LLMProvider, LLM_PROFILES, type LicensePayload, LicenseVerifier, LicensedRetrivora, type LicensedRetrivoraOptions, MilvusProvider, MixedRendererStrategy, MongoDBProvider, MultiTablePostgresProvider, OllamaProvider, OpenAIProvider, PRESETS, PineconeProvider, PostgreSQLProvider, ProviderHealthCheck, ProviderRegistry, QdrantProvider, QwenProvider, RAGConfig, RagConfig, RedisProvider, RenderDecision, RendererRegistry, Rule1SpecificInfoRule, Rule2ComparisonRule, Rule3ProductDiscoveryRule, Rule4AnalyticalRule, Rule5MixedResponseRule, Rule6SmallResultSetRule, Rule7LargeTableRule, RuleEngine, type RuntimeTierConfig, TableRendererStrategy, type TelemetryEvent, TelemetryService, TextRendererStrategy, UIConfig, UITransformationResponse, UniversalLLMAdapter, UniversalRagConfig, UniversalVectorProvider, UpsertDocument, VECTOR_PROFILES, VectorDBConfig, VectorDBProvider, VectorMatch, VisualizationDecisionEngine, WeaviateProvider, createFromPreset, createRetrivora, decideVisualization, getRagConfig, getRuntimeConfig, getTelemetryService, initializeTelemetryService, injectRuntimeConfig, shutdownTelemetryService };
|
|
1515
|
+
export { AnthropicProvider, BaseVectorProvider, CarouselRendererStrategy, ChartRendererStrategy, ChatMessage, ChatOptions, ChatResponse, ChromaDBProvider, ConfigBuilder, ConfigResolver, type CustomEmbeddingOptions, CustomEmbeddingProvider, DecisionContext, DocumentParser, Edge, EmbedOptions, EmbeddingConfig, EmbeddingProvider, EmbeddingStrategy, EmbeddingStrategyResolver, EventType, GraphNode, GraphSearchResult, GroqProvider, HealthCheckResult, ILLMProvider, IProviderHealthChecker, IProviderValidator, IRenderRule, IRendererStrategy, IngestDocument, IntentCategory, IntentClassifier, LLMConfig, LLMFactory, LLMProvider, LLM_PROFILES, type LicensePayload, LicenseVerifier, LicensedRetrivora, type LicensedRetrivoraOptions, MilvusProvider, MixedRendererStrategy, MongoDBProvider, MultiTablePostgresProvider, OllamaProvider, OpenAIProvider, type OptimizedPromptResult, PRESETS, PineconeProvider, PostgreSQLProvider, type PromptOptimizationOptions, PromptOptimizer, ProviderHealthCheck, ProviderRegistry, QdrantProvider, QwenProvider, RAGConfig, RagConfig, RedisProvider, RenderDecision, RendererRegistry, Rule1SpecificInfoRule, Rule2ComparisonRule, Rule3ProductDiscoveryRule, Rule4AnalyticalRule, Rule5MixedResponseRule, Rule6SmallResultSetRule, Rule7LargeTableRule, RuleEngine, type RuntimeTierConfig, TableRendererStrategy, type TelemetryEvent, TelemetryService, TextRendererStrategy, UIConfig, UITransformationResponse, UniversalLLMAdapter, UniversalRagConfig, UniversalVectorProvider, UpsertDocument, VECTOR_PROFILES, VectorDBConfig, VectorDBProvider, VectorMatch, VisualizationDecisionEngine, WeaviateProvider, createFromPreset, createRetrivora, decideVisualization, getRagConfig, getRuntimeConfig, getTelemetryService, initializeTelemetryService, injectRuntimeConfig, shutdownTelemetryService };
|