@retrivora-ai/rag-engine 1.9.0 → 1.9.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/{ILLMProvider-BOJFz3Na.d.mts → ILLMProvider-Bw2A28nU.d.mts} +12 -0
- package/dist/{ILLMProvider-BOJFz3Na.d.ts → ILLMProvider-Bw2A28nU.d.ts} +12 -0
- package/dist/handlers/index.d.mts +2 -2
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.js +1874 -542
- package/dist/handlers/index.mjs +1873 -541
- package/dist/{index-D3V9Et2M.d.mts → index-B70ZLkfG.d.mts} +1 -1
- package/dist/{index-BwpcaziY.d.ts → index-DVu-mkAM.d.ts} +1 -1
- package/dist/index.css +83 -0
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +330 -106
- package/dist/index.mjs +333 -107
- package/dist/server.d.mts +32 -5
- package/dist/server.d.ts +32 -5
- package/dist/server.js +1871 -736
- package/dist/server.mjs +1870 -735
- package/package.json +1 -1
- package/src/components/ChatWindow.tsx +24 -14
- package/src/components/MarkdownComponents.tsx +3 -3
- package/src/components/MessageBubble.tsx +89 -7
- package/src/components/ProductCard.tsx +29 -2
- package/src/components/UIDispatcher.tsx +1 -0
- package/src/components/VisualizationRenderer.tsx +143 -11
- package/src/config/EmbeddingStrategy.ts +5 -4
- package/src/config/RagConfig.ts +10 -0
- package/src/config/serverConfig.ts +16 -1
- package/src/core/LLMRouter.ts +79 -0
- package/src/core/Pipeline.ts +295 -51
- package/src/core/ProviderRegistry.ts +6 -0
- package/src/core/QueryProcessor.ts +108 -9
- package/src/handlers/index.ts +37 -11
- package/src/hooks/useRagChat.ts +77 -17
- package/src/llm/providers/UniversalLLMAdapter.ts +110 -13
- package/src/providers/vectordb/ChromaDBProvider.ts +13 -2
- package/src/providers/vectordb/MilvusProvider.ts +18 -2
- package/src/providers/vectordb/MultiTablePostgresProvider.ts +48 -16
- package/src/providers/vectordb/PostgreSQLProvider.ts +1 -1
- package/src/providers/vectordb/QdrantProvider.ts +1 -1
- package/src/providers/vectordb/RedisProvider.ts +3 -4
- package/src/providers/vectordb/WeaviateProvider.ts +41 -3
- package/src/types/chat.ts +2 -0
- package/src/types/index.ts +26 -0
- package/src/utils/ProductExtractor.ts +5 -3
- package/src/utils/SchemaMapper.ts +6 -4
- package/src/utils/UITransformer.ts +1350 -490
- package/src/utils/synonyms.ts +6 -4
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-
|
|
1
|
+
import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-Bw2A28nU.mjs';
|
|
2
2
|
import { NextRequest, NextResponse } from 'next/server';
|
|
3
3
|
|
|
4
4
|
interface ValidationError {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-
|
|
1
|
+
import { k as RagConfig, I as ILLMProvider, C as ChatMessage, d as ChatResponse, g as IngestDocument } from './ILLMProvider-Bw2A28nU.js';
|
|
2
2
|
import { NextRequest, NextResponse } from 'next/server';
|
|
3
3
|
|
|
4
4
|
interface ValidationError {
|
package/dist/index.css
CHANGED
|
@@ -42,6 +42,7 @@
|
|
|
42
42
|
--color-rose-200: oklch(89.2% 0.058 10.001);
|
|
43
43
|
--color-rose-400: oklch(71.2% 0.194 13.428);
|
|
44
44
|
--color-rose-500: oklch(64.5% 0.246 16.439);
|
|
45
|
+
--color-rose-600: oklch(58.6% 0.253 17.585);
|
|
45
46
|
--color-slate-50: oklch(98.4% 0.003 247.858);
|
|
46
47
|
--color-slate-100: oklch(96.8% 0.007 247.896);
|
|
47
48
|
--color-slate-200: oklch(92.9% 0.013 255.508);
|
|
@@ -66,6 +67,8 @@
|
|
|
66
67
|
--text-xs--line-height: calc(1 / 0.75);
|
|
67
68
|
--text-sm: 0.875rem;
|
|
68
69
|
--text-sm--line-height: calc(1.25 / 0.875);
|
|
70
|
+
--text-base: 1rem;
|
|
71
|
+
--text-base--line-height: calc(1.5 / 1);
|
|
69
72
|
--text-lg: 1.125rem;
|
|
70
73
|
--text-lg--line-height: calc(1.75 / 1.125);
|
|
71
74
|
--text-xl: 1.25rem;
|
|
@@ -310,6 +313,9 @@
|
|
|
310
313
|
.right-0 {
|
|
311
314
|
right: calc(var(--spacing) * 0);
|
|
312
315
|
}
|
|
316
|
+
.right-2 {
|
|
317
|
+
right: calc(var(--spacing) * 2);
|
|
318
|
+
}
|
|
313
319
|
.right-4 {
|
|
314
320
|
right: calc(var(--spacing) * 4);
|
|
315
321
|
}
|
|
@@ -535,6 +541,9 @@
|
|
|
535
541
|
.hidden {
|
|
536
542
|
display: none;
|
|
537
543
|
}
|
|
544
|
+
.inline {
|
|
545
|
+
display: inline;
|
|
546
|
+
}
|
|
538
547
|
.inline-block {
|
|
539
548
|
display: inline-block;
|
|
540
549
|
}
|
|
@@ -803,6 +812,12 @@
|
|
|
803
812
|
--tw-scale-z: 90%;
|
|
804
813
|
scale: var(--tw-scale-x) var(--tw-scale-y);
|
|
805
814
|
}
|
|
815
|
+
.scale-95 {
|
|
816
|
+
--tw-scale-x: 95%;
|
|
817
|
+
--tw-scale-y: 95%;
|
|
818
|
+
--tw-scale-z: 95%;
|
|
819
|
+
scale: var(--tw-scale-x) var(--tw-scale-y);
|
|
820
|
+
}
|
|
806
821
|
.scale-100 {
|
|
807
822
|
--tw-scale-x: 100%;
|
|
808
823
|
--tw-scale-y: 100%;
|
|
@@ -1052,6 +1067,9 @@
|
|
|
1052
1067
|
.rounded-3xl {
|
|
1053
1068
|
border-radius: var(--radius-3xl);
|
|
1054
1069
|
}
|
|
1070
|
+
.rounded-\[2px\] {
|
|
1071
|
+
border-radius: 2px;
|
|
1072
|
+
}
|
|
1055
1073
|
.rounded-full {
|
|
1056
1074
|
border-radius: calc(infinity * 1px);
|
|
1057
1075
|
}
|
|
@@ -1138,6 +1156,12 @@
|
|
|
1138
1156
|
.border-emerald-500 {
|
|
1139
1157
|
border-color: var(--color-emerald-500);
|
|
1140
1158
|
}
|
|
1159
|
+
.border-emerald-500\/20 {
|
|
1160
|
+
border-color: color-mix(in srgb, oklch(69.6% 0.17 162.48) 20%, transparent);
|
|
1161
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1162
|
+
border-color: color-mix(in oklab, var(--color-emerald-500) 20%, transparent);
|
|
1163
|
+
}
|
|
1164
|
+
}
|
|
1141
1165
|
.border-indigo-100 {
|
|
1142
1166
|
border-color: var(--color-indigo-100);
|
|
1143
1167
|
}
|
|
@@ -1213,6 +1237,12 @@
|
|
|
1213
1237
|
.bg-emerald-500 {
|
|
1214
1238
|
background-color: var(--color-emerald-500);
|
|
1215
1239
|
}
|
|
1240
|
+
.bg-emerald-500\/10 {
|
|
1241
|
+
background-color: color-mix(in srgb, oklch(69.6% 0.17 162.48) 10%, transparent);
|
|
1242
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1243
|
+
background-color: color-mix(in oklab, var(--color-emerald-500) 10%, transparent);
|
|
1244
|
+
}
|
|
1245
|
+
}
|
|
1216
1246
|
.bg-green-500 {
|
|
1217
1247
|
background-color: var(--color-green-500);
|
|
1218
1248
|
}
|
|
@@ -1255,6 +1285,12 @@
|
|
|
1255
1285
|
.bg-slate-400 {
|
|
1256
1286
|
background-color: var(--color-slate-400);
|
|
1257
1287
|
}
|
|
1288
|
+
.bg-slate-500\/5 {
|
|
1289
|
+
background-color: color-mix(in srgb, oklch(55.4% 0.046 257.417) 5%, transparent);
|
|
1290
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1291
|
+
background-color: color-mix(in oklab, var(--color-slate-500) 5%, transparent);
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1258
1294
|
.bg-slate-900 {
|
|
1259
1295
|
background-color: var(--color-slate-900);
|
|
1260
1296
|
}
|
|
@@ -1427,6 +1463,10 @@
|
|
|
1427
1463
|
font-size: var(--text-7xl);
|
|
1428
1464
|
line-height: var(--tw-leading, var(--text-7xl--line-height));
|
|
1429
1465
|
}
|
|
1466
|
+
.text-base {
|
|
1467
|
+
font-size: var(--text-base);
|
|
1468
|
+
line-height: var(--tw-leading, var(--text-base--line-height));
|
|
1469
|
+
}
|
|
1430
1470
|
.text-lg {
|
|
1431
1471
|
font-size: var(--text-lg);
|
|
1432
1472
|
line-height: var(--tw-leading, var(--text-lg--line-height));
|
|
@@ -1576,6 +1616,9 @@
|
|
|
1576
1616
|
.text-rose-500 {
|
|
1577
1617
|
color: var(--color-rose-500);
|
|
1578
1618
|
}
|
|
1619
|
+
.text-rose-600 {
|
|
1620
|
+
color: var(--color-rose-600);
|
|
1621
|
+
}
|
|
1579
1622
|
.text-slate-100 {
|
|
1580
1623
|
color: var(--color-slate-100);
|
|
1581
1624
|
}
|
|
@@ -1781,6 +1824,16 @@
|
|
|
1781
1824
|
.\[animation-delay\:300ms\] {
|
|
1782
1825
|
animation-delay: 300ms;
|
|
1783
1826
|
}
|
|
1827
|
+
.group-hover\:scale-100 {
|
|
1828
|
+
&:is(:where(.group):hover *) {
|
|
1829
|
+
@media (hover: hover) {
|
|
1830
|
+
--tw-scale-x: 100%;
|
|
1831
|
+
--tw-scale-y: 100%;
|
|
1832
|
+
--tw-scale-z: 100%;
|
|
1833
|
+
scale: var(--tw-scale-x) var(--tw-scale-y);
|
|
1834
|
+
}
|
|
1835
|
+
}
|
|
1836
|
+
}
|
|
1784
1837
|
.group-hover\:scale-105 {
|
|
1785
1838
|
&:is(:where(.group):hover *) {
|
|
1786
1839
|
@media (hover: hover) {
|
|
@@ -1920,6 +1973,13 @@
|
|
|
1920
1973
|
}
|
|
1921
1974
|
}
|
|
1922
1975
|
}
|
|
1976
|
+
.hover\:bg-rose-600 {
|
|
1977
|
+
&:hover {
|
|
1978
|
+
@media (hover: hover) {
|
|
1979
|
+
background-color: var(--color-rose-600);
|
|
1980
|
+
}
|
|
1981
|
+
}
|
|
1982
|
+
}
|
|
1923
1983
|
.hover\:bg-slate-50 {
|
|
1924
1984
|
&:hover {
|
|
1925
1985
|
@media (hover: hover) {
|
|
@@ -1961,6 +2021,16 @@
|
|
|
1961
2021
|
}
|
|
1962
2022
|
}
|
|
1963
2023
|
}
|
|
2024
|
+
.hover\:bg-slate-500\/10 {
|
|
2025
|
+
&:hover {
|
|
2026
|
+
@media (hover: hover) {
|
|
2027
|
+
background-color: color-mix(in srgb, oklch(55.4% 0.046 257.417) 10%, transparent);
|
|
2028
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2029
|
+
background-color: color-mix(in oklab, var(--color-slate-500) 10%, transparent);
|
|
2030
|
+
}
|
|
2031
|
+
}
|
|
2032
|
+
}
|
|
2033
|
+
}
|
|
1964
2034
|
.hover\:bg-white {
|
|
1965
2035
|
&:hover {
|
|
1966
2036
|
@media (hover: hover) {
|
|
@@ -2119,6 +2189,11 @@
|
|
|
2119
2189
|
}
|
|
2120
2190
|
}
|
|
2121
2191
|
}
|
|
2192
|
+
.sm\:grid-cols-2 {
|
|
2193
|
+
@media (width >= 40rem) {
|
|
2194
|
+
grid-template-columns: repeat(2, minmax(0, 1fr));
|
|
2195
|
+
}
|
|
2196
|
+
}
|
|
2122
2197
|
.sm\:grid-cols-3 {
|
|
2123
2198
|
@media (width >= 40rem) {
|
|
2124
2199
|
grid-template-columns: repeat(3, minmax(0, 1fr));
|
|
@@ -2608,6 +2683,14 @@
|
|
|
2608
2683
|
}
|
|
2609
2684
|
}
|
|
2610
2685
|
}
|
|
2686
|
+
.dark\:text-white\/75 {
|
|
2687
|
+
@media (prefers-color-scheme: dark) {
|
|
2688
|
+
color: color-mix(in srgb, #fff 75%, transparent);
|
|
2689
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2690
|
+
color: color-mix(in oklab, var(--color-white) 75%, transparent);
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2693
|
+
}
|
|
2611
2694
|
.dark\:text-white\/80 {
|
|
2612
2695
|
@media (prefers-color-scheme: dark) {
|
|
2613
2696
|
color: color-mix(in srgb, #fff 80%, transparent);
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
3
|
-
import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, O as ObservabilityTrace, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-
|
|
4
|
-
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-
|
|
3
|
+
import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, O as ObservabilityTrace, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-Bw2A28nU.mjs';
|
|
4
|
+
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-Bw2A28nU.mjs';
|
|
5
5
|
export { C as Chunk, a as ChunkOptions } from './DocumentChunker-Dh9TvmGG.mjs';
|
|
6
6
|
|
|
7
7
|
type ChatViewportSize = 'compact' | 'medium' | 'large';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { CSSProperties, MouseEvent, ReactNode } from 'react';
|
|
3
|
-
import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, O as ObservabilityTrace, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-
|
|
4
|
-
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-
|
|
3
|
+
import { P as Product, U as UIConfig, R as RagMessage, V as VectorMatch, O as ObservabilityTrace, a as UseRagChatOptions, b as UseRagChatReturn } from './ILLMProvider-Bw2A28nU.js';
|
|
4
|
+
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-Bw2A28nU.js';
|
|
5
5
|
export { C as Chunk, a as ChunkOptions } from './DocumentChunker-Dh9TvmGG.js';
|
|
6
6
|
|
|
7
7
|
type ChatViewportSize = 'compact' | 'medium' | 'large';
|