@retrivora-ai/rag-engine 1.8.0 → 1.8.2
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/DocumentChunker-Dh9TvmGG.d.mts +45 -0
- package/dist/DocumentChunker-Dh9TvmGG.d.ts +45 -0
- package/dist/{index-DPsQodME.d.mts → ILLMProvider-BOJFz3Na.d.mts} +104 -1
- package/dist/{index-DPsQodME.d.ts → ILLMProvider-BOJFz3Na.d.ts} +104 -1
- package/dist/MultiTablePostgresProvider-ZLGSKTJR.mjs +8 -0
- package/dist/chunk-ICKRMZQK.mjs +76 -0
- package/dist/{chunk-PV3MFHWU.mjs → chunk-LZVVLSDN.mjs} +977 -516
- package/dist/chunk-OZFBG4BA.mjs +291 -0
- package/dist/handlers/index.d.mts +2 -2
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.js +1269 -656
- package/dist/handlers/index.mjs +4 -1
- package/dist/{index-Bb2yEopi.d.mts → index-BwpcaziY.d.ts} +10 -2
- package/dist/{index-CkbTzj9J.d.ts → index-D3V9Et2M.d.mts} +10 -2
- package/dist/index.d.mts +24 -4
- package/dist/index.d.ts +24 -4
- package/dist/index.js +1354 -826
- package/dist/index.mjs +1284 -795
- package/dist/server.d.mts +47 -27
- package/dist/server.d.ts +47 -27
- package/dist/server.js +1417 -829
- package/dist/server.mjs +164 -176
- package/package.json +6 -2
- package/src/app/api/upload/route.ts +4 -0
- package/src/app/constants.tsx +2 -2
- package/src/app/page.tsx +12 -322
- package/src/components/AmbientBackground.tsx +29 -0
- package/src/components/ArchitectureCard.tsx +17 -0
- package/src/components/ArchitectureCardsSection.tsx +15 -0
- package/src/components/ChatWindow.tsx +32 -0
- package/src/components/CodeViewer.tsx +51 -0
- package/src/components/ConfigProvider.tsx +1 -0
- package/src/components/DocViewer.tsx +37 -0
- package/src/components/DocumentUpload.tsx +44 -1
- package/src/components/Documentation.tsx +58 -0
- package/src/components/DynamicChart.tsx +27 -2
- package/src/components/Hero.tsx +59 -0
- package/src/components/HourglassLoader.tsx +87 -0
- package/src/components/Lifecycle.tsx +37 -0
- package/src/components/MarkdownComponents.tsx +140 -0
- package/src/components/MessageBubble.tsx +124 -904
- package/src/components/Navbar.tsx +55 -0
- package/src/components/ObservabilityPanel.tsx +374 -0
- package/src/components/ProductCard.tsx +5 -3
- package/src/components/UIDispatcher.tsx +344 -0
- package/src/components/VisualizationRenderer.tsx +372 -250
- package/src/config/RagConfig.ts +5 -0
- package/src/config/serverConfig.ts +3 -1
- package/src/core/Pipeline.ts +240 -271
- package/src/core/ProviderRegistry.ts +2 -2
- package/src/core/VectorPlugin.ts +9 -0
- package/src/handlers/index.ts +91 -15
- package/src/hooks/useRagChat.ts +21 -11
- package/src/index.ts +9 -1
- package/src/llm/LLMFactory.ts +54 -2
- package/src/llm/providers/AnthropicProvider.ts +12 -8
- package/src/llm/providers/GeminiProvider.ts +188 -143
- package/src/llm/providers/OllamaProvider.ts +7 -3
- package/src/llm/providers/OpenAIProvider.ts +12 -8
- package/src/providers/vectordb/MultiTablePostgresProvider.ts +150 -64
- package/src/types/chat.ts +8 -0
- package/src/types/index.ts +132 -0
- package/src/types/props.ts +9 -1
- package/src/utils/ProductExtractor.ts +347 -0
- package/src/utils/SchemaMapper.ts +129 -0
- package/src/utils/UITransformer.ts +470 -209
- package/src/utils/synonyms.ts +78 -0
- package/dist/DocumentChunker-C1GEEosY.d.ts +0 -93
- package/dist/DocumentChunker-CFEiRopR.d.mts +0 -93
- package/dist/PostgreSQLProvider-BMOETDZA.mjs +0 -8
- package/dist/chunk-FLOSGE6A.mjs +0 -202
package/dist/handlers/index.mjs
CHANGED
|
@@ -8,9 +8,11 @@ import {
|
|
|
8
8
|
sseErrorFrame,
|
|
9
9
|
sseFrame,
|
|
10
10
|
sseMetaFrame,
|
|
11
|
+
sseObservabilityFrame,
|
|
11
12
|
sseTextFrame,
|
|
12
13
|
sseUIFrame
|
|
13
|
-
} from "../chunk-
|
|
14
|
+
} from "../chunk-LZVVLSDN.mjs";
|
|
15
|
+
import "../chunk-ICKRMZQK.mjs";
|
|
14
16
|
import "../chunk-YLTMFW4M.mjs";
|
|
15
17
|
import "../chunk-X4TOT24V.mjs";
|
|
16
18
|
export {
|
|
@@ -23,6 +25,7 @@ export {
|
|
|
23
25
|
sseErrorFrame,
|
|
24
26
|
sseFrame,
|
|
25
27
|
sseMetaFrame,
|
|
28
|
+
sseObservabilityFrame,
|
|
26
29
|
sseTextFrame,
|
|
27
30
|
sseUIFrame
|
|
28
31
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-BOJFz3Na.js';
|
|
2
2
|
import { NextRequest, NextResponse } from 'next/server';
|
|
3
3
|
|
|
4
4
|
interface ValidationError {
|
|
@@ -85,6 +85,12 @@ declare class VectorPlugin {
|
|
|
85
85
|
* Get the current resolved configuration.
|
|
86
86
|
*/
|
|
87
87
|
getConfig(): RagConfig;
|
|
88
|
+
/**
|
|
89
|
+
* Get the initialized LLM provider (available after the first request).
|
|
90
|
+
* Used by handlers to pass to UITransformer.analyzeAndDecide() for
|
|
91
|
+
* LLM-driven visualization decisions.
|
|
92
|
+
*/
|
|
93
|
+
getLLMProvider(): ILLMProvider | undefined;
|
|
88
94
|
/**
|
|
89
95
|
* Perform pre-flight health checks on all configured providers.
|
|
90
96
|
* Useful to verify connectivity before running operations.
|
|
@@ -129,6 +135,8 @@ declare function sseTextFrame(text: string): string;
|
|
|
129
135
|
declare function sseMetaFrame(meta: unknown): string;
|
|
130
136
|
/** Encode the UI transformation result as an SSE frame. */
|
|
131
137
|
declare function sseUIFrame(uiTransformation: unknown): string;
|
|
138
|
+
/** Encode the observability trace as an SSE frame. */
|
|
139
|
+
declare function sseObservabilityFrame(trace: unknown): string;
|
|
132
140
|
/** Encode a stream error as an SSE frame. */
|
|
133
141
|
declare function sseErrorFrame(message: string): string;
|
|
134
142
|
/**
|
|
@@ -217,4 +225,4 @@ declare function createSuggestionsHandler(configOrPlugin?: Partial<RagConfig> |
|
|
|
217
225
|
suggestions: string[];
|
|
218
226
|
}>>;
|
|
219
227
|
|
|
220
|
-
export { ConfigValidator as C, type HealthCheckResult as H, type IProviderValidator as I, type ValidationError as V, type IProviderHealthChecker as a, VectorPlugin as b, createChatHandler as c, createHealthHandler as d, createIngestHandler as e, createStreamHandler as f, createUploadHandler as g, sseFrame as h, sseMetaFrame as i, sseTextFrame as j, createSuggestionsHandler as k,
|
|
228
|
+
export { ConfigValidator as C, type HealthCheckResult as H, type IProviderValidator as I, type ValidationError as V, type IProviderHealthChecker as a, VectorPlugin as b, createChatHandler as c, createHealthHandler as d, createIngestHandler as e, createStreamHandler as f, createUploadHandler as g, sseFrame as h, sseMetaFrame as i, sseTextFrame as j, createSuggestionsHandler as k, sseObservabilityFrame as l, sseUIFrame as m, sseErrorFrame as s };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-BOJFz3Na.mjs';
|
|
2
2
|
import { NextRequest, NextResponse } from 'next/server';
|
|
3
3
|
|
|
4
4
|
interface ValidationError {
|
|
@@ -85,6 +85,12 @@ declare class VectorPlugin {
|
|
|
85
85
|
* Get the current resolved configuration.
|
|
86
86
|
*/
|
|
87
87
|
getConfig(): RagConfig;
|
|
88
|
+
/**
|
|
89
|
+
* Get the initialized LLM provider (available after the first request).
|
|
90
|
+
* Used by handlers to pass to UITransformer.analyzeAndDecide() for
|
|
91
|
+
* LLM-driven visualization decisions.
|
|
92
|
+
*/
|
|
93
|
+
getLLMProvider(): ILLMProvider | undefined;
|
|
88
94
|
/**
|
|
89
95
|
* Perform pre-flight health checks on all configured providers.
|
|
90
96
|
* Useful to verify connectivity before running operations.
|
|
@@ -129,6 +135,8 @@ declare function sseTextFrame(text: string): string;
|
|
|
129
135
|
declare function sseMetaFrame(meta: unknown): string;
|
|
130
136
|
/** Encode the UI transformation result as an SSE frame. */
|
|
131
137
|
declare function sseUIFrame(uiTransformation: unknown): string;
|
|
138
|
+
/** Encode the observability trace as an SSE frame. */
|
|
139
|
+
declare function sseObservabilityFrame(trace: unknown): string;
|
|
132
140
|
/** Encode a stream error as an SSE frame. */
|
|
133
141
|
declare function sseErrorFrame(message: string): string;
|
|
134
142
|
/**
|
|
@@ -217,4 +225,4 @@ declare function createSuggestionsHandler(configOrPlugin?: Partial<RagConfig> |
|
|
|
217
225
|
suggestions: string[];
|
|
218
226
|
}>>;
|
|
219
227
|
|
|
220
|
-
export { ConfigValidator as C, type HealthCheckResult as H, type IProviderValidator as I, type ValidationError as V, type IProviderHealthChecker as a, VectorPlugin as b, createChatHandler as c, createHealthHandler as d, createIngestHandler as e, createStreamHandler as f, createUploadHandler as g, sseFrame as h, sseMetaFrame as i, sseTextFrame as j, createSuggestionsHandler as k,
|
|
228
|
+
export { ConfigValidator as C, type HealthCheckResult as H, type IProviderValidator as I, type ValidationError as V, type IProviderHealthChecker as a, VectorPlugin as b, createChatHandler as c, createHealthHandler as d, createIngestHandler as e, createStreamHandler as f, createUploadHandler as g, sseFrame as h, sseMetaFrame as i, sseTextFrame as j, createSuggestionsHandler as k, sseObservabilityFrame as l, sseUIFrame as m, sseErrorFrame as s };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
2
|
-
import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, a as UseRagChatOptions, b as UseRagChatReturn } from './
|
|
3
|
-
export { C as ChatMessage, c as ChatOptions, d as ChatResponse, E as
|
|
4
|
-
export { C as Chunk, a as ChunkOptions
|
|
2
|
+
import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, O as ObservabilityTrace, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-BOJFz3Na.mjs';
|
|
3
|
+
export { C as ChatMessage, c as ChatOptions, d as ChatResponse, E as EmbedOptions, e as EmbeddingConfig, f as EmbeddingProvider, I as ILLMProvider, g as IngestDocument, L as LLMConfig, h as LLMProvider, i as LatencyBreakdown, j as RAGConfig, k as RagConfig, l as RetrievedChunk, T as TokenUsage, m as UpsertDocument, n as VectorDBConfig, o as VectorDBProvider } from './ILLMProvider-BOJFz3Na.mjs';
|
|
4
|
+
export { C as Chunk, a as ChunkOptions } from './DocumentChunker-Dh9TvmGG.mjs';
|
|
5
5
|
|
|
6
6
|
type ChatViewportSize = 'compact' | 'medium' | 'large';
|
|
7
7
|
interface ChatWindowProps {
|
|
@@ -66,11 +66,19 @@ interface SourceCardProps {
|
|
|
66
66
|
interface ClientConfig {
|
|
67
67
|
projectId: string;
|
|
68
68
|
ui: Required<UIConfig>;
|
|
69
|
+
embedding?: {
|
|
70
|
+
model?: string;
|
|
71
|
+
dimensions?: number;
|
|
72
|
+
};
|
|
69
73
|
}
|
|
70
74
|
interface ConfigProviderProps {
|
|
71
75
|
config?: {
|
|
72
76
|
projectId?: string;
|
|
73
77
|
ui?: Partial<UIConfig>;
|
|
78
|
+
embedding?: {
|
|
79
|
+
model?: string;
|
|
80
|
+
dimensions?: number;
|
|
81
|
+
};
|
|
74
82
|
};
|
|
75
83
|
children: ReactNode;
|
|
76
84
|
}
|
|
@@ -85,6 +93,12 @@ declare function MessageBubble({ message, sources, isStreaming, primaryColor, ac
|
|
|
85
93
|
|
|
86
94
|
declare function SourceCard({ source, index }: SourceCardProps): React.JSX.Element;
|
|
87
95
|
|
|
96
|
+
interface ObservabilityPanelProps {
|
|
97
|
+
trace: ObservabilityTrace;
|
|
98
|
+
primaryColor?: string;
|
|
99
|
+
}
|
|
100
|
+
declare function ObservabilityPanel({ trace, primaryColor }: ObservabilityPanelProps): React.JSX.Element;
|
|
101
|
+
|
|
88
102
|
/**
|
|
89
103
|
* ConfigProvider — React Context that makes RagConfig (UI subset) available
|
|
90
104
|
* to all child components without prop drilling.
|
|
@@ -97,4 +111,10 @@ declare function useConfig(): ClientConfig;
|
|
|
97
111
|
|
|
98
112
|
declare function useRagChat(projectId: string, options?: UseRagChatOptions): UseRagChatReturn;
|
|
99
113
|
|
|
100
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Dynamically registers new synonyms into the global FIELD_SYNONYMS dictionary.
|
|
116
|
+
* You can call this during your app initialization to support custom schema fields.
|
|
117
|
+
*/
|
|
118
|
+
declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
|
|
119
|
+
|
|
120
|
+
export { ChatWidget, type ChatWidgetProps, ChatWindow, type ChatWindowProps, type ClientConfig, ConfigProvider, DocumentUpload, type DocumentUploadProps, MessageBubble, type MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, type ProductCardProps, type ProductCarouselProps, RagMessage, SourceCard, type SourceCardProps, UIConfig, UseRagChatOptions, UseRagChatReturn, VectorMatch, addSynonyms, useConfig, useRagChat };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React, { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
2
|
-
import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, a as UseRagChatOptions, b as UseRagChatReturn } from './
|
|
3
|
-
export { C as ChatMessage, c as ChatOptions, d as ChatResponse, E as
|
|
4
|
-
export { C as Chunk, a as ChunkOptions
|
|
2
|
+
import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, O as ObservabilityTrace, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-BOJFz3Na.js';
|
|
3
|
+
export { C as ChatMessage, c as ChatOptions, d as ChatResponse, E as EmbedOptions, e as EmbeddingConfig, f as EmbeddingProvider, I as ILLMProvider, g as IngestDocument, L as LLMConfig, h as LLMProvider, i as LatencyBreakdown, j as RAGConfig, k as RagConfig, l as RetrievedChunk, T as TokenUsage, m as UpsertDocument, n as VectorDBConfig, o as VectorDBProvider } from './ILLMProvider-BOJFz3Na.js';
|
|
4
|
+
export { C as Chunk, a as ChunkOptions } from './DocumentChunker-Dh9TvmGG.js';
|
|
5
5
|
|
|
6
6
|
type ChatViewportSize = 'compact' | 'medium' | 'large';
|
|
7
7
|
interface ChatWindowProps {
|
|
@@ -66,11 +66,19 @@ interface SourceCardProps {
|
|
|
66
66
|
interface ClientConfig {
|
|
67
67
|
projectId: string;
|
|
68
68
|
ui: Required<UIConfig>;
|
|
69
|
+
embedding?: {
|
|
70
|
+
model?: string;
|
|
71
|
+
dimensions?: number;
|
|
72
|
+
};
|
|
69
73
|
}
|
|
70
74
|
interface ConfigProviderProps {
|
|
71
75
|
config?: {
|
|
72
76
|
projectId?: string;
|
|
73
77
|
ui?: Partial<UIConfig>;
|
|
78
|
+
embedding?: {
|
|
79
|
+
model?: string;
|
|
80
|
+
dimensions?: number;
|
|
81
|
+
};
|
|
74
82
|
};
|
|
75
83
|
children: ReactNode;
|
|
76
84
|
}
|
|
@@ -85,6 +93,12 @@ declare function MessageBubble({ message, sources, isStreaming, primaryColor, ac
|
|
|
85
93
|
|
|
86
94
|
declare function SourceCard({ source, index }: SourceCardProps): React.JSX.Element;
|
|
87
95
|
|
|
96
|
+
interface ObservabilityPanelProps {
|
|
97
|
+
trace: ObservabilityTrace;
|
|
98
|
+
primaryColor?: string;
|
|
99
|
+
}
|
|
100
|
+
declare function ObservabilityPanel({ trace, primaryColor }: ObservabilityPanelProps): React.JSX.Element;
|
|
101
|
+
|
|
88
102
|
/**
|
|
89
103
|
* ConfigProvider — React Context that makes RagConfig (UI subset) available
|
|
90
104
|
* to all child components without prop drilling.
|
|
@@ -97,4 +111,10 @@ declare function useConfig(): ClientConfig;
|
|
|
97
111
|
|
|
98
112
|
declare function useRagChat(projectId: string, options?: UseRagChatOptions): UseRagChatReturn;
|
|
99
113
|
|
|
100
|
-
|
|
114
|
+
/**
|
|
115
|
+
* Dynamically registers new synonyms into the global FIELD_SYNONYMS dictionary.
|
|
116
|
+
* You can call this during your app initialization to support custom schema fields.
|
|
117
|
+
*/
|
|
118
|
+
declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
|
|
119
|
+
|
|
120
|
+
export { ChatWidget, type ChatWidgetProps, ChatWindow, type ChatWindowProps, type ClientConfig, ConfigProvider, DocumentUpload, type DocumentUploadProps, MessageBubble, type MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, type ProductCardProps, type ProductCarouselProps, RagMessage, SourceCard, type SourceCardProps, UIConfig, UseRagChatOptions, UseRagChatReturn, VectorMatch, addSynonyms, useConfig, useRagChat };
|