@retrivora-ai/rag-engine 1.9.9 → 2.0.1
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/handlers/index.d.mts +1 -1
- package/dist/handlers/index.d.ts +1 -1
- package/dist/handlers/index.js +111 -48
- package/dist/handlers/index.mjs +111 -48
- package/dist/{index-DXd29KMq.d.mts → index-DHsFLJXQ.d.mts} +1 -30
- package/dist/{index-D_bOdJML.d.ts → index-tzwc7UhY.d.ts} +1 -30
- package/dist/index.js +12 -3
- package/dist/index.mjs +12 -3
- package/dist/server.d.mts +2 -2
- package/dist/server.d.ts +2 -2
- package/dist/server.js +111 -48
- package/dist/server.mjs +111 -48
- package/package.json +1 -1
- package/src/components/ChatWindow.tsx +14 -3
- package/src/config/serverConfig.ts +15 -2
- package/src/core/Pipeline.ts +25 -20
- package/src/handlers/index.ts +92 -54
package/dist/handlers/index.mjs
CHANGED
|
@@ -2127,46 +2127,48 @@ function readEnum(env, name, fallback, allowed) {
|
|
|
2127
2127
|
throw new Error(`[getRagConfig] ${name} must be one of: ${allowed.join(", ")}`);
|
|
2128
2128
|
}
|
|
2129
2129
|
function getEnvConfig(env = process.env, base) {
|
|
2130
|
-
var _a2, _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;
|
|
2130
|
+
var _a2, _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;
|
|
2131
2131
|
const projectId = (_c = (_b = (_a2 = readString(env, "RAG_PROJECT_ID")) != null ? _a2 : readString(env, "NEXT_PUBLIC_PROJECT_ID")) != null ? _b : base == null ? void 0 : base.projectId) != null ? _c : "__default__";
|
|
2132
|
+
const licenseKey = (_g2 = (_f = (_e = (_d = readString(env, "RAG_LICENSE_KEY")) != null ? _d : readString(env, "RETRIVORA_LICENSE_KEY")) != null ? _e : readString(env, "NEXT_PUBLIC_RETRIVORA_LICENSE_KEY")) != null ? _f : readString(env, "LICENSE_KEY")) != null ? _g2 : base == null ? void 0 : base.licenseKey;
|
|
2133
|
+
const telemetryEnabled = readString(env, "TELEMETRY_ENABLED") === "true" || readString(env, "NEXT_PUBLIC_TELEMETRY_ENABLED") === "true" || ((_h = base == null ? void 0 : base.telemetry) == null ? void 0 : _h.enabled) || Boolean(licenseKey);
|
|
2132
2134
|
const vectorProvider = readEnum(env, "VECTOR_DB_PROVIDER", "pinecone", VECTOR_DB_PROVIDERS);
|
|
2133
2135
|
const llmProvider = readEnum(env, "LLM_PROVIDER", "openai", LLM_PROVIDERS);
|
|
2134
2136
|
const embeddingProvider = readEnum(env, "EMBEDDING_PROVIDER", "openai", EMBEDDING_PROVIDERS);
|
|
2135
2137
|
const embeddingDimensions = readNumber(env, "EMBEDDING_DIMENSIONS", 1536);
|
|
2136
2138
|
const vectorDbOptions = {};
|
|
2137
2139
|
if (vectorProvider === "pinecone") {
|
|
2138
|
-
vectorDbOptions.apiKey = (
|
|
2139
|
-
vectorDbOptions.indexName = (
|
|
2140
|
+
vectorDbOptions.apiKey = (_l = (_k = readString(env, "PINECONE_API_KEY")) != null ? _k : (_j = (_i = base == null ? void 0 : base.vectorDb) == null ? void 0 : _i.options) == null ? void 0 : _j.apiKey) != null ? _l : "";
|
|
2141
|
+
vectorDbOptions.indexName = (_q = (_n = readString(env, "PINECONE_INDEX")) != null ? _n : (_m = base == null ? void 0 : base.vectorDb) == null ? void 0 : _m.indexName) != null ? _q : (_p = (_o = base == null ? void 0 : base.vectorDb) == null ? void 0 : _o.options) == null ? void 0 : _p.indexName;
|
|
2140
2142
|
} else if (vectorProvider === "pgvector" || vectorProvider === "postgresql") {
|
|
2141
|
-
vectorDbOptions.connectionString = (
|
|
2142
|
-
vectorDbOptions.tables = (
|
|
2143
|
-
vectorDbOptions.searchFields = (
|
|
2143
|
+
vectorDbOptions.connectionString = (_v = (_u = (_r = readString(env, "PGVECTOR_CONNECTION_STRING")) != null ? _r : readString(env, "POSTGRES_URL")) != null ? _u : (_t = (_s = base == null ? void 0 : base.vectorDb) == null ? void 0 : _s.options) == null ? void 0 : _t.connectionString) != null ? _v : "";
|
|
2144
|
+
vectorDbOptions.tables = (_A = (_x = (_w = readString(env, "VECTOR_DB_TABLES")) != null ? _w : readString(env, "POSTGRES_TABLES")) == null ? void 0 : _x.split(",").map((t) => t.trim())) != null ? _A : (_z = (_y = base == null ? void 0 : base.vectorDb) == null ? void 0 : _y.options) == null ? void 0 : _z.tables;
|
|
2145
|
+
vectorDbOptions.searchFields = (_E = (_B = readString(env, "POSTGRES_SEARCH_FIELDS")) == null ? void 0 : _B.split(",").map((f) => f.trim())) != null ? _E : (_D = (_C = base == null ? void 0 : base.vectorDb) == null ? void 0 : _C.options) == null ? void 0 : _D.searchFields;
|
|
2144
2146
|
vectorDbOptions.dimensions = embeddingDimensions;
|
|
2145
2147
|
} else if (vectorProvider === "mongodb") {
|
|
2146
|
-
vectorDbOptions.uri = (
|
|
2147
|
-
vectorDbOptions.database = (
|
|
2148
|
-
vectorDbOptions.collection = (
|
|
2149
|
-
vectorDbOptions.indexName = (
|
|
2148
|
+
vectorDbOptions.uri = (_I = (_H = readString(env, "MONGODB_URI")) != null ? _H : (_G = (_F = base == null ? void 0 : base.vectorDb) == null ? void 0 : _F.options) == null ? void 0 : _G.uri) != null ? _I : "";
|
|
2149
|
+
vectorDbOptions.database = (_M = (_L = readString(env, "MONGODB_DB")) != null ? _L : (_K = (_J = base == null ? void 0 : base.vectorDb) == null ? void 0 : _J.options) == null ? void 0 : _K.database) != null ? _M : "";
|
|
2150
|
+
vectorDbOptions.collection = (_Q = (_P = readString(env, "MONGODB_COLLECTION")) != null ? _P : (_O = (_N = base == null ? void 0 : base.vectorDb) == null ? void 0 : _N.options) == null ? void 0 : _O.collection) != null ? _Q : "";
|
|
2151
|
+
vectorDbOptions.indexName = (_W = (_V = (_S = readString(env, "MONGODB_INDEX_NAME")) != null ? _S : (_R = base == null ? void 0 : base.vectorDb) == null ? void 0 : _R.indexName) != null ? _V : (_U = (_T = base == null ? void 0 : base.vectorDb) == null ? void 0 : _T.options) == null ? void 0 : _U.indexName) != null ? _W : "vector_index";
|
|
2150
2152
|
} else if (vectorProvider === "qdrant") {
|
|
2151
|
-
vectorDbOptions.baseUrl = (
|
|
2152
|
-
vectorDbOptions.apiKey = (
|
|
2153
|
+
vectorDbOptions.baseUrl = (__ = (_Z = readString(env, "QDRANT_URL")) != null ? _Z : (_Y = (_X = base == null ? void 0 : base.vectorDb) == null ? void 0 : _X.options) == null ? void 0 : _Y.baseUrl) != null ? __ : "http://localhost:6333";
|
|
2154
|
+
vectorDbOptions.apiKey = (_ba = readString(env, "QDRANT_API_KEY")) != null ? _ba : (_aa = (_$ = base == null ? void 0 : base.vectorDb) == null ? void 0 : _$.options) == null ? void 0 : _aa.apiKey;
|
|
2153
2155
|
vectorDbOptions.dimensions = embeddingDimensions;
|
|
2154
2156
|
} else if (vectorProvider === "milvus") {
|
|
2155
|
-
vectorDbOptions.baseUrl = (
|
|
2157
|
+
vectorDbOptions.baseUrl = (_ca = readString(env, "MILVUS_URL")) != null ? _ca : "http://localhost:19530";
|
|
2156
2158
|
vectorDbOptions.apiKey = readString(env, "MILVUS_API_KEY");
|
|
2157
2159
|
} else if (vectorProvider === "chromadb") {
|
|
2158
|
-
vectorDbOptions.baseUrl = (
|
|
2160
|
+
vectorDbOptions.baseUrl = (_da = readString(env, "CHROMADB_URL")) != null ? _da : "http://localhost:8000";
|
|
2159
2161
|
} else if (vectorProvider === "weaviate") {
|
|
2160
|
-
vectorDbOptions.baseUrl = (
|
|
2162
|
+
vectorDbOptions.baseUrl = (_ea = readString(env, "WEAVIATE_URL")) != null ? _ea : "http://localhost:8080";
|
|
2161
2163
|
vectorDbOptions.apiKey = readString(env, "WEAVIATE_API_KEY");
|
|
2162
2164
|
} else if (vectorProvider === "redis") {
|
|
2163
|
-
vectorDbOptions.baseUrl = (
|
|
2165
|
+
vectorDbOptions.baseUrl = (_fa = readString(env, "REDIS_URL")) != null ? _fa : "";
|
|
2164
2166
|
vectorDbOptions.apiKey = readString(env, "REDIS_API_KEY");
|
|
2165
2167
|
} else if (vectorProvider === "rest") {
|
|
2166
|
-
vectorDbOptions.baseUrl = (
|
|
2168
|
+
vectorDbOptions.baseUrl = (_ga = readString(env, "VECTOR_DB_REST_URL")) != null ? _ga : "";
|
|
2167
2169
|
vectorDbOptions.headers = readString(env, "VECTOR_DB_REST_API_KEY") ? { "api-key": readString(env, "VECTOR_DB_REST_API_KEY") } : {};
|
|
2168
2170
|
} else if (vectorProvider === "universal_rest") {
|
|
2169
|
-
vectorDbOptions.baseUrl = (
|
|
2171
|
+
vectorDbOptions.baseUrl = (_ia = (_ha = readString(env, "VECTOR_BASE_URL")) != null ? _ha : readString(env, "VECTOR_DB_REST_URL")) != null ? _ia : "";
|
|
2170
2172
|
vectorDbOptions.profile = readString(env, "VECTOR_UNIVERSAL_PROFILE");
|
|
2171
2173
|
vectorDbOptions.headers = readString(env, "VECTOR_DB_REST_API_KEY") ? { Authorization: `Bearer ${readString(env, "VECTOR_DB_REST_API_KEY")}` } : {};
|
|
2172
2174
|
}
|
|
@@ -2185,8 +2187,8 @@ function getEnvConfig(env = process.env, base) {
|
|
|
2185
2187
|
// Anthropic needs a separate embedding provider; key kept for completeness
|
|
2186
2188
|
gemini: readString(env, "GEMINI_API_KEY"),
|
|
2187
2189
|
ollama: void 0,
|
|
2188
|
-
universal_rest: (
|
|
2189
|
-
custom: (
|
|
2190
|
+
universal_rest: (_ja = readString(env, "EMBEDDING_API_KEY")) != null ? _ja : readString(env, "OPENAI_API_KEY"),
|
|
2191
|
+
custom: (_ka = readString(env, "EMBEDDING_API_KEY")) != null ? _ka : readString(env, "OPENAI_API_KEY")
|
|
2190
2192
|
};
|
|
2191
2193
|
const DEFAULT_MODEL_BY_PROVIDER = {
|
|
2192
2194
|
openai: "gpt-4o",
|
|
@@ -2199,16 +2201,16 @@ function getEnvConfig(env = process.env, base) {
|
|
|
2199
2201
|
};
|
|
2200
2202
|
return __spreadProps(__spreadValues({
|
|
2201
2203
|
projectId,
|
|
2202
|
-
licenseKey: (
|
|
2204
|
+
licenseKey: (_ma = (_la = readString(env, "RETRIVORA_LICENSE_KEY")) != null ? _la : readString(env, "LICENSE_KEY")) != null ? _ma : base == null ? void 0 : base.licenseKey,
|
|
2203
2205
|
vectorDb: {
|
|
2204
2206
|
provider: vectorProvider,
|
|
2205
|
-
indexName: (
|
|
2207
|
+
indexName: (_oa = (_na = readString(env, "VECTOR_DB_INDEX")) != null ? _na : vectorDbOptions.indexName) != null ? _oa : "rag-index",
|
|
2206
2208
|
options: vectorDbOptions
|
|
2207
2209
|
},
|
|
2208
2210
|
llm: {
|
|
2209
2211
|
provider: llmProvider,
|
|
2210
|
-
model: (
|
|
2211
|
-
apiKey: (
|
|
2212
|
+
model: (_qa = (_pa = readString(env, "LLM_MODEL")) != null ? _pa : DEFAULT_MODEL_BY_PROVIDER[llmProvider]) != null ? _qa : "gpt-4o",
|
|
2213
|
+
apiKey: (_ra = llmApiKeyByProvider[llmProvider]) != null ? _ra : "",
|
|
2212
2214
|
baseUrl: readString(env, "LLM_BASE_URL"),
|
|
2213
2215
|
systemPrompt: readString(env, "LLM_SYSTEM_PROMPT"),
|
|
2214
2216
|
maxTokens: readNumber(env, "LLM_MAX_TOKENS", 4096),
|
|
@@ -2221,7 +2223,7 @@ function getEnvConfig(env = process.env, base) {
|
|
|
2221
2223
|
},
|
|
2222
2224
|
embedding: {
|
|
2223
2225
|
provider: embeddingProvider,
|
|
2224
|
-
model: (
|
|
2226
|
+
model: (_sa = readString(env, "EMBEDDING_MODEL")) != null ? _sa : "text-embedding-3-small",
|
|
2225
2227
|
apiKey: embeddingApiKeyByProvider[embeddingProvider],
|
|
2226
2228
|
baseUrl: readString(env, "EMBEDDING_BASE_URL"),
|
|
2227
2229
|
dimensions: embeddingDimensions,
|
|
@@ -2232,30 +2234,30 @@ function getEnvConfig(env = process.env, base) {
|
|
|
2232
2234
|
}
|
|
2233
2235
|
},
|
|
2234
2236
|
ui: {
|
|
2235
|
-
title: (
|
|
2236
|
-
subtitle: (
|
|
2237
|
-
primaryColor: (
|
|
2238
|
-
accentColor: (
|
|
2239
|
-
logoUrl: (
|
|
2240
|
-
placeholder: (
|
|
2241
|
-
showSources: ((
|
|
2242
|
-
welcomeMessage: (
|
|
2243
|
-
visualStyle: (
|
|
2244
|
-
borderRadius: (
|
|
2245
|
-
allowUpload: ((
|
|
2237
|
+
title: (_ua = (_ta = readString(env, "NEXT_PUBLIC_UI_TITLE")) != null ? _ta : readString(env, "UI_TITLE")) != null ? _ua : "AI Assistant",
|
|
2238
|
+
subtitle: (_wa = (_va = readString(env, "NEXT_PUBLIC_UI_SUBTITLE")) != null ? _va : readString(env, "UI_SUBTITLE")) != null ? _wa : "Powered by RAG",
|
|
2239
|
+
primaryColor: (_ya = (_xa = readString(env, "NEXT_PUBLIC_PRIMARY_COLOR")) != null ? _xa : readString(env, "UI_PRIMARY_COLOR")) != null ? _ya : "#10b981",
|
|
2240
|
+
accentColor: (_Aa = (_za = readString(env, "NEXT_PUBLIC_ACCENT_COLOR")) != null ? _za : readString(env, "UI_ACCENT_COLOR")) != null ? _Aa : "#3b82f6",
|
|
2241
|
+
logoUrl: (_Ba = readString(env, "NEXT_PUBLIC_LOGO_URL")) != null ? _Ba : readString(env, "UI_LOGO_URL"),
|
|
2242
|
+
placeholder: (_Da = (_Ca = readString(env, "NEXT_PUBLIC_PLACEHOLDER")) != null ? _Ca : readString(env, "UI_PLACEHOLDER")) != null ? _Da : "Ask me anything\u2026",
|
|
2243
|
+
showSources: ((_Fa = (_Ea = readString(env, "NEXT_PUBLIC_SHOW_SOURCES")) != null ? _Ea : readString(env, "UI_SHOW_SOURCES")) != null ? _Fa : "true") !== "false",
|
|
2244
|
+
welcomeMessage: (_Ha = (_Ga = readString(env, "NEXT_PUBLIC_WELCOME_MESSAGE")) != null ? _Ga : readString(env, "UI_WELCOME_MESSAGE")) != null ? _Ha : "Hello! I'm your AI assistant. Ask me anything about your documents.",
|
|
2245
|
+
visualStyle: (_Ja = (_Ia = readString(env, "NEXT_PUBLIC_UI_VISUAL_STYLE")) != null ? _Ia : readString(env, "UI_VISUAL_STYLE")) != null ? _Ja : "glass",
|
|
2246
|
+
borderRadius: (_La = (_Ka = readString(env, "NEXT_PUBLIC_UI_BORDER_RADIUS")) != null ? _Ka : readString(env, "UI_BORDER_RADIUS")) != null ? _La : "xl",
|
|
2247
|
+
allowUpload: ((_Na = (_Ma = readString(env, "NEXT_PUBLIC_ALLOW_UPLOAD")) != null ? _Ma : readString(env, "UI_ALLOW_UPLOAD")) != null ? _Na : "false") === "true"
|
|
2246
2248
|
},
|
|
2247
2249
|
rag: {
|
|
2248
2250
|
topK: readNumber(env, "RAG_TOP_K", 5),
|
|
2249
2251
|
scoreThreshold: readNumber(env, "RAG_SCORE_THRESHOLD", 0),
|
|
2250
2252
|
chunkSize: readNumber(env, "RAG_CHUNK_SIZE", 1e3),
|
|
2251
2253
|
chunkOverlap: readNumber(env, "RAG_CHUNK_OVERLAP", 200),
|
|
2252
|
-
filterableFields: (
|
|
2254
|
+
filterableFields: (_Oa = readString(env, "RAG_FILTERABLE_FIELDS")) == null ? void 0 : _Oa.split(",").map((f) => f.trim()),
|
|
2253
2255
|
// Query pipeline toggles — read from .env.local
|
|
2254
2256
|
useQueryTransformation: readString(env, "RAG_USE_QUERY_TRANSFORMATION") === "true",
|
|
2255
2257
|
useReranking: readString(env, "RAG_USE_RERANKING") === "true",
|
|
2256
2258
|
useGraphRetrieval: readString(env, "RAG_USE_GRAPH_RETRIEVAL") === "true",
|
|
2257
|
-
architecture: (
|
|
2258
|
-
chunkingStrategy: (
|
|
2259
|
+
architecture: (_Pa = readString(env, "RAG_ARCHITECTURE")) != null ? _Pa : "simple",
|
|
2260
|
+
chunkingStrategy: (_Qa = readString(env, "RAG_CHUNKING_STRATEGY")) != null ? _Qa : "recursive",
|
|
2259
2261
|
uiMapping: (() => {
|
|
2260
2262
|
const raw = readString(env, "RAG_UI_MAPPING");
|
|
2261
2263
|
if (!raw) return void 0;
|
|
@@ -2267,8 +2269,8 @@ function getEnvConfig(env = process.env, base) {
|
|
|
2267
2269
|
})()
|
|
2268
2270
|
},
|
|
2269
2271
|
telemetry: {
|
|
2270
|
-
enabled:
|
|
2271
|
-
url: (
|
|
2272
|
+
enabled: telemetryEnabled,
|
|
2273
|
+
url: (_Ua = (_Ta = (_Ra = readString(env, "TELEMETRY_URL")) != null ? _Ra : readString(env, "NEXT_PUBLIC_TELEMETRY_URL")) != null ? _Ta : (_Sa = base == null ? void 0 : base.telemetry) == null ? void 0 : _Sa.url) != null ? _Ua : process.env.NODE_ENV === "development" ? "http://localhost:3001/api/telemetry" : "https://retrivora.com/api/telemetry"
|
|
2272
2274
|
}
|
|
2273
2275
|
}, readString(env, "GRAPH_DB_PROVIDER") ? {
|
|
2274
2276
|
graphDb: {
|
|
@@ -7447,7 +7449,7 @@ ${m.content}`).join("\n\n---\n\n");
|
|
|
7447
7449
|
*/
|
|
7448
7450
|
askStreamInternal(_0) {
|
|
7449
7451
|
return __asyncGenerator(this, arguments, function* (question, history = [], namespace) {
|
|
7450
|
-
var _a2, _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;
|
|
7452
|
+
var _a2, _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;
|
|
7451
7453
|
yield new __await(this.initialize());
|
|
7452
7454
|
const ns = namespace != null ? namespace : this.config.projectId;
|
|
7453
7455
|
const topK = (_b = (_a2 = this.config.rag) == null ? void 0 : _a2.topK) != null ? _b : 5;
|
|
@@ -7757,8 +7759,10 @@ ${context}`;
|
|
|
7757
7759
|
hallucinationReason: hScore.reason
|
|
7758
7760
|
} : {});
|
|
7759
7761
|
const trace = buildTrace(hallucinationResult);
|
|
7760
|
-
|
|
7761
|
-
|
|
7762
|
+
const isTelemetryActive = (_B = (_A = this.config.telemetry) == null ? void 0 : _A.enabled) != null ? _B : Boolean(this.config.licenseKey);
|
|
7763
|
+
if (isTelemetryActive) {
|
|
7764
|
+
const defaultUrl = process.env.NODE_ENV === "development" && !process.env.TELEMETRY_URL && !process.env.NEXT_PUBLIC_TELEMETRY_URL ? "http://localhost:3001/api/telemetry" : "https://retrivora.com/api/telemetry";
|
|
7765
|
+
const telemetryUrl = ((_C = this.config.telemetry) == null ? void 0 : _C.url) || process.env.TELEMETRY_URL || process.env.NEXT_PUBLIC_TELEMETRY_URL || defaultUrl;
|
|
7762
7766
|
const absoluteUrl = telemetryUrl.startsWith("http") ? telemetryUrl : (process.env.NEXT_PUBLIC_APP_URL || `http://localhost:${process.env.PORT || 3e3}`) + telemetryUrl;
|
|
7763
7767
|
(async () => {
|
|
7764
7768
|
try {
|
|
@@ -9014,6 +9018,43 @@ function getOrCreatePlugin(configOrPlugin) {
|
|
|
9014
9018
|
}
|
|
9015
9019
|
return _g[cacheKey];
|
|
9016
9020
|
}
|
|
9021
|
+
function reportTelemetry(req, plugin, action, status, details, trace) {
|
|
9022
|
+
var _a2;
|
|
9023
|
+
try {
|
|
9024
|
+
const config = plugin.getConfig();
|
|
9025
|
+
const licenseKey = config.licenseKey || process.env.RAG_LICENSE_KEY || process.env.RETRIVORA_LICENSE_KEY || process.env.NEXT_PUBLIC_RETRIVORA_LICENSE_KEY;
|
|
9026
|
+
const telemetryConfig = config.telemetry;
|
|
9027
|
+
const enabled = (_a2 = telemetryConfig == null ? void 0 : telemetryConfig.enabled) != null ? _a2 : Boolean(licenseKey);
|
|
9028
|
+
const defaultUrl = process.env.NODE_ENV === "development" && !process.env.TELEMETRY_URL && !process.env.NEXT_PUBLIC_TELEMETRY_URL ? "http://localhost:3001/api/telemetry" : "https://retrivora.com/api/telemetry";
|
|
9029
|
+
const telemetryUrl = (telemetryConfig == null ? void 0 : telemetryConfig.url) || process.env.TELEMETRY_URL || process.env.NEXT_PUBLIC_TELEMETRY_URL || defaultUrl;
|
|
9030
|
+
const host = req.headers.get("host") || "localhost";
|
|
9031
|
+
let absoluteUrl = telemetryUrl;
|
|
9032
|
+
if (!telemetryUrl.startsWith("http")) {
|
|
9033
|
+
const proto = req.headers.get("x-forwarded-proto") || "http";
|
|
9034
|
+
absoluteUrl = `${proto}://${host}${telemetryUrl}`;
|
|
9035
|
+
}
|
|
9036
|
+
const projectId = config.projectId || "default";
|
|
9037
|
+
fetch(absoluteUrl, {
|
|
9038
|
+
method: "POST",
|
|
9039
|
+
headers: {
|
|
9040
|
+
"Content-Type": "application/json",
|
|
9041
|
+
"x-forwarded-for": req.headers.get("x-forwarded-for") || "",
|
|
9042
|
+
"x-real-ip": req.headers.get("x-real-ip") || ""
|
|
9043
|
+
},
|
|
9044
|
+
body: JSON.stringify({
|
|
9045
|
+
trace,
|
|
9046
|
+
licenseKey,
|
|
9047
|
+
projectId,
|
|
9048
|
+
action,
|
|
9049
|
+
status,
|
|
9050
|
+
details
|
|
9051
|
+
})
|
|
9052
|
+
}).catch((err) => {
|
|
9053
|
+
console.warn("[Retrivora Telemetry] Async report warning:", err.message);
|
|
9054
|
+
});
|
|
9055
|
+
} catch (e) {
|
|
9056
|
+
}
|
|
9057
|
+
}
|
|
9017
9058
|
function sseFrame(payload) {
|
|
9018
9059
|
return `data: ${JSON.stringify(payload)}
|
|
9019
9060
|
|
|
@@ -9056,6 +9097,7 @@ function createChatHandler(configOrPlugin, options) {
|
|
|
9056
9097
|
const storage = new DatabaseStorage(plugin.getConfig());
|
|
9057
9098
|
const onAuthorize = options == null ? void 0 : options.onAuthorize;
|
|
9058
9099
|
return async function POST(req) {
|
|
9100
|
+
var _a2, _b, _c, _d;
|
|
9059
9101
|
const authResult = await checkAuth(req, onAuthorize);
|
|
9060
9102
|
if (authResult) return authResult;
|
|
9061
9103
|
const rateLimited = checkRateLimit(req);
|
|
@@ -9084,12 +9126,14 @@ function createChatHandler(configOrPlugin, options) {
|
|
|
9084
9126
|
uiTransformation: result.ui_transformation,
|
|
9085
9127
|
trace: result.trace
|
|
9086
9128
|
}).catch((err) => console.warn("[createChatHandler] Failed to save assistant message:", err));
|
|
9129
|
+
reportTelemetry(req, plugin, "QUERY_GENERATION", "success", `Tokens: ${((_b = (_a2 = result.trace) == null ? void 0 : _a2.tokens) == null ? void 0 : _b.totalTokens) || 0}, Latency: ${((_d = (_c = result.trace) == null ? void 0 : _c.latency) == null ? void 0 : _d.totalMs) || 0}ms`, result.trace);
|
|
9087
9130
|
return NextResponse.json(__spreadProps(__spreadValues({}, result), {
|
|
9088
9131
|
messageId: assistantMsgId,
|
|
9089
9132
|
userMessageId: userMsgId
|
|
9090
9133
|
}));
|
|
9091
9134
|
} catch (err) {
|
|
9092
9135
|
const message = err instanceof Error ? err.message : "Internal server error";
|
|
9136
|
+
reportTelemetry(req, plugin, "QUERY_GENERATION", "error", message);
|
|
9093
9137
|
return NextResponse.json({ error: message }, { status: 500 });
|
|
9094
9138
|
}
|
|
9095
9139
|
};
|
|
@@ -9132,7 +9176,7 @@ function createStreamHandler(configOrPlugin, options) {
|
|
|
9132
9176
|
let isActive = true;
|
|
9133
9177
|
const stream = new ReadableStream({
|
|
9134
9178
|
async start(controller) {
|
|
9135
|
-
var _a2;
|
|
9179
|
+
var _a2, _b, _c, _d, _e;
|
|
9136
9180
|
const enqueue = (text) => {
|
|
9137
9181
|
if (!isActive) return;
|
|
9138
9182
|
try {
|
|
@@ -9189,6 +9233,7 @@ function createStreamHandler(configOrPlugin, options) {
|
|
|
9189
9233
|
uiTransformation,
|
|
9190
9234
|
trace: responseChunk == null ? void 0 : responseChunk.trace
|
|
9191
9235
|
}).catch((err) => console.warn("[createStreamHandler] Failed to save assistant message:", err));
|
|
9236
|
+
reportTelemetry(req, plugin, "QUERY_GENERATION", "success", `Tokens: ${((_c = (_b = responseChunk == null ? void 0 : responseChunk.trace) == null ? void 0 : _b.tokens) == null ? void 0 : _c.totalTokens) || 0}, Latency: ${((_e = (_d = responseChunk == null ? void 0 : responseChunk.trace) == null ? void 0 : _d.latency) == null ? void 0 : _e.totalMs) || 0}ms`, responseChunk == null ? void 0 : responseChunk.trace);
|
|
9192
9237
|
}
|
|
9193
9238
|
}
|
|
9194
9239
|
} catch (temp) {
|
|
@@ -9205,6 +9250,7 @@ function createStreamHandler(configOrPlugin, options) {
|
|
|
9205
9250
|
if (isActive) {
|
|
9206
9251
|
const errorMessage = streamError instanceof Error ? streamError.message : String(streamError);
|
|
9207
9252
|
console.error("[createStreamHandler] Stream error:", streamError);
|
|
9253
|
+
reportTelemetry(req, plugin, "QUERY_GENERATION", "error", errorMessage);
|
|
9208
9254
|
try {
|
|
9209
9255
|
enqueue(sseErrorFrame(errorMessage));
|
|
9210
9256
|
} catch (e) {
|
|
@@ -9241,9 +9287,11 @@ function createIngestHandler(configOrPlugin, options) {
|
|
|
9241
9287
|
return NextResponse.json({ error: "documents array is required" }, { status: 400 });
|
|
9242
9288
|
}
|
|
9243
9289
|
const results = await plugin.ingest(documents, namespace);
|
|
9290
|
+
reportTelemetry(req, plugin, "DOCUMENT_INGESTION", "success", `Ingested ${documents.length} document(s)`);
|
|
9244
9291
|
return NextResponse.json({ results });
|
|
9245
9292
|
} catch (err) {
|
|
9246
9293
|
const message = err instanceof Error ? err.message : "Internal server error";
|
|
9294
|
+
reportTelemetry(req, plugin, "DOCUMENT_INGESTION", "error", message);
|
|
9247
9295
|
return NextResponse.json({ error: message }, { status: 500 });
|
|
9248
9296
|
}
|
|
9249
9297
|
};
|
|
@@ -9342,9 +9390,11 @@ function createUploadHandler(configOrPlugin, options) {
|
|
|
9342
9390
|
}
|
|
9343
9391
|
}
|
|
9344
9392
|
const results = await plugin.ingest(documents, namespace);
|
|
9393
|
+
reportTelemetry(req, plugin, "DOCUMENT_INGESTION", "success", `Uploaded & ingested ${files.length} file(s)`);
|
|
9345
9394
|
return NextResponse.json({ message: "Upload successful", results });
|
|
9346
9395
|
} catch (err) {
|
|
9347
9396
|
const message = err instanceof Error ? err.message : "Upload failed";
|
|
9397
|
+
reportTelemetry(req, plugin, "DOCUMENT_INGESTION", "error", message);
|
|
9348
9398
|
return NextResponse.json({ error: message }, { status: 500 });
|
|
9349
9399
|
}
|
|
9350
9400
|
};
|
|
@@ -9352,19 +9402,30 @@ function createUploadHandler(configOrPlugin, options) {
|
|
|
9352
9402
|
function createSuggestionsHandler(configOrPlugin, options) {
|
|
9353
9403
|
const plugin = getOrCreatePlugin(configOrPlugin);
|
|
9354
9404
|
const onAuthorize = options == null ? void 0 : options.onAuthorize;
|
|
9355
|
-
return async function
|
|
9405
|
+
return async function handler(req) {
|
|
9356
9406
|
const authResult = await checkAuth(req, onAuthorize);
|
|
9357
9407
|
if (authResult) return authResult;
|
|
9358
9408
|
try {
|
|
9359
|
-
|
|
9360
|
-
|
|
9409
|
+
let query = "";
|
|
9410
|
+
let namespace = void 0;
|
|
9411
|
+
if (req.method === "POST") {
|
|
9412
|
+
const body = await req.json().catch(() => ({}));
|
|
9413
|
+
query = body.query || "";
|
|
9414
|
+
namespace = body.namespace;
|
|
9415
|
+
} else {
|
|
9416
|
+
const url = new URL(req.url);
|
|
9417
|
+
query = url.searchParams.get("query") || "";
|
|
9418
|
+
namespace = url.searchParams.get("namespace") || void 0;
|
|
9419
|
+
}
|
|
9361
9420
|
if (typeof query !== "string") {
|
|
9362
9421
|
return NextResponse.json({ error: "query is required" }, { status: 400 });
|
|
9363
9422
|
}
|
|
9364
9423
|
const suggestions = await plugin.getSuggestions(query, namespace);
|
|
9424
|
+
reportTelemetry(req, plugin, "AUTO_SUGGESTIONS", "success", `Fetched ${suggestions.length} suggestions for: ${query.slice(0, 30)}`);
|
|
9365
9425
|
return NextResponse.json({ suggestions });
|
|
9366
9426
|
} catch (err) {
|
|
9367
9427
|
const message = err instanceof Error ? err.message : "Internal server error";
|
|
9428
|
+
reportTelemetry(req, plugin, "AUTO_SUGGESTIONS", "error", message);
|
|
9368
9429
|
return NextResponse.json({ error: message }, { status: 500 });
|
|
9369
9430
|
}
|
|
9370
9431
|
};
|
|
@@ -9496,6 +9557,8 @@ function createRagHandler(configOrPlugin, options) {
|
|
|
9496
9557
|
switch (segment) {
|
|
9497
9558
|
case "health":
|
|
9498
9559
|
return healthHandler(req);
|
|
9560
|
+
case "suggestions":
|
|
9561
|
+
return suggestionsHandler(req);
|
|
9499
9562
|
case "history":
|
|
9500
9563
|
return historyHandler(req);
|
|
9501
9564
|
case "feedback":
|
|
@@ -144,40 +144,10 @@ declare function sseObservabilityFrame(trace: unknown): string;
|
|
|
144
144
|
declare function sseErrorFrame(message: string): string;
|
|
145
145
|
/**
|
|
146
146
|
* createChatHandler — factory that returns a Next.js App Router POST handler.
|
|
147
|
-
*
|
|
148
|
-
* Accepts either a full/partial `RagConfig` **or** a pre-built `VectorPlugin`
|
|
149
|
-
* instance (preferred for singleton/multi-tenant setups).
|
|
150
|
-
*
|
|
151
|
-
* @example
|
|
152
|
-
* // Option A — pass config (plugin created once at module load time)
|
|
153
|
-
* export const POST = createChatHandler(getRagConfig());
|
|
154
|
-
*
|
|
155
|
-
* // Option B — pass a pre-built plugin (most flexible)
|
|
156
|
-
* const plugin = new VectorPlugin(getRagConfig());
|
|
157
|
-
* export const POST = createChatHandler(plugin);
|
|
158
147
|
*/
|
|
159
148
|
declare function createChatHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
160
149
|
/**
|
|
161
150
|
* createStreamHandler — factory for a streaming SSE Next.js App Router POST handler.
|
|
162
|
-
*
|
|
163
|
-
* Streams the assistant response as Server-Sent Events (SSE). Each frame is a
|
|
164
|
-
* JSON object with a `type` discriminant:
|
|
165
|
-
* - `{ type: "text", text: "..." }` — incremental text chunk
|
|
166
|
-
* - `{ type: "metadata", sources: [...] }` — retrieval metadata (last frame)
|
|
167
|
-
* - `{ type: "error", error: "..." }` — stream-level error
|
|
168
|
-
*
|
|
169
|
-
* @example
|
|
170
|
-
* // src/app/api/chat/route.ts
|
|
171
|
-
* export const POST = createStreamHandler(getRagConfig());
|
|
172
|
-
*
|
|
173
|
-
* // Client-side parsing in useRagChat.ts:
|
|
174
|
-
* // const lines = chunk.split('\n');
|
|
175
|
-
* // for (const line of lines) {
|
|
176
|
-
* // if (line.startsWith('data: ')) {
|
|
177
|
-
* // const frame = JSON.parse(line.slice(6));
|
|
178
|
-
* // if (frame.type === 'text') { ... }
|
|
179
|
-
* // }
|
|
180
|
-
* // }
|
|
181
151
|
*/
|
|
182
152
|
declare function createStreamHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
183
153
|
/**
|
|
@@ -194,6 +164,7 @@ declare function createHealthHandler(configOrPlugin?: Partial<RagConfig> | Vecto
|
|
|
194
164
|
declare function createUploadHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
195
165
|
/**
|
|
196
166
|
* createSuggestionsHandler — factory for the auto-suggestions endpoint.
|
|
167
|
+
* Supports both POST (JSON body) and GET (URL search parameters).
|
|
197
168
|
*/
|
|
198
169
|
declare function createSuggestionsHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
199
170
|
/**
|
|
@@ -144,40 +144,10 @@ declare function sseObservabilityFrame(trace: unknown): string;
|
|
|
144
144
|
declare function sseErrorFrame(message: string): string;
|
|
145
145
|
/**
|
|
146
146
|
* createChatHandler — factory that returns a Next.js App Router POST handler.
|
|
147
|
-
*
|
|
148
|
-
* Accepts either a full/partial `RagConfig` **or** a pre-built `VectorPlugin`
|
|
149
|
-
* instance (preferred for singleton/multi-tenant setups).
|
|
150
|
-
*
|
|
151
|
-
* @example
|
|
152
|
-
* // Option A — pass config (plugin created once at module load time)
|
|
153
|
-
* export const POST = createChatHandler(getRagConfig());
|
|
154
|
-
*
|
|
155
|
-
* // Option B — pass a pre-built plugin (most flexible)
|
|
156
|
-
* const plugin = new VectorPlugin(getRagConfig());
|
|
157
|
-
* export const POST = createChatHandler(plugin);
|
|
158
147
|
*/
|
|
159
148
|
declare function createChatHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
160
149
|
/**
|
|
161
150
|
* createStreamHandler — factory for a streaming SSE Next.js App Router POST handler.
|
|
162
|
-
*
|
|
163
|
-
* Streams the assistant response as Server-Sent Events (SSE). Each frame is a
|
|
164
|
-
* JSON object with a `type` discriminant:
|
|
165
|
-
* - `{ type: "text", text: "..." }` — incremental text chunk
|
|
166
|
-
* - `{ type: "metadata", sources: [...] }` — retrieval metadata (last frame)
|
|
167
|
-
* - `{ type: "error", error: "..." }` — stream-level error
|
|
168
|
-
*
|
|
169
|
-
* @example
|
|
170
|
-
* // src/app/api/chat/route.ts
|
|
171
|
-
* export const POST = createStreamHandler(getRagConfig());
|
|
172
|
-
*
|
|
173
|
-
* // Client-side parsing in useRagChat.ts:
|
|
174
|
-
* // const lines = chunk.split('\n');
|
|
175
|
-
* // for (const line of lines) {
|
|
176
|
-
* // if (line.startsWith('data: ')) {
|
|
177
|
-
* // const frame = JSON.parse(line.slice(6));
|
|
178
|
-
* // if (frame.type === 'text') { ... }
|
|
179
|
-
* // }
|
|
180
|
-
* // }
|
|
181
151
|
*/
|
|
182
152
|
declare function createStreamHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
183
153
|
/**
|
|
@@ -194,6 +164,7 @@ declare function createHealthHandler(configOrPlugin?: Partial<RagConfig> | Vecto
|
|
|
194
164
|
declare function createUploadHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
195
165
|
/**
|
|
196
166
|
* createSuggestionsHandler — factory for the auto-suggestions endpoint.
|
|
167
|
+
* Supports both POST (JSON body) and GET (URL search parameters).
|
|
197
168
|
*/
|
|
198
169
|
declare function createSuggestionsHandler(configOrPlugin?: Partial<RagConfig> | VectorPlugin, options?: HandlerOptions): (req: NextRequest) => Promise<any>;
|
|
199
170
|
/**
|
package/dist/index.js
CHANGED
|
@@ -3070,11 +3070,20 @@ function ChatWindow({
|
|
|
3070
3070
|
const timer = setTimeout(async () => {
|
|
3071
3071
|
setIsSuggesting(true);
|
|
3072
3072
|
try {
|
|
3073
|
-
const
|
|
3073
|
+
const base = retrivoraApiBase || "/api/retrivora";
|
|
3074
|
+
const primaryUrl = `${base}/suggestions`;
|
|
3075
|
+
let response = await fetch(primaryUrl, {
|
|
3074
3076
|
method: "POST",
|
|
3075
|
-
headers: { "Content-Type": "application/json" },
|
|
3077
|
+
headers: __spreadValues({ "Content-Type": "application/json" }, headers || {}),
|
|
3076
3078
|
body: JSON.stringify({ query: input, namespace: projectId })
|
|
3077
3079
|
});
|
|
3080
|
+
if (!response.ok && response.status === 404) {
|
|
3081
|
+
response = await fetch("/api/suggestions", {
|
|
3082
|
+
method: "POST",
|
|
3083
|
+
headers: __spreadValues({ "Content-Type": "application/json" }, headers || {}),
|
|
3084
|
+
body: JSON.stringify({ query: input, namespace: projectId })
|
|
3085
|
+
});
|
|
3086
|
+
}
|
|
3078
3087
|
const data = await response.json();
|
|
3079
3088
|
if (data.suggestions) {
|
|
3080
3089
|
setSuggestions(data.suggestions);
|
|
@@ -3086,7 +3095,7 @@ function ChatWindow({
|
|
|
3086
3095
|
}
|
|
3087
3096
|
}, 800);
|
|
3088
3097
|
return () => clearTimeout(timer);
|
|
3089
|
-
}, [input, projectId]);
|
|
3098
|
+
}, [input, projectId, retrivoraApiBase, headers]);
|
|
3090
3099
|
return /* @__PURE__ */ (0, import_jsx_runtime13.jsxs)(
|
|
3091
3100
|
"div",
|
|
3092
3101
|
{
|
package/dist/index.mjs
CHANGED
|
@@ -3077,11 +3077,20 @@ function ChatWindow({
|
|
|
3077
3077
|
const timer = setTimeout(async () => {
|
|
3078
3078
|
setIsSuggesting(true);
|
|
3079
3079
|
try {
|
|
3080
|
-
const
|
|
3080
|
+
const base = retrivoraApiBase || "/api/retrivora";
|
|
3081
|
+
const primaryUrl = `${base}/suggestions`;
|
|
3082
|
+
let response = await fetch(primaryUrl, {
|
|
3081
3083
|
method: "POST",
|
|
3082
|
-
headers: { "Content-Type": "application/json" },
|
|
3084
|
+
headers: __spreadValues({ "Content-Type": "application/json" }, headers || {}),
|
|
3083
3085
|
body: JSON.stringify({ query: input, namespace: projectId })
|
|
3084
3086
|
});
|
|
3087
|
+
if (!response.ok && response.status === 404) {
|
|
3088
|
+
response = await fetch("/api/suggestions", {
|
|
3089
|
+
method: "POST",
|
|
3090
|
+
headers: __spreadValues({ "Content-Type": "application/json" }, headers || {}),
|
|
3091
|
+
body: JSON.stringify({ query: input, namespace: projectId })
|
|
3092
|
+
});
|
|
3093
|
+
}
|
|
3085
3094
|
const data = await response.json();
|
|
3086
3095
|
if (data.suggestions) {
|
|
3087
3096
|
setSuggestions(data.suggestions);
|
|
@@ -3093,7 +3102,7 @@ function ChatWindow({
|
|
|
3093
3102
|
}
|
|
3094
3103
|
}, 800);
|
|
3095
3104
|
return () => clearTimeout(timer);
|
|
3096
|
-
}, [input, projectId]);
|
|
3105
|
+
}, [input, projectId, retrivoraApiBase, headers]);
|
|
3097
3106
|
return /* @__PURE__ */ jsxs12(
|
|
3098
3107
|
"div",
|
|
3099
3108
|
{
|
package/dist/server.d.mts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { p as VectorDBConfig, L as LLMConfig, e as EmbeddingConfig, k as RagConfig, n as UniversalRagConfig, o as UpsertDocument, V as VectorMatch, G as GraphDBConfig, r as GraphNode, s as Edge, t as GraphSearchResult, I as ILLMProvider, q as VectorDBProvider, h as LLMProvider, f as EmbeddingProvider, j as RAGConfig, U as UIConfig, C as ChatMessage, c as ChatOptions, E as EmbedOptions } from './ILLMProvider-DMxLyTdq.mjs';
|
|
2
2
|
export { d as ChatResponse, g as IngestDocument, l as RetrievalConfig, W as WorkflowConfig } from './ILLMProvider-DMxLyTdq.mjs';
|
|
3
3
|
export { A as AuthenticationException, C as Chunk, a as ChunkOptions, b as ConfigurationException, D as DocumentChunker, E as EmbeddingFailedException, g as Pipeline, P as ProviderNotFoundException, R as RateLimitException, c as RetrievalException, d as Retrivora, e as RetrivoraError, f as RetrivoraErrorCode, w as wrapError } from './index-xygonxpW.mjs';
|
|
4
|
-
import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-
|
|
5
|
-
export { C as ConfigValidator, V as ValidationError, b as VectorPlugin, c as createChatHandler, d as createFeedbackHandler, e as createHealthHandler, f as createHistoryHandler, g as createIngestHandler, h as createRagHandler, i as createSessionsHandler, j as createStreamHandler, k as createUploadHandler, s as sseErrorFrame, l as sseFrame, m as sseMetaFrame, n as sseTextFrame } from './index-
|
|
4
|
+
import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-DHsFLJXQ.mjs';
|
|
5
|
+
export { C as ConfigValidator, V as ValidationError, b as VectorPlugin, c as createChatHandler, d as createFeedbackHandler, e as createHealthHandler, f as createHistoryHandler, g as createIngestHandler, h as createRagHandler, i as createSessionsHandler, j as createStreamHandler, k as createUploadHandler, s as sseErrorFrame, l as sseFrame, m as sseMetaFrame, n as sseTextFrame } from './index-DHsFLJXQ.mjs';
|
|
6
6
|
import 'next/server';
|
|
7
7
|
|
|
8
8
|
interface LicensePayload {
|
package/dist/server.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { p as VectorDBConfig, L as LLMConfig, e as EmbeddingConfig, k as RagConfig, n as UniversalRagConfig, o as UpsertDocument, V as VectorMatch, G as GraphDBConfig, r as GraphNode, s as Edge, t as GraphSearchResult, I as ILLMProvider, q as VectorDBProvider, h as LLMProvider, f as EmbeddingProvider, j as RAGConfig, U as UIConfig, C as ChatMessage, c as ChatOptions, E as EmbedOptions } from './ILLMProvider-DMxLyTdq.js';
|
|
2
2
|
export { d as ChatResponse, g as IngestDocument, l as RetrievalConfig, W as WorkflowConfig } from './ILLMProvider-DMxLyTdq.js';
|
|
3
3
|
export { A as AuthenticationException, C as Chunk, a as ChunkOptions, b as ConfigurationException, D as DocumentChunker, E as EmbeddingFailedException, g as Pipeline, P as ProviderNotFoundException, R as RateLimitException, c as RetrievalException, d as Retrivora, e as RetrivoraError, f as RetrivoraErrorCode, w as wrapError } from './index-CfkqZd2Y.js';
|
|
4
|
-
import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-
|
|
5
|
-
export { C as ConfigValidator, V as ValidationError, b as VectorPlugin, c as createChatHandler, d as createFeedbackHandler, e as createHealthHandler, f as createHistoryHandler, g as createIngestHandler, h as createRagHandler, i as createSessionsHandler, j as createStreamHandler, k as createUploadHandler, s as sseErrorFrame, l as sseFrame, m as sseMetaFrame, n as sseTextFrame } from './index-
|
|
4
|
+
import { H as HealthCheckResult, I as IProviderValidator, a as IProviderHealthChecker } from './index-tzwc7UhY.js';
|
|
5
|
+
export { C as ConfigValidator, V as ValidationError, b as VectorPlugin, c as createChatHandler, d as createFeedbackHandler, e as createHealthHandler, f as createHistoryHandler, g as createIngestHandler, h as createRagHandler, i as createSessionsHandler, j as createStreamHandler, k as createUploadHandler, s as sseErrorFrame, l as sseFrame, m as sseMetaFrame, n as sseTextFrame } from './index-tzwc7UhY.js';
|
|
6
6
|
import 'next/server';
|
|
7
7
|
|
|
8
8
|
interface LicensePayload {
|