@retrivora-ai/rag-engine 2.3.9 → 2.4.0
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/{BatchProcessor-C42_RVWO.d.ts → BatchProcessor-D42E706a.d.ts} +12 -1
- package/dist/{BatchProcessor-BhLczWj5.d.mts → BatchProcessor-zbQMaZHm.d.mts} +12 -1
- package/dist/{ILLMProvider-B8TAVx3j.d.mts → ILLMProvider-Y6aL5N8J.d.mts} +1 -0
- package/dist/{ILLMProvider-B8TAVx3j.d.ts → ILLMProvider-Y6aL5N8J.d.ts} +1 -0
- package/dist/handlers/index.d.mts +2 -2
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.js +26 -24
- package/dist/handlers/index.mjs +26 -24
- package/dist/{index-C7aHK7_g.d.mts → index-59CHg0V3.d.mts} +1 -1
- package/dist/{index-BQd6Bax0.d.ts → index-BgKRInpa.d.ts} +1 -1
- package/dist/index.css +83 -0
- package/dist/index.d.mts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +490 -254
- package/dist/index.mjs +502 -263
- package/dist/server.d.mts +8 -6
- package/dist/server.d.ts +8 -6
- package/dist/server.js +28 -25
- package/dist/server.mjs +28 -25
- package/package.json +1 -1
- package/src/components/ChatWindow.tsx +296 -28
- package/src/components/ConfigProvider.tsx +18 -1
- package/src/config/LicenseConfigResolver.ts +3 -1
- package/src/config/RagConfig.ts +1 -0
- package/src/config/serverConfig.ts +7 -5
- package/src/config/uiConstants.ts +1 -0
- package/src/handlers/index.ts +7 -1
- package/src/index.css +83 -0
- package/src/types/props.ts +11 -0
package/dist/server.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { V as VectorDBConfig, L as LLMConfig, d as EmbeddingConfig, n as RagConfig, t as UniversalRagConfig, u as UpsertDocument, w as VectorMatch, G as GraphDBConfig, D as GraphNode, F as Edge, H as GraphSearchResult, I as ILLMProvider, v as VectorDBProvider, g as LLMProvider, e as EmbeddingProvider, R as RAGConfig, s as UIConfig, J as UITransformationResponse, C as ChatMessage, b as ChatOptions, E as EmbedOptions, f as IngestDocument, c as ChatResponse } from './ILLMProvider-
|
|
2
|
-
export { A as AuthMode, K as BarChartData, M as CarouselProduct, N as IRetriever, h as LatencyBreakdown, Q as LineChartDataPoint, S as MessageRole, X as MetricCardData, O as ObservabilityTrace, Y as PieChartData, Z as Product, i as ProjectAiSettings, j as ProjectAuthSettings, k as ProjectBrandingSettings, P as ProjectChatSettings, l as ProjectTelemetrySettings, m as ProjectWidgetSettings, o as RagMessage, p as RetrievalConfig, _ as RetrievalResult, q as RetrievedChunk, $ as RetrivoraChunkMetadata, a0 as RetrivoraIngestedDocument, a1 as ScatterPlotDataPoint, a2 as SuggestionsResponse, a3 as TableData, T as ThemeMode, r as TokenUsage, U as UseRagChatOptions, a as UseRagChatReturn, a4 as VisualizationType, W as WidgetPosition, x as WorkflowConfig, y as createDefaultProjectSettings, z as normalizeProjectSettings, B as projectSettingsToUiConfig } from './ILLMProvider-
|
|
3
|
-
import { l as DecisionContext, n as IntentCategory, I as IRenderRule, y as RenderDecision, m as IRendererStrategy } from './BatchProcessor-
|
|
4
|
-
export { Q as ArchitectureCardProps, A as AuthenticationException, B as BatchOptions, e as BatchProcessor, f as BatchResult, g as ChartType, T as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, h as Chunk, i as ChunkOptions, c as ClientConfig, j as ConfigFetcher, b as ConfigProviderProps, k as ConfigurationException, U as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, V as LicenseConfigResolver, L as LicenseTierConfig, o as LicenseValidationError, p as LicenseValidationRequest, q as LicenseValidationResponse, r as LicenseValidator, M as MessageBubbleProps, W as Pipeline, X as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, s as ProviderCredentials, t as ProviderNotFoundException, Y as ProviderPill, u as RateLimitException, R as RemoteConfig, v as RemoteEmbeddingConfig, w as RemoteLLMConfig, x as RemoteVectorConfig, Z as RenderSectionDecision, z as RenderType, F as RetrievalException, G as Retrivora, H as RetrivoraError, J as RetrivoraErrorCode, K as SDKVersionUnsupportedError, N as SDK_VERSION, _ as Snippet, S as SourceCardProps, $ as wrapError } from './BatchProcessor-
|
|
5
|
-
import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } 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 { V as VectorDBConfig, L as LLMConfig, d as EmbeddingConfig, n as RagConfig, t as UniversalRagConfig, u as UpsertDocument, w as VectorMatch, G as GraphDBConfig, D as GraphNode, F as Edge, H as GraphSearchResult, I as ILLMProvider, v as VectorDBProvider, g as LLMProvider, e as EmbeddingProvider, R as RAGConfig, s as UIConfig, J as UITransformationResponse, C as ChatMessage, b as ChatOptions, E as EmbedOptions, f as IngestDocument, c as ChatResponse } from './ILLMProvider-Y6aL5N8J.mjs';
|
|
2
|
+
export { A as AuthMode, K as BarChartData, M as CarouselProduct, N as IRetriever, h as LatencyBreakdown, Q as LineChartDataPoint, S as MessageRole, X as MetricCardData, O as ObservabilityTrace, Y as PieChartData, Z as Product, i as ProjectAiSettings, j as ProjectAuthSettings, k as ProjectBrandingSettings, P as ProjectChatSettings, l as ProjectTelemetrySettings, m as ProjectWidgetSettings, o as RagMessage, p as RetrievalConfig, _ as RetrievalResult, q as RetrievedChunk, $ as RetrivoraChunkMetadata, a0 as RetrivoraIngestedDocument, a1 as ScatterPlotDataPoint, a2 as SuggestionsResponse, a3 as TableData, T as ThemeMode, r as TokenUsage, U as UseRagChatOptions, a as UseRagChatReturn, a4 as VisualizationType, W as WidgetPosition, x as WorkflowConfig, y as createDefaultProjectSettings, z as normalizeProjectSettings, B as projectSettingsToUiConfig } from './ILLMProvider-Y6aL5N8J.mjs';
|
|
3
|
+
import { l as DecisionContext, n as IntentCategory, I as IRenderRule, y as RenderDecision, m as IRendererStrategy } from './BatchProcessor-zbQMaZHm.mjs';
|
|
4
|
+
export { Q as ArchitectureCardProps, A as AuthenticationException, B as BatchOptions, e as BatchProcessor, f as BatchResult, g as ChartType, T as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, h as Chunk, i as ChunkOptions, c as ClientConfig, j as ConfigFetcher, b as ConfigProviderProps, k as ConfigurationException, U as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, V as LicenseConfigResolver, L as LicenseTierConfig, o as LicenseValidationError, p as LicenseValidationRequest, q as LicenseValidationResponse, r as LicenseValidator, M as MessageBubbleProps, W as Pipeline, X as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, s as ProviderCredentials, t as ProviderNotFoundException, Y as ProviderPill, u as RateLimitException, R as RemoteConfig, v as RemoteEmbeddingConfig, w as RemoteLLMConfig, x as RemoteVectorConfig, Z as RenderSectionDecision, z as RenderType, F as RetrievalException, G as Retrivora, H as RetrivoraError, J as RetrivoraErrorCode, K as SDKVersionUnsupportedError, N as SDK_VERSION, _ as Snippet, S as SourceCardProps, $ as wrapError } from './BatchProcessor-zbQMaZHm.mjs';
|
|
5
|
+
import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-59CHg0V3.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-59CHg0V3.mjs';
|
|
7
7
|
import 'react';
|
|
8
8
|
import 'next/server';
|
|
9
9
|
|
|
@@ -232,6 +232,8 @@ declare class ProviderRegistry {
|
|
|
232
232
|
interface RuntimeTierConfig {
|
|
233
233
|
llmModel?: string;
|
|
234
234
|
embeddingModel?: string;
|
|
235
|
+
/** Custom system prompt from project configuration */
|
|
236
|
+
systemPrompt?: string;
|
|
235
237
|
/** LiteLLM master key for authenticating with llm.retrivora.com */
|
|
236
238
|
litellmApiKey?: string;
|
|
237
239
|
/** LiteLLM gateway base URL (defaults to https://llm.retrivora.com/api/v1) */
|
package/dist/server.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { V as VectorDBConfig, L as LLMConfig, d as EmbeddingConfig, n as RagConfig, t as UniversalRagConfig, u as UpsertDocument, w as VectorMatch, G as GraphDBConfig, D as GraphNode, F as Edge, H as GraphSearchResult, I as ILLMProvider, v as VectorDBProvider, g as LLMProvider, e as EmbeddingProvider, R as RAGConfig, s as UIConfig, J as UITransformationResponse, C as ChatMessage, b as ChatOptions, E as EmbedOptions, f as IngestDocument, c as ChatResponse } from './ILLMProvider-
|
|
2
|
-
export { A as AuthMode, K as BarChartData, M as CarouselProduct, N as IRetriever, h as LatencyBreakdown, Q as LineChartDataPoint, S as MessageRole, X as MetricCardData, O as ObservabilityTrace, Y as PieChartData, Z as Product, i as ProjectAiSettings, j as ProjectAuthSettings, k as ProjectBrandingSettings, P as ProjectChatSettings, l as ProjectTelemetrySettings, m as ProjectWidgetSettings, o as RagMessage, p as RetrievalConfig, _ as RetrievalResult, q as RetrievedChunk, $ as RetrivoraChunkMetadata, a0 as RetrivoraIngestedDocument, a1 as ScatterPlotDataPoint, a2 as SuggestionsResponse, a3 as TableData, T as ThemeMode, r as TokenUsage, U as UseRagChatOptions, a as UseRagChatReturn, a4 as VisualizationType, W as WidgetPosition, x as WorkflowConfig, y as createDefaultProjectSettings, z as normalizeProjectSettings, B as projectSettingsToUiConfig } from './ILLMProvider-
|
|
3
|
-
import { l as DecisionContext, n as IntentCategory, I as IRenderRule, y as RenderDecision, m as IRendererStrategy } from './BatchProcessor-
|
|
4
|
-
export { Q as ArchitectureCardProps, A as AuthenticationException, B as BatchOptions, e as BatchProcessor, f as BatchResult, g as ChartType, T as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, h as Chunk, i as ChunkOptions, c as ClientConfig, j as ConfigFetcher, b as ConfigProviderProps, k as ConfigurationException, U as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, V as LicenseConfigResolver, L as LicenseTierConfig, o as LicenseValidationError, p as LicenseValidationRequest, q as LicenseValidationResponse, r as LicenseValidator, M as MessageBubbleProps, W as Pipeline, X as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, s as ProviderCredentials, t as ProviderNotFoundException, Y as ProviderPill, u as RateLimitException, R as RemoteConfig, v as RemoteEmbeddingConfig, w as RemoteLLMConfig, x as RemoteVectorConfig, Z as RenderSectionDecision, z as RenderType, F as RetrievalException, G as Retrivora, H as RetrivoraError, J as RetrivoraErrorCode, K as SDKVersionUnsupportedError, N as SDK_VERSION, _ as Snippet, S as SourceCardProps, $ as wrapError } from './BatchProcessor-
|
|
5
|
-
import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } 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 { V as VectorDBConfig, L as LLMConfig, d as EmbeddingConfig, n as RagConfig, t as UniversalRagConfig, u as UpsertDocument, w as VectorMatch, G as GraphDBConfig, D as GraphNode, F as Edge, H as GraphSearchResult, I as ILLMProvider, v as VectorDBProvider, g as LLMProvider, e as EmbeddingProvider, R as RAGConfig, s as UIConfig, J as UITransformationResponse, C as ChatMessage, b as ChatOptions, E as EmbedOptions, f as IngestDocument, c as ChatResponse } from './ILLMProvider-Y6aL5N8J.js';
|
|
2
|
+
export { A as AuthMode, K as BarChartData, M as CarouselProduct, N as IRetriever, h as LatencyBreakdown, Q as LineChartDataPoint, S as MessageRole, X as MetricCardData, O as ObservabilityTrace, Y as PieChartData, Z as Product, i as ProjectAiSettings, j as ProjectAuthSettings, k as ProjectBrandingSettings, P as ProjectChatSettings, l as ProjectTelemetrySettings, m as ProjectWidgetSettings, o as RagMessage, p as RetrievalConfig, _ as RetrievalResult, q as RetrievedChunk, $ as RetrivoraChunkMetadata, a0 as RetrivoraIngestedDocument, a1 as ScatterPlotDataPoint, a2 as SuggestionsResponse, a3 as TableData, T as ThemeMode, r as TokenUsage, U as UseRagChatOptions, a as UseRagChatReturn, a4 as VisualizationType, W as WidgetPosition, x as WorkflowConfig, y as createDefaultProjectSettings, z as normalizeProjectSettings, B as projectSettingsToUiConfig } from './ILLMProvider-Y6aL5N8J.js';
|
|
3
|
+
import { l as DecisionContext, n as IntentCategory, I as IRenderRule, y as RenderDecision, m as IRendererStrategy } from './BatchProcessor-D42E706a.js';
|
|
4
|
+
export { Q as ArchitectureCardProps, A as AuthenticationException, B as BatchOptions, e as BatchProcessor, f as BatchResult, g as ChartType, T as ChatViewportSize, C as ChatWidgetProps, a as ChatWindowProps, h as Chunk, i as ChunkOptions, c as ClientConfig, j as ConfigFetcher, b as ConfigProviderProps, k as ConfigurationException, U as DocumentChunker, D as DocumentUploadProps, E as EmbeddingFailedException, V as LicenseConfigResolver, L as LicenseTierConfig, o as LicenseValidationError, p as LicenseValidationRequest, q as LicenseValidationResponse, r as LicenseValidator, M as MessageBubbleProps, W as Pipeline, X as PipelineStep, P as ProductCardProps, d as ProductCarouselProps, s as ProviderCredentials, t as ProviderNotFoundException, Y as ProviderPill, u as RateLimitException, R as RemoteConfig, v as RemoteEmbeddingConfig, w as RemoteLLMConfig, x as RemoteVectorConfig, Z as RenderSectionDecision, z as RenderType, F as RetrievalException, G as Retrivora, H as RetrivoraError, J as RetrivoraErrorCode, K as SDKVersionUnsupportedError, N as SDK_VERSION, _ as Snippet, S as SourceCardProps, $ as wrapError } from './BatchProcessor-D42E706a.js';
|
|
5
|
+
import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-BgKRInpa.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-BgKRInpa.js';
|
|
7
7
|
import 'react';
|
|
8
8
|
import 'next/server';
|
|
9
9
|
|
|
@@ -232,6 +232,8 @@ declare class ProviderRegistry {
|
|
|
232
232
|
interface RuntimeTierConfig {
|
|
233
233
|
llmModel?: string;
|
|
234
234
|
embeddingModel?: string;
|
|
235
|
+
/** Custom system prompt from project configuration */
|
|
236
|
+
systemPrompt?: string;
|
|
235
237
|
/** LiteLLM master key for authenticating with llm.retrivora.com */
|
|
236
238
|
litellmApiKey?: string;
|
|
237
239
|
/** LiteLLM gateway base URL (defaults to https://llm.retrivora.com/api/v1) */
|
package/dist/server.js
CHANGED
|
@@ -330,7 +330,7 @@ var init_package = __esm({
|
|
|
330
330
|
"package.json"() {
|
|
331
331
|
package_default = {
|
|
332
332
|
name: "@retrivora-ai/rag-engine",
|
|
333
|
-
version: "2.
|
|
333
|
+
version: "2.4.0",
|
|
334
334
|
description: "Retrivora AI is a plug-and-play AI engine for RAG chat experiences \u2014 generic vector DB + LLM provider, embeddable or standalone.",
|
|
335
335
|
author: "Abhinav Alkuchi",
|
|
336
336
|
license: "UNLICENSED",
|
|
@@ -3147,7 +3147,7 @@ function getRagConfig(baseConfig, env = process.env) {
|
|
|
3147
3147
|
return getEnvConfig(env, baseConfig);
|
|
3148
3148
|
}
|
|
3149
3149
|
function getEnvConfig(env = process.env, base) {
|
|
3150
|
-
var _a3, _b, _c, _d, _e, _f, _g2, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a, _ab, _bb, _cb, _db, _eb, _fb, _gb, _hb, _ib, _jb, _kb, _lb, _mb, _nb, _ob, _pb, _qb, _rb, _sb, _tb, _ub, _vb, _wb, _xb, _yb, _zb, _Ab, _Bb, _Cb, _Db, _Eb, _Fb, _Gb, _Hb, _Ib;
|
|
3150
|
+
var _a3, _b, _c, _d, _e, _f, _g2, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a, _ab, _bb, _cb, _db, _eb, _fb, _gb, _hb, _ib, _jb, _kb, _lb, _mb, _nb, _ob, _pb, _qb, _rb, _sb, _tb, _ub, _vb, _wb, _xb, _yb, _zb, _Ab, _Bb, _Cb, _Db, _Eb, _Fb, _Gb, _Hb, _Ib, _Jb, _Kb, _Lb, _Mb, _Nb;
|
|
3151
3151
|
const licenseKey = (_d = (_c = (_b = (_a3 = readString(env, "RAG_LICENSE_KEY")) != null ? _a3 : readString(env, "RETRIVORA_LICENSE_KEY")) != null ? _b : readString(env, "NEXT_PUBLIC_RETRIVORA_LICENSE_KEY")) != null ? _c : readString(env, "LICENSE_KEY")) != null ? _d : base == null ? void 0 : base.licenseKey;
|
|
3152
3152
|
const jwtProjectId = (() => {
|
|
3153
3153
|
if (!licenseKey) return void 0;
|
|
@@ -3282,8 +3282,8 @@ function getEnvConfig(env = process.env, base) {
|
|
|
3282
3282
|
model: llmModel,
|
|
3283
3283
|
apiKey: llmApiKey,
|
|
3284
3284
|
baseUrl: llmBaseUrl,
|
|
3285
|
-
systemPrompt: readString(env, "LLM_SYSTEM_PROMPT"),
|
|
3286
|
-
maxTokens: readNumber(env, "LLM_MAX_TOKENS", 4096),
|
|
3285
|
+
systemPrompt: (_hb = readString(env, "LLM_SYSTEM_PROMPT")) != null ? _hb : rt == null ? void 0 : rt.systemPrompt,
|
|
3286
|
+
maxTokens: readNumber(env, "LLM_MAX_TOKENS", (_ib = rt == null ? void 0 : rt.maxTokens) != null ? _ib : 4096),
|
|
3287
3287
|
temperature: readNumber(env, "LLM_TEMPERATURE", 0.7),
|
|
3288
3288
|
options: {
|
|
3289
3289
|
profile: llmProfile,
|
|
@@ -3304,30 +3304,30 @@ function getEnvConfig(env = process.env, base) {
|
|
|
3304
3304
|
}
|
|
3305
3305
|
},
|
|
3306
3306
|
ui: {
|
|
3307
|
-
title: (
|
|
3308
|
-
subtitle: (
|
|
3309
|
-
primaryColor: (
|
|
3310
|
-
accentColor: (
|
|
3311
|
-
logoUrl: (
|
|
3312
|
-
placeholder: (
|
|
3313
|
-
showSources: ((
|
|
3314
|
-
welcomeMessage: (
|
|
3315
|
-
visualStyle: (
|
|
3316
|
-
borderRadius: (
|
|
3317
|
-
allowUpload: ((
|
|
3307
|
+
title: (_kb = (_jb = readString(env, "NEXT_PUBLIC_UI_TITLE")) != null ? _jb : readString(env, "UI_TITLE")) != null ? _kb : "AI Assistant",
|
|
3308
|
+
subtitle: (_mb = (_lb = readString(env, "NEXT_PUBLIC_UI_SUBTITLE")) != null ? _lb : readString(env, "UI_SUBTITLE")) != null ? _mb : "Powered by RAG",
|
|
3309
|
+
primaryColor: (_ob = (_nb = readString(env, "NEXT_PUBLIC_PRIMARY_COLOR")) != null ? _nb : readString(env, "UI_PRIMARY_COLOR")) != null ? _ob : "#10b981",
|
|
3310
|
+
accentColor: (_qb = (_pb = readString(env, "NEXT_PUBLIC_ACCENT_COLOR")) != null ? _pb : readString(env, "UI_ACCENT_COLOR")) != null ? _qb : "#3b82f6",
|
|
3311
|
+
logoUrl: (_rb = readString(env, "NEXT_PUBLIC_LOGO_URL")) != null ? _rb : readString(env, "UI_LOGO_URL"),
|
|
3312
|
+
placeholder: (_tb = (_sb = readString(env, "NEXT_PUBLIC_PLACEHOLDER")) != null ? _sb : readString(env, "UI_PLACEHOLDER")) != null ? _tb : "Ask me anything\u2026",
|
|
3313
|
+
showSources: ((_vb = (_ub = readString(env, "NEXT_PUBLIC_SHOW_SOURCES")) != null ? _ub : readString(env, "UI_SHOW_SOURCES")) != null ? _vb : "true") !== "false",
|
|
3314
|
+
welcomeMessage: (_xb = (_wb = readString(env, "NEXT_PUBLIC_WELCOME_MESSAGE")) != null ? _wb : readString(env, "UI_WELCOME_MESSAGE")) != null ? _xb : "Hello! I'm your AI assistant. Ask me anything about your documents.",
|
|
3315
|
+
visualStyle: (_zb = (_yb = readString(env, "NEXT_PUBLIC_UI_VISUAL_STYLE")) != null ? _yb : readString(env, "UI_VISUAL_STYLE")) != null ? _zb : "glass",
|
|
3316
|
+
borderRadius: (_Bb = (_Ab = readString(env, "NEXT_PUBLIC_UI_BORDER_RADIUS")) != null ? _Ab : readString(env, "UI_BORDER_RADIUS")) != null ? _Bb : "xl",
|
|
3317
|
+
allowUpload: ((_Db = (_Cb = readString(env, "NEXT_PUBLIC_ALLOW_UPLOAD")) != null ? _Cb : readString(env, "UI_ALLOW_UPLOAD")) != null ? _Db : "false") === "true"
|
|
3318
3318
|
},
|
|
3319
3319
|
rag: {
|
|
3320
|
-
topK: readNumber(env, "RAG_TOP_K", 5),
|
|
3320
|
+
topK: readNumber(env, "RAG_TOP_K", (_Eb = rt == null ? void 0 : rt.topK) != null ? _Eb : 5),
|
|
3321
3321
|
scoreThreshold: readNumber(env, "RAG_SCORE_THRESHOLD", 0),
|
|
3322
|
-
chunkSize: readNumber(env, "RAG_CHUNK_SIZE", 1e3),
|
|
3323
|
-
chunkOverlap: readNumber(env, "RAG_CHUNK_OVERLAP", 200),
|
|
3324
|
-
filterableFields: (
|
|
3322
|
+
chunkSize: readNumber(env, "RAG_CHUNK_SIZE", (_Fb = rt == null ? void 0 : rt.chunkSize) != null ? _Fb : 1e3),
|
|
3323
|
+
chunkOverlap: readNumber(env, "RAG_CHUNK_OVERLAP", (_Gb = rt == null ? void 0 : rt.chunkOverlap) != null ? _Gb : 200),
|
|
3324
|
+
filterableFields: (_Hb = readString(env, "RAG_FILTERABLE_FIELDS")) == null ? void 0 : _Hb.split(",").map((f) => f.trim()),
|
|
3325
3325
|
// Query pipeline toggles — read from .env.local
|
|
3326
3326
|
useQueryTransformation: readString(env, "RAG_USE_QUERY_TRANSFORMATION") === "true",
|
|
3327
3327
|
useReranking: readString(env, "RAG_USE_RERANKING") === "true",
|
|
3328
3328
|
useGraphRetrieval: readString(env, "RAG_USE_GRAPH_RETRIEVAL") === "true",
|
|
3329
|
-
architecture: (
|
|
3330
|
-
chunkingStrategy: (
|
|
3329
|
+
architecture: (_Ib = readString(env, "RAG_ARCHITECTURE")) != null ? _Ib : "simple",
|
|
3330
|
+
chunkingStrategy: (_Jb = readString(env, "RAG_CHUNKING_STRATEGY")) != null ? _Jb : "recursive",
|
|
3331
3331
|
uiMapping: (() => {
|
|
3332
3332
|
const raw = readString(env, "RAG_UI_MAPPING");
|
|
3333
3333
|
if (!raw) return void 0;
|
|
@@ -3340,7 +3340,7 @@ function getEnvConfig(env = process.env, base) {
|
|
|
3340
3340
|
},
|
|
3341
3341
|
telemetry: {
|
|
3342
3342
|
enabled: telemetryEnabled,
|
|
3343
|
-
url: (
|
|
3343
|
+
url: (_Nb = (_Mb = (_Kb = readString(env, "TELEMETRY_URL")) != null ? _Kb : readString(env, "NEXT_PUBLIC_TELEMETRY_URL")) != null ? _Mb : (_Lb = base == null ? void 0 : base.telemetry) == null ? void 0 : _Lb.url) != null ? _Nb : "https://www.retrivora.com/api/telemetry"
|
|
3344
3344
|
}
|
|
3345
3345
|
}, readString(env, "GRAPH_DB_PROVIDER") ? {
|
|
3346
3346
|
graphDb: {
|
|
@@ -12390,7 +12390,7 @@ function createRagHandler(configOrPlugin, options) {
|
|
|
12390
12390
|
}
|
|
12391
12391
|
}
|
|
12392
12392
|
async function getSegment(req, context) {
|
|
12393
|
-
var _a3, _b;
|
|
12393
|
+
var _a3, _b, _c;
|
|
12394
12394
|
const contentType = req.headers.get("content-type") || "";
|
|
12395
12395
|
if (contentType.includes("multipart/form-data")) {
|
|
12396
12396
|
return "upload";
|
|
@@ -12405,10 +12405,12 @@ function createRagHandler(configOrPlugin, options) {
|
|
|
12405
12405
|
if (pathname.endsWith("/suggestions")) return "suggestions";
|
|
12406
12406
|
if (pathname.endsWith("/feedback")) return "feedback";
|
|
12407
12407
|
if (pathname.endsWith("/history")) return "history";
|
|
12408
|
+
if (pathname.endsWith("/history/clear")) return "history/clear";
|
|
12409
|
+
if (pathname.endsWith("/sessions")) return "sessions";
|
|
12408
12410
|
} catch (e) {
|
|
12409
12411
|
}
|
|
12410
12412
|
const resolvedParams = typeof ((_a3 = context == null ? void 0 : context.params) == null ? void 0 : _a3.then) === "function" ? await context.params : context == null ? void 0 : context.params;
|
|
12411
|
-
const segments = (resolvedParams == null ? void 0 : resolvedParams.retrivora) || ((_b = resolvedParams == null ? void 0 : resolvedParams.params) == null ? void 0 : _b.retrivora) || [];
|
|
12413
|
+
const segments = (resolvedParams == null ? void 0 : resolvedParams.retrivora) || ((_b = resolvedParams == null ? void 0 : resolvedParams.params) == null ? void 0 : _b.retrivora) || (resolvedParams == null ? void 0 : resolvedParams.rag) || ((_c = resolvedParams == null ? void 0 : resolvedParams.params) == null ? void 0 : _c.rag) || [];
|
|
12412
12414
|
const joined = segments.join("/");
|
|
12413
12415
|
return joined || "chat";
|
|
12414
12416
|
}
|
|
@@ -12716,8 +12718,9 @@ var LicenseConfigResolver = class {
|
|
|
12716
12718
|
provider: llmProvider,
|
|
12717
12719
|
model: tierConfig.llmModel,
|
|
12718
12720
|
apiKey: llmApiKey,
|
|
12719
|
-
maxTokens: tierConfig.maxTokens,
|
|
12721
|
+
maxTokens: tierConfig == null ? void 0 : tierConfig.maxTokens,
|
|
12720
12722
|
temperature: 0.7,
|
|
12723
|
+
systemPrompt: tierConfig == null ? void 0 : tierConfig.systemPrompt,
|
|
12721
12724
|
options: {}
|
|
12722
12725
|
};
|
|
12723
12726
|
const embeddingConfig = {
|
package/dist/server.mjs
CHANGED
|
@@ -315,7 +315,7 @@ var init_package = __esm({
|
|
|
315
315
|
"package.json"() {
|
|
316
316
|
package_default = {
|
|
317
317
|
name: "@retrivora-ai/rag-engine",
|
|
318
|
-
version: "2.
|
|
318
|
+
version: "2.4.0",
|
|
319
319
|
description: "Retrivora AI is a plug-and-play AI engine for RAG chat experiences \u2014 generic vector DB + LLM provider, embeddable or standalone.",
|
|
320
320
|
author: "Abhinav Alkuchi",
|
|
321
321
|
license: "UNLICENSED",
|
|
@@ -3033,7 +3033,7 @@ function getRagConfig(baseConfig, env = process.env) {
|
|
|
3033
3033
|
return getEnvConfig(env, baseConfig);
|
|
3034
3034
|
}
|
|
3035
3035
|
function getEnvConfig(env = process.env, base) {
|
|
3036
|
-
var _a3, _b, _c, _d, _e, _f, _g2, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a, _ab, _bb, _cb, _db, _eb, _fb, _gb, _hb, _ib, _jb, _kb, _lb, _mb, _nb, _ob, _pb, _qb, _rb, _sb, _tb, _ub, _vb, _wb, _xb, _yb, _zb, _Ab, _Bb, _Cb, _Db, _Eb, _Fb, _Gb, _Hb, _Ib;
|
|
3036
|
+
var _a3, _b, _c, _d, _e, _f, _g2, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F, _G, _H, _I, _J, _K, _L, _M, _N, _O, _P, _Q, _R, _S, _T, _U, _V, _W, _X, _Y, _Z, __, _$, _aa, _ba, _ca, _da, _ea, _fa, _ga, _ha, _ia, _ja, _ka, _la, _ma, _na, _oa, _pa, _qa, _ra, _sa, _ta, _ua, _va, _wa, _xa, _ya, _za, _Aa, _Ba, _Ca, _Da, _Ea, _Fa, _Ga, _Ha, _Ia, _Ja, _Ka, _La, _Ma, _Na, _Oa, _Pa, _Qa, _Ra, _Sa, _Ta, _Ua, _Va, _Wa, _Xa, _Ya, _Za, __a, _$a, _ab, _bb, _cb, _db, _eb, _fb, _gb, _hb, _ib, _jb, _kb, _lb, _mb, _nb, _ob, _pb, _qb, _rb, _sb, _tb, _ub, _vb, _wb, _xb, _yb, _zb, _Ab, _Bb, _Cb, _Db, _Eb, _Fb, _Gb, _Hb, _Ib, _Jb, _Kb, _Lb, _Mb, _Nb;
|
|
3037
3037
|
const licenseKey = (_d = (_c = (_b = (_a3 = readString(env, "RAG_LICENSE_KEY")) != null ? _a3 : readString(env, "RETRIVORA_LICENSE_KEY")) != null ? _b : readString(env, "NEXT_PUBLIC_RETRIVORA_LICENSE_KEY")) != null ? _c : readString(env, "LICENSE_KEY")) != null ? _d : base == null ? void 0 : base.licenseKey;
|
|
3038
3038
|
const jwtProjectId = (() => {
|
|
3039
3039
|
if (!licenseKey) return void 0;
|
|
@@ -3168,8 +3168,8 @@ function getEnvConfig(env = process.env, base) {
|
|
|
3168
3168
|
model: llmModel,
|
|
3169
3169
|
apiKey: llmApiKey,
|
|
3170
3170
|
baseUrl: llmBaseUrl,
|
|
3171
|
-
systemPrompt: readString(env, "LLM_SYSTEM_PROMPT"),
|
|
3172
|
-
maxTokens: readNumber(env, "LLM_MAX_TOKENS", 4096),
|
|
3171
|
+
systemPrompt: (_hb = readString(env, "LLM_SYSTEM_PROMPT")) != null ? _hb : rt == null ? void 0 : rt.systemPrompt,
|
|
3172
|
+
maxTokens: readNumber(env, "LLM_MAX_TOKENS", (_ib = rt == null ? void 0 : rt.maxTokens) != null ? _ib : 4096),
|
|
3173
3173
|
temperature: readNumber(env, "LLM_TEMPERATURE", 0.7),
|
|
3174
3174
|
options: {
|
|
3175
3175
|
profile: llmProfile,
|
|
@@ -3190,30 +3190,30 @@ function getEnvConfig(env = process.env, base) {
|
|
|
3190
3190
|
}
|
|
3191
3191
|
},
|
|
3192
3192
|
ui: {
|
|
3193
|
-
title: (
|
|
3194
|
-
subtitle: (
|
|
3195
|
-
primaryColor: (
|
|
3196
|
-
accentColor: (
|
|
3197
|
-
logoUrl: (
|
|
3198
|
-
placeholder: (
|
|
3199
|
-
showSources: ((
|
|
3200
|
-
welcomeMessage: (
|
|
3201
|
-
visualStyle: (
|
|
3202
|
-
borderRadius: (
|
|
3203
|
-
allowUpload: ((
|
|
3193
|
+
title: (_kb = (_jb = readString(env, "NEXT_PUBLIC_UI_TITLE")) != null ? _jb : readString(env, "UI_TITLE")) != null ? _kb : "AI Assistant",
|
|
3194
|
+
subtitle: (_mb = (_lb = readString(env, "NEXT_PUBLIC_UI_SUBTITLE")) != null ? _lb : readString(env, "UI_SUBTITLE")) != null ? _mb : "Powered by RAG",
|
|
3195
|
+
primaryColor: (_ob = (_nb = readString(env, "NEXT_PUBLIC_PRIMARY_COLOR")) != null ? _nb : readString(env, "UI_PRIMARY_COLOR")) != null ? _ob : "#10b981",
|
|
3196
|
+
accentColor: (_qb = (_pb = readString(env, "NEXT_PUBLIC_ACCENT_COLOR")) != null ? _pb : readString(env, "UI_ACCENT_COLOR")) != null ? _qb : "#3b82f6",
|
|
3197
|
+
logoUrl: (_rb = readString(env, "NEXT_PUBLIC_LOGO_URL")) != null ? _rb : readString(env, "UI_LOGO_URL"),
|
|
3198
|
+
placeholder: (_tb = (_sb = readString(env, "NEXT_PUBLIC_PLACEHOLDER")) != null ? _sb : readString(env, "UI_PLACEHOLDER")) != null ? _tb : "Ask me anything\u2026",
|
|
3199
|
+
showSources: ((_vb = (_ub = readString(env, "NEXT_PUBLIC_SHOW_SOURCES")) != null ? _ub : readString(env, "UI_SHOW_SOURCES")) != null ? _vb : "true") !== "false",
|
|
3200
|
+
welcomeMessage: (_xb = (_wb = readString(env, "NEXT_PUBLIC_WELCOME_MESSAGE")) != null ? _wb : readString(env, "UI_WELCOME_MESSAGE")) != null ? _xb : "Hello! I'm your AI assistant. Ask me anything about your documents.",
|
|
3201
|
+
visualStyle: (_zb = (_yb = readString(env, "NEXT_PUBLIC_UI_VISUAL_STYLE")) != null ? _yb : readString(env, "UI_VISUAL_STYLE")) != null ? _zb : "glass",
|
|
3202
|
+
borderRadius: (_Bb = (_Ab = readString(env, "NEXT_PUBLIC_UI_BORDER_RADIUS")) != null ? _Ab : readString(env, "UI_BORDER_RADIUS")) != null ? _Bb : "xl",
|
|
3203
|
+
allowUpload: ((_Db = (_Cb = readString(env, "NEXT_PUBLIC_ALLOW_UPLOAD")) != null ? _Cb : readString(env, "UI_ALLOW_UPLOAD")) != null ? _Db : "false") === "true"
|
|
3204
3204
|
},
|
|
3205
3205
|
rag: {
|
|
3206
|
-
topK: readNumber(env, "RAG_TOP_K", 5),
|
|
3206
|
+
topK: readNumber(env, "RAG_TOP_K", (_Eb = rt == null ? void 0 : rt.topK) != null ? _Eb : 5),
|
|
3207
3207
|
scoreThreshold: readNumber(env, "RAG_SCORE_THRESHOLD", 0),
|
|
3208
|
-
chunkSize: readNumber(env, "RAG_CHUNK_SIZE", 1e3),
|
|
3209
|
-
chunkOverlap: readNumber(env, "RAG_CHUNK_OVERLAP", 200),
|
|
3210
|
-
filterableFields: (
|
|
3208
|
+
chunkSize: readNumber(env, "RAG_CHUNK_SIZE", (_Fb = rt == null ? void 0 : rt.chunkSize) != null ? _Fb : 1e3),
|
|
3209
|
+
chunkOverlap: readNumber(env, "RAG_CHUNK_OVERLAP", (_Gb = rt == null ? void 0 : rt.chunkOverlap) != null ? _Gb : 200),
|
|
3210
|
+
filterableFields: (_Hb = readString(env, "RAG_FILTERABLE_FIELDS")) == null ? void 0 : _Hb.split(",").map((f) => f.trim()),
|
|
3211
3211
|
// Query pipeline toggles — read from .env.local
|
|
3212
3212
|
useQueryTransformation: readString(env, "RAG_USE_QUERY_TRANSFORMATION") === "true",
|
|
3213
3213
|
useReranking: readString(env, "RAG_USE_RERANKING") === "true",
|
|
3214
3214
|
useGraphRetrieval: readString(env, "RAG_USE_GRAPH_RETRIEVAL") === "true",
|
|
3215
|
-
architecture: (
|
|
3216
|
-
chunkingStrategy: (
|
|
3215
|
+
architecture: (_Ib = readString(env, "RAG_ARCHITECTURE")) != null ? _Ib : "simple",
|
|
3216
|
+
chunkingStrategy: (_Jb = readString(env, "RAG_CHUNKING_STRATEGY")) != null ? _Jb : "recursive",
|
|
3217
3217
|
uiMapping: (() => {
|
|
3218
3218
|
const raw = readString(env, "RAG_UI_MAPPING");
|
|
3219
3219
|
if (!raw) return void 0;
|
|
@@ -3226,7 +3226,7 @@ function getEnvConfig(env = process.env, base) {
|
|
|
3226
3226
|
},
|
|
3227
3227
|
telemetry: {
|
|
3228
3228
|
enabled: telemetryEnabled,
|
|
3229
|
-
url: (
|
|
3229
|
+
url: (_Nb = (_Mb = (_Kb = readString(env, "TELEMETRY_URL")) != null ? _Kb : readString(env, "NEXT_PUBLIC_TELEMETRY_URL")) != null ? _Mb : (_Lb = base == null ? void 0 : base.telemetry) == null ? void 0 : _Lb.url) != null ? _Nb : "https://www.retrivora.com/api/telemetry"
|
|
3230
3230
|
}
|
|
3231
3231
|
}, readString(env, "GRAPH_DB_PROVIDER") ? {
|
|
3232
3232
|
graphDb: {
|
|
@@ -12276,7 +12276,7 @@ function createRagHandler(configOrPlugin, options) {
|
|
|
12276
12276
|
}
|
|
12277
12277
|
}
|
|
12278
12278
|
async function getSegment(req, context) {
|
|
12279
|
-
var _a3, _b;
|
|
12279
|
+
var _a3, _b, _c;
|
|
12280
12280
|
const contentType = req.headers.get("content-type") || "";
|
|
12281
12281
|
if (contentType.includes("multipart/form-data")) {
|
|
12282
12282
|
return "upload";
|
|
@@ -12291,10 +12291,12 @@ function createRagHandler(configOrPlugin, options) {
|
|
|
12291
12291
|
if (pathname.endsWith("/suggestions")) return "suggestions";
|
|
12292
12292
|
if (pathname.endsWith("/feedback")) return "feedback";
|
|
12293
12293
|
if (pathname.endsWith("/history")) return "history";
|
|
12294
|
+
if (pathname.endsWith("/history/clear")) return "history/clear";
|
|
12295
|
+
if (pathname.endsWith("/sessions")) return "sessions";
|
|
12294
12296
|
} catch (e) {
|
|
12295
12297
|
}
|
|
12296
12298
|
const resolvedParams = typeof ((_a3 = context == null ? void 0 : context.params) == null ? void 0 : _a3.then) === "function" ? await context.params : context == null ? void 0 : context.params;
|
|
12297
|
-
const segments = (resolvedParams == null ? void 0 : resolvedParams.retrivora) || ((_b = resolvedParams == null ? void 0 : resolvedParams.params) == null ? void 0 : _b.retrivora) || [];
|
|
12299
|
+
const segments = (resolvedParams == null ? void 0 : resolvedParams.retrivora) || ((_b = resolvedParams == null ? void 0 : resolvedParams.params) == null ? void 0 : _b.retrivora) || (resolvedParams == null ? void 0 : resolvedParams.rag) || ((_c = resolvedParams == null ? void 0 : resolvedParams.params) == null ? void 0 : _c.rag) || [];
|
|
12298
12300
|
const joined = segments.join("/");
|
|
12299
12301
|
return joined || "chat";
|
|
12300
12302
|
}
|
|
@@ -12602,8 +12604,9 @@ var LicenseConfigResolver = class {
|
|
|
12602
12604
|
provider: llmProvider,
|
|
12603
12605
|
model: tierConfig.llmModel,
|
|
12604
12606
|
apiKey: llmApiKey,
|
|
12605
|
-
maxTokens: tierConfig.maxTokens,
|
|
12607
|
+
maxTokens: tierConfig == null ? void 0 : tierConfig.maxTokens,
|
|
12606
12608
|
temperature: 0.7,
|
|
12609
|
+
systemPrompt: tierConfig == null ? void 0 : tierConfig.systemPrompt,
|
|
12607
12610
|
options: {}
|
|
12608
12611
|
};
|
|
12609
12612
|
const embeddingConfig = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@retrivora-ai/rag-engine",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.4.0",
|
|
4
4
|
"description": "Retrivora AI is a plug-and-play AI engine for RAG chat experiences — generic vector DB + LLM provider, embeddable or standalone.",
|
|
5
5
|
"author": "Abhinav Alkuchi",
|
|
6
6
|
"license": "UNLICENSED",
|