@retrivora-ai/rag-engine 1.9.7 → 1.9.9
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/README.md +136 -136
- package/dist/{ILLMProvider-Bhk6zJOK.d.mts → ILLMProvider-DMxLyTdq.d.mts} +59 -4
- package/dist/{ILLMProvider-Bhk6zJOK.d.ts → ILLMProvider-DMxLyTdq.d.ts} +59 -4
- package/dist/handlers/index.d.mts +2 -2
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.js +2327 -474
- package/dist/handlers/index.mjs +2329 -473
- package/dist/{index-B9J_XEh0.d.ts → index-CfkqZd2Y.d.ts} +12 -2
- package/dist/{index-C3SVtPYg.d.mts → index-DXd29KMq.d.mts} +27 -52
- package/dist/{index-Bu7T6xgr.d.ts → index-D_bOdJML.d.ts} +27 -52
- package/dist/{index-BJ4cd-t5.d.mts → index-xygonxpW.d.mts} +12 -2
- package/dist/index.css +783 -550
- package/dist/index.d.mts +35 -7
- package/dist/index.d.ts +35 -7
- package/dist/index.js +419 -282
- package/dist/index.mjs +426 -292
- package/dist/server.d.mts +65 -6
- package/dist/server.d.ts +65 -6
- package/dist/server.js +2185 -317
- package/dist/server.mjs +2185 -317
- package/package.json +13 -8
- package/src/app/constants.tsx +37 -7
- package/src/app/page.tsx +2 -0
- package/src/components/ChatWidget.tsx +2 -1
- package/src/components/ChatWindow.tsx +4 -1
- package/src/components/CodeViewer.tsx +19 -14
- package/src/components/MarkdownComponents.tsx +44 -1
- package/src/components/MessageBubble.tsx +162 -50
- package/src/components/constants.tsx +228 -0
- package/src/config/RagConfig.ts +48 -2
- package/src/config/constants.ts +4 -0
- package/src/config/serverConfig.ts +15 -0
- package/src/core/ConfigResolver.ts +38 -6
- package/src/core/DatabaseStorage.ts +469 -0
- package/src/core/LicenseVerifier.ts +260 -0
- package/src/core/MultiAgentCoordinator.ts +239 -0
- package/src/core/Pipeline.ts +151 -18
- package/src/core/Retrivora.ts +7 -0
- package/src/core/VectorPlugin.ts +12 -3
- package/src/core/mcp.ts +261 -0
- package/src/handlers/index.ts +449 -63
- package/src/hooks/useRagChat.ts +96 -42
- package/src/hooks/useStoredMessages.ts +15 -4
- package/src/index.ts +3 -0
- package/src/llm/LLMFactory.ts +9 -1
- package/src/llm/providers/GroqProvider.ts +176 -0
- package/src/llm/providers/QwenProvider.ts +191 -0
- package/src/server.ts +7 -0
- package/src/types/chat.ts +14 -0
- package/src/types/props.ts +12 -0
- package/.env.example +0 -80
- package/LICENSE.txt +0 -21
- package/src/components/AmbientBackground.tsx +0 -29
- package/src/components/ArchitectureCard.tsx +0 -17
- package/src/components/ArchitectureCardsSection.tsx +0 -15
- package/src/components/DocViewer.tsx +0 -103
- package/src/components/Documentation.tsx +0 -121
- package/src/components/Hero.tsx +0 -59
- package/src/components/Lifecycle.tsx +0 -37
- package/src/components/Navbar.tsx +0 -55
package/dist/index.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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 RetrievalConfig, m as RetrievedChunk, T as TokenUsage, n as UniversalRagConfig, o as UpsertDocument, p as VectorDBConfig, q as VectorDBProvider, W as WorkflowConfig } from './ILLMProvider-
|
|
5
|
-
export { A as AuthenticationException, C as Chunk, a as ChunkOptions, b as ConfigurationException, E as EmbeddingFailedException, P as ProviderNotFoundException, R as RateLimitException, c as RetrievalException, d as Retrivora, e as RetrivoraError, f as RetrivoraErrorCode } from './index-
|
|
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-DMxLyTdq.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 RetrievalConfig, m as RetrievedChunk, T as TokenUsage, n as UniversalRagConfig, o as UpsertDocument, p as VectorDBConfig, q as VectorDBProvider, W as WorkflowConfig } from './ILLMProvider-DMxLyTdq.mjs';
|
|
5
|
+
export { A as AuthenticationException, C as Chunk, a as ChunkOptions, b as ConfigurationException, E as EmbeddingFailedException, P as ProviderNotFoundException, R as RateLimitException, c as RetrievalException, d as Retrivora, e as RetrivoraError, f as RetrivoraErrorCode } from './index-xygonxpW.mjs';
|
|
6
6
|
|
|
7
7
|
type ChatViewportSize = 'compact' | 'medium' | 'large';
|
|
8
8
|
interface ChatWindowProps {
|
|
@@ -28,6 +28,11 @@ interface ChatWindowProps {
|
|
|
28
28
|
onAddToCart?: (product: Product) => void;
|
|
29
29
|
/** Optional custom API URL to send chat messages to */
|
|
30
30
|
apiUrl?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Base URL for Retrivora SDK history/feedback/sessions endpoints.
|
|
33
|
+
* Defaults to '/api/retrivora'. Set this to match your catch-all route location.
|
|
34
|
+
*/
|
|
35
|
+
retrivoraApiBase?: string;
|
|
31
36
|
/** Optional custom headers to send with the chat request */
|
|
32
37
|
headers?: Record<string, string>;
|
|
33
38
|
}
|
|
@@ -38,6 +43,11 @@ interface ChatWidgetProps {
|
|
|
38
43
|
onAddToCart?: (product: Product) => void;
|
|
39
44
|
/** Optional custom API URL to send chat messages to */
|
|
40
45
|
apiUrl?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Base URL for Retrivora SDK history/feedback/sessions endpoints.
|
|
48
|
+
* Defaults to '/api/retrivora'.
|
|
49
|
+
*/
|
|
50
|
+
retrivoraApiBase?: string;
|
|
41
51
|
/** Optional custom headers to send with the chat request */
|
|
42
52
|
headers?: Record<string, string>;
|
|
43
53
|
}
|
|
@@ -49,6 +59,8 @@ interface MessageBubbleProps {
|
|
|
49
59
|
accentColor: string;
|
|
50
60
|
onAddToCart?: (product: Product) => void;
|
|
51
61
|
viewportSize?: ChatViewportSize;
|
|
62
|
+
/** Called when the user clicks thumbs up or thumbs down on an assistant message */
|
|
63
|
+
onFeedback?: (messageId: string, rating: 'thumbs_up' | 'thumbs_down') => void;
|
|
52
64
|
}
|
|
53
65
|
interface ProductCardProps {
|
|
54
66
|
product: Product;
|
|
@@ -92,13 +104,13 @@ interface ConfigProviderProps {
|
|
|
92
104
|
children: ReactNode;
|
|
93
105
|
}
|
|
94
106
|
|
|
95
|
-
declare function ChatWidget({ position, onAddToCart, apiUrl, headers }: ChatWidgetProps): react_jsx_runtime.JSX.Element | null;
|
|
107
|
+
declare function ChatWidget({ position, onAddToCart, apiUrl, retrivoraApiBase, headers }: ChatWidgetProps): react_jsx_runtime.JSX.Element | null;
|
|
96
108
|
|
|
97
|
-
declare function ChatWindow({ className, style, onClose, showClose, onResizeStart, onResetResize, isResized, onMaximize, isMaximized, onAddToCart, apiUrl, headers }: ChatWindowProps): react_jsx_runtime.JSX.Element;
|
|
109
|
+
declare function ChatWindow({ className, style, onClose, showClose, onResizeStart, onResetResize, isResized, onMaximize, isMaximized, onAddToCart, apiUrl, retrivoraApiBase, headers }: ChatWindowProps): react_jsx_runtime.JSX.Element;
|
|
98
110
|
|
|
99
111
|
declare function DocumentUpload({ namespace, onUploadComplete, className }: DocumentUploadProps): react_jsx_runtime.JSX.Element;
|
|
100
112
|
|
|
101
|
-
declare function MessageBubble({ message, sources, isStreaming, primaryColor, accentColor, onAddToCart, viewportSize, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
113
|
+
declare function MessageBubble({ message, sources, isStreaming, primaryColor, accentColor, onAddToCart, viewportSize, onFeedback, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
102
114
|
|
|
103
115
|
declare function SourceCard({ source, index }: SourceCardProps): react_jsx_runtime.JSX.Element;
|
|
104
116
|
|
|
@@ -111,6 +123,22 @@ declare function ObservabilityPanel({ trace, primaryColor }: ObservabilityPanelP
|
|
|
111
123
|
declare function ConfigProvider({ config, children, }: ConfigProviderProps): react_jsx_runtime.JSX.Element;
|
|
112
124
|
declare function useConfig(): ClientConfig;
|
|
113
125
|
|
|
126
|
+
interface Snippet {
|
|
127
|
+
id: string;
|
|
128
|
+
title: string;
|
|
129
|
+
description: string;
|
|
130
|
+
code: string;
|
|
131
|
+
language: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
declare function CodeViewer({ snippet }: {
|
|
135
|
+
snippet: Snippet;
|
|
136
|
+
}): react_jsx_runtime.JSX.Element;
|
|
137
|
+
|
|
138
|
+
declare function ProductCard({ product, primaryColor, onAddToCart }: ProductCardProps): react_jsx_runtime.JSX.Element;
|
|
139
|
+
|
|
140
|
+
declare function ProductCarousel({ products, primaryColor, onAddToCart }: ProductCarouselProps): react_jsx_runtime.JSX.Element | null;
|
|
141
|
+
|
|
114
142
|
declare function useRagChat(projectId: string, options?: UseRagChatOptions): UseRagChatReturn;
|
|
115
143
|
|
|
116
144
|
/**
|
|
@@ -119,4 +147,4 @@ declare function useRagChat(projectId: string, options?: UseRagChatOptions): Use
|
|
|
119
147
|
*/
|
|
120
148
|
declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
|
|
121
149
|
|
|
122
|
-
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 };
|
|
150
|
+
export { ChatWidget, type ChatWidgetProps, ChatWindow, type ChatWindowProps, type ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, type DocumentUploadProps, MessageBubble, type MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, type ProductCardProps, ProductCarousel, type ProductCarouselProps, RagMessage, SourceCard, type SourceCardProps, UIConfig, UseRagChatOptions, UseRagChatReturn, VectorMatch, addSynonyms, useConfig, useRagChat };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
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 RetrievalConfig, m as RetrievedChunk, T as TokenUsage, n as UniversalRagConfig, o as UpsertDocument, p as VectorDBConfig, q as VectorDBProvider, W as WorkflowConfig } from './ILLMProvider-
|
|
5
|
-
export { A as AuthenticationException, C as Chunk, a as ChunkOptions, b as ConfigurationException, E as EmbeddingFailedException, P as ProviderNotFoundException, R as RateLimitException, c as RetrievalException, d as Retrivora, e as RetrivoraError, f as RetrivoraErrorCode } from './index-
|
|
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-DMxLyTdq.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 RetrievalConfig, m as RetrievedChunk, T as TokenUsage, n as UniversalRagConfig, o as UpsertDocument, p as VectorDBConfig, q as VectorDBProvider, W as WorkflowConfig } from './ILLMProvider-DMxLyTdq.js';
|
|
5
|
+
export { A as AuthenticationException, C as Chunk, a as ChunkOptions, b as ConfigurationException, E as EmbeddingFailedException, P as ProviderNotFoundException, R as RateLimitException, c as RetrievalException, d as Retrivora, e as RetrivoraError, f as RetrivoraErrorCode } from './index-CfkqZd2Y.js';
|
|
6
6
|
|
|
7
7
|
type ChatViewportSize = 'compact' | 'medium' | 'large';
|
|
8
8
|
interface ChatWindowProps {
|
|
@@ -28,6 +28,11 @@ interface ChatWindowProps {
|
|
|
28
28
|
onAddToCart?: (product: Product) => void;
|
|
29
29
|
/** Optional custom API URL to send chat messages to */
|
|
30
30
|
apiUrl?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Base URL for Retrivora SDK history/feedback/sessions endpoints.
|
|
33
|
+
* Defaults to '/api/retrivora'. Set this to match your catch-all route location.
|
|
34
|
+
*/
|
|
35
|
+
retrivoraApiBase?: string;
|
|
31
36
|
/** Optional custom headers to send with the chat request */
|
|
32
37
|
headers?: Record<string, string>;
|
|
33
38
|
}
|
|
@@ -38,6 +43,11 @@ interface ChatWidgetProps {
|
|
|
38
43
|
onAddToCart?: (product: Product) => void;
|
|
39
44
|
/** Optional custom API URL to send chat messages to */
|
|
40
45
|
apiUrl?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Base URL for Retrivora SDK history/feedback/sessions endpoints.
|
|
48
|
+
* Defaults to '/api/retrivora'.
|
|
49
|
+
*/
|
|
50
|
+
retrivoraApiBase?: string;
|
|
41
51
|
/** Optional custom headers to send with the chat request */
|
|
42
52
|
headers?: Record<string, string>;
|
|
43
53
|
}
|
|
@@ -49,6 +59,8 @@ interface MessageBubbleProps {
|
|
|
49
59
|
accentColor: string;
|
|
50
60
|
onAddToCart?: (product: Product) => void;
|
|
51
61
|
viewportSize?: ChatViewportSize;
|
|
62
|
+
/** Called when the user clicks thumbs up or thumbs down on an assistant message */
|
|
63
|
+
onFeedback?: (messageId: string, rating: 'thumbs_up' | 'thumbs_down') => void;
|
|
52
64
|
}
|
|
53
65
|
interface ProductCardProps {
|
|
54
66
|
product: Product;
|
|
@@ -92,13 +104,13 @@ interface ConfigProviderProps {
|
|
|
92
104
|
children: ReactNode;
|
|
93
105
|
}
|
|
94
106
|
|
|
95
|
-
declare function ChatWidget({ position, onAddToCart, apiUrl, headers }: ChatWidgetProps): react_jsx_runtime.JSX.Element | null;
|
|
107
|
+
declare function ChatWidget({ position, onAddToCart, apiUrl, retrivoraApiBase, headers }: ChatWidgetProps): react_jsx_runtime.JSX.Element | null;
|
|
96
108
|
|
|
97
|
-
declare function ChatWindow({ className, style, onClose, showClose, onResizeStart, onResetResize, isResized, onMaximize, isMaximized, onAddToCart, apiUrl, headers }: ChatWindowProps): react_jsx_runtime.JSX.Element;
|
|
109
|
+
declare function ChatWindow({ className, style, onClose, showClose, onResizeStart, onResetResize, isResized, onMaximize, isMaximized, onAddToCart, apiUrl, retrivoraApiBase, headers }: ChatWindowProps): react_jsx_runtime.JSX.Element;
|
|
98
110
|
|
|
99
111
|
declare function DocumentUpload({ namespace, onUploadComplete, className }: DocumentUploadProps): react_jsx_runtime.JSX.Element;
|
|
100
112
|
|
|
101
|
-
declare function MessageBubble({ message, sources, isStreaming, primaryColor, accentColor, onAddToCart, viewportSize, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
113
|
+
declare function MessageBubble({ message, sources, isStreaming, primaryColor, accentColor, onAddToCart, viewportSize, onFeedback, }: MessageBubbleProps): react_jsx_runtime.JSX.Element;
|
|
102
114
|
|
|
103
115
|
declare function SourceCard({ source, index }: SourceCardProps): react_jsx_runtime.JSX.Element;
|
|
104
116
|
|
|
@@ -111,6 +123,22 @@ declare function ObservabilityPanel({ trace, primaryColor }: ObservabilityPanelP
|
|
|
111
123
|
declare function ConfigProvider({ config, children, }: ConfigProviderProps): react_jsx_runtime.JSX.Element;
|
|
112
124
|
declare function useConfig(): ClientConfig;
|
|
113
125
|
|
|
126
|
+
interface Snippet {
|
|
127
|
+
id: string;
|
|
128
|
+
title: string;
|
|
129
|
+
description: string;
|
|
130
|
+
code: string;
|
|
131
|
+
language: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
declare function CodeViewer({ snippet }: {
|
|
135
|
+
snippet: Snippet;
|
|
136
|
+
}): react_jsx_runtime.JSX.Element;
|
|
137
|
+
|
|
138
|
+
declare function ProductCard({ product, primaryColor, onAddToCart }: ProductCardProps): react_jsx_runtime.JSX.Element;
|
|
139
|
+
|
|
140
|
+
declare function ProductCarousel({ products, primaryColor, onAddToCart }: ProductCarouselProps): react_jsx_runtime.JSX.Element | null;
|
|
141
|
+
|
|
114
142
|
declare function useRagChat(projectId: string, options?: UseRagChatOptions): UseRagChatReturn;
|
|
115
143
|
|
|
116
144
|
/**
|
|
@@ -119,4 +147,4 @@ declare function useRagChat(projectId: string, options?: UseRagChatOptions): Use
|
|
|
119
147
|
*/
|
|
120
148
|
declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
|
|
121
149
|
|
|
122
|
-
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 };
|
|
150
|
+
export { ChatWidget, type ChatWidgetProps, ChatWindow, type ChatWindowProps, type ClientConfig, CodeViewer, ConfigProvider, DocumentUpload, type DocumentUploadProps, MessageBubble, type MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, ProductCard, type ProductCardProps, ProductCarousel, type ProductCarouselProps, RagMessage, SourceCard, type SourceCardProps, UIConfig, UseRagChatOptions, UseRagChatReturn, VectorMatch, addSynonyms, useConfig, useRagChat };
|