@retrivora-ai/rag-engine 1.9.7 → 1.9.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/README.md +127 -135
- package/dist/{ILLMProvider-Bhk6zJOK.d.mts → ILLMProvider-B8ROITYK.d.mts} +57 -2
- package/dist/{ILLMProvider-Bhk6zJOK.d.ts → ILLMProvider-B8ROITYK.d.ts} +57 -2
- package/dist/handlers/index.d.mts +2 -2
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.js +2198 -457
- package/dist/handlers/index.mjs +2195 -457
- package/dist/{index-BJ4cd-t5.d.mts → index-B8PbEFSY.d.mts} +12 -2
- package/dist/{index-Bu7T6xgr.d.ts → index-BCPKUAVL.d.ts} +27 -52
- package/dist/{index-C3SVtPYg.d.mts → index-CrxCy36A.d.mts} +27 -52
- package/dist/{index-B9J_XEh0.d.ts → index-DNvoi-sV.d.ts} +12 -2
- package/dist/index.css +578 -273
- package/dist/index.d.mts +29 -7
- package/dist/index.d.ts +29 -7
- package/dist/index.js +1160 -282
- package/dist/index.mjs +1185 -292
- package/dist/server.d.mts +62 -6
- package/dist/server.d.ts +62 -6
- package/dist/server.js +2061 -306
- package/dist/server.mjs +2055 -306
- package/package.json +11 -7
- package/src/app/constants.tsx +37 -7
- package/src/components/AmbientBackground.tsx +10 -10
- package/src/components/ArchitectureCard.tsx +43 -7
- package/src/components/ArchitectureCardsSection.tsx +37 -4
- package/src/components/ChatWidget.tsx +2 -1
- package/src/components/ChatWindow.tsx +4 -1
- package/src/components/CodeViewer.tsx +19 -14
- package/src/components/DocViewer.tsx +43 -49
- package/src/components/Documentation.tsx +71 -51
- package/src/components/Hero.tsx +103 -20
- package/src/components/Lifecycle.tsx +65 -25
- package/src/components/MarkdownComponents.tsx +44 -1
- package/src/components/MessageBubble.tsx +162 -50
- package/src/components/constants.tsx +4 -0
- package/src/config/RagConfig.ts +46 -0
- package/src/config/constants.ts +4 -0
- package/src/config/serverConfig.ts +15 -0
- package/src/core/ConfigResolver.ts +6 -0
- package/src/core/DatabaseStorage.ts +469 -0
- package/src/core/LicenseVerifier.ts +154 -0
- package/src/core/MultiAgentCoordinator.ts +239 -0
- package/src/core/Pipeline.ts +146 -15
- package/src/core/Retrivora.ts +6 -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 +5 -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/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-B8ROITYK.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-B8ROITYK.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-B8PbEFSY.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,16 @@ 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
|
+
declare function Hero(): react_jsx_runtime.JSX.Element;
|
|
127
|
+
|
|
128
|
+
declare function Lifecycle(): react_jsx_runtime.JSX.Element;
|
|
129
|
+
|
|
130
|
+
declare function ArchitectureCardsSection(): react_jsx_runtime.JSX.Element;
|
|
131
|
+
|
|
132
|
+
declare function Documentation(): react_jsx_runtime.JSX.Element;
|
|
133
|
+
|
|
134
|
+
declare function AmbientBackground(): react_jsx_runtime.JSX.Element;
|
|
135
|
+
|
|
114
136
|
declare function useRagChat(projectId: string, options?: UseRagChatOptions): UseRagChatReturn;
|
|
115
137
|
|
|
116
138
|
/**
|
|
@@ -119,4 +141,4 @@ declare function useRagChat(projectId: string, options?: UseRagChatOptions): Use
|
|
|
119
141
|
*/
|
|
120
142
|
declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
|
|
121
143
|
|
|
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 };
|
|
144
|
+
export { AmbientBackground, ArchitectureCardsSection, ChatWidget, type ChatWidgetProps, ChatWindow, type ChatWindowProps, type ClientConfig, ConfigProvider, DocumentUpload, type DocumentUploadProps, Documentation, Hero, Lifecycle, 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,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-B8ROITYK.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-B8ROITYK.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-DNvoi-sV.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,16 @@ 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
|
+
declare function Hero(): react_jsx_runtime.JSX.Element;
|
|
127
|
+
|
|
128
|
+
declare function Lifecycle(): react_jsx_runtime.JSX.Element;
|
|
129
|
+
|
|
130
|
+
declare function ArchitectureCardsSection(): react_jsx_runtime.JSX.Element;
|
|
131
|
+
|
|
132
|
+
declare function Documentation(): react_jsx_runtime.JSX.Element;
|
|
133
|
+
|
|
134
|
+
declare function AmbientBackground(): react_jsx_runtime.JSX.Element;
|
|
135
|
+
|
|
114
136
|
declare function useRagChat(projectId: string, options?: UseRagChatOptions): UseRagChatReturn;
|
|
115
137
|
|
|
116
138
|
/**
|
|
@@ -119,4 +141,4 @@ declare function useRagChat(projectId: string, options?: UseRagChatOptions): Use
|
|
|
119
141
|
*/
|
|
120
142
|
declare function addSynonyms(customSynonyms: Record<string, string[]>): void;
|
|
121
143
|
|
|
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 };
|
|
144
|
+
export { AmbientBackground, ArchitectureCardsSection, ChatWidget, type ChatWidgetProps, ChatWindow, type ChatWindowProps, type ClientConfig, ConfigProvider, DocumentUpload, type DocumentUploadProps, Documentation, Hero, Lifecycle, MessageBubble, type MessageBubbleProps, ObservabilityPanel, ObservabilityTrace, type ProductCardProps, type ProductCarouselProps, RagMessage, SourceCard, type SourceCardProps, UIConfig, UseRagChatOptions, UseRagChatReturn, VectorMatch, addSynonyms, useConfig, useRagChat };
|