@retrivora-ai/rag-engine 2.5.5 → 2.5.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{ILLMProvider-DO5gj-e5.d.mts → ILLMProvider-DwFj0h2u.d.mts} +2 -2
- package/dist/{ILLMProvider-DO5gj-e5.d.ts → ILLMProvider-DwFj0h2u.d.ts} +2 -2
- package/dist/handlers/index.d.mts +2 -2
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.js +191 -27
- package/dist/handlers/index.mjs +185 -21
- package/dist/{index-BKOyhayB.d.mts → index-Byv5MaYi.d.mts} +1 -1
- package/dist/{index-DkOhRqEc.d.ts → index-Cb0GsT16.d.ts} +1 -1
- package/dist/{index-DE8qPWpI.d.mts → index-D1jN8KSF.d.mts} +1 -1
- package/dist/{index-8vijDPfT.d.ts → index-DP3_OpuB.d.ts} +1 -1
- package/dist/index.d.mts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/server.d.mts +57 -10
- package/dist/server.d.ts +57 -10
- package/dist/server.js +199 -33
- package/dist/server.mjs +192 -27
- package/package.json +1 -1
package/dist/server.mjs
CHANGED
|
@@ -326,7 +326,7 @@ var init_package = __esm({
|
|
|
326
326
|
"package.json"() {
|
|
327
327
|
package_default = {
|
|
328
328
|
name: "@retrivora-ai/rag-engine",
|
|
329
|
-
version: "2.5.
|
|
329
|
+
version: "2.5.6",
|
|
330
330
|
description: "Retrivora AI is a plug-and-play AI engine for RAG chat experiences \u2014 generic vector DB + LLM provider, embeddable or standalone.",
|
|
331
331
|
author: "Abhinav Alkuchi",
|
|
332
332
|
license: "UNLICENSED",
|
|
@@ -1770,7 +1770,7 @@ var MilvusProvider_exports = {};
|
|
|
1770
1770
|
__export(MilvusProvider_exports, {
|
|
1771
1771
|
MilvusProvider: () => MilvusProvider
|
|
1772
1772
|
});
|
|
1773
|
-
import
|
|
1773
|
+
import axios4 from "axios";
|
|
1774
1774
|
var MilvusProvider;
|
|
1775
1775
|
var init_MilvusProvider = __esm({
|
|
1776
1776
|
"src/providers/vectordb/MilvusProvider.ts"() {
|
|
@@ -1782,7 +1782,7 @@ var init_MilvusProvider = __esm({
|
|
|
1782
1782
|
const opts = config.options;
|
|
1783
1783
|
const baseUrl = opts.baseUrl || opts.uri || (opts.host ? `http://${opts.host}:${opts.port || 19530}` : void 0);
|
|
1784
1784
|
if (!baseUrl) throw new Error("[MilvusProvider] options.baseUrl (or uri / host+port) is required");
|
|
1785
|
-
this.http =
|
|
1785
|
+
this.http = axios4.create({
|
|
1786
1786
|
baseURL: baseUrl,
|
|
1787
1787
|
headers: __spreadValues(__spreadValues({
|
|
1788
1788
|
"Content-Type": "application/json"
|
|
@@ -1883,7 +1883,7 @@ var QdrantProvider_exports = {};
|
|
|
1883
1883
|
__export(QdrantProvider_exports, {
|
|
1884
1884
|
QdrantProvider: () => QdrantProvider
|
|
1885
1885
|
});
|
|
1886
|
-
import
|
|
1886
|
+
import axios5 from "axios";
|
|
1887
1887
|
import crypto from "crypto";
|
|
1888
1888
|
var QdrantProvider;
|
|
1889
1889
|
var init_QdrantProvider = __esm({
|
|
@@ -1900,7 +1900,7 @@ var init_QdrantProvider = __esm({
|
|
|
1900
1900
|
this.contentField = opts.contentField || "content";
|
|
1901
1901
|
this.metadataField = opts.metadataField || "metadata";
|
|
1902
1902
|
this.isFlatPayload = !!opts.flatPayload;
|
|
1903
|
-
this.http =
|
|
1903
|
+
this.http = axios5.create({
|
|
1904
1904
|
baseURL: baseUrl,
|
|
1905
1905
|
timeout: 15e3,
|
|
1906
1906
|
// 15s timeout for vector DB operations
|
|
@@ -1968,7 +1968,7 @@ var init_QdrantProvider = __esm({
|
|
|
1968
1968
|
try {
|
|
1969
1969
|
await this.http.get(`/collections/${this.indexName}`);
|
|
1970
1970
|
} catch (err) {
|
|
1971
|
-
if (
|
|
1971
|
+
if (axios5.isAxiosError(err) && ((_a2 = err.response) == null ? void 0 : _a2.status) === 404) {
|
|
1972
1972
|
const opts = this.config.options;
|
|
1973
1973
|
const dimensionsForCreate = opts.dimensions || 1536;
|
|
1974
1974
|
await this.http.put(`/collections/${this.indexName}`, {
|
|
@@ -1998,7 +1998,7 @@ var init_QdrantProvider = __esm({
|
|
|
1998
1998
|
});
|
|
1999
1999
|
} catch (err) {
|
|
2000
2000
|
let status;
|
|
2001
|
-
if (
|
|
2001
|
+
if (axios5.isAxiosError(err)) status = (_a2 = err.response) == null ? void 0 : _a2.status;
|
|
2002
2002
|
if (status === 409) return;
|
|
2003
2003
|
console.warn(`[QdrantProvider] \u26A0\uFE0F Could not ensure index for "${fullPath}":`, err instanceof Error ? err.message : String(err));
|
|
2004
2004
|
}
|
|
@@ -2122,7 +2122,7 @@ var ChromaDBProvider_exports = {};
|
|
|
2122
2122
|
__export(ChromaDBProvider_exports, {
|
|
2123
2123
|
ChromaDBProvider: () => ChromaDBProvider
|
|
2124
2124
|
});
|
|
2125
|
-
import
|
|
2125
|
+
import axios6 from "axios";
|
|
2126
2126
|
var ChromaDBProvider;
|
|
2127
2127
|
var init_ChromaDBProvider = __esm({
|
|
2128
2128
|
"src/providers/vectordb/ChromaDBProvider.ts"() {
|
|
@@ -2135,7 +2135,7 @@ var init_ChromaDBProvider = __esm({
|
|
|
2135
2135
|
const opts = config.options;
|
|
2136
2136
|
const baseUrl = opts.baseUrl || (opts.host ? `http://${opts.host}:${opts.port || 8e3}` : void 0);
|
|
2137
2137
|
if (!baseUrl) throw new Error("[ChromaDBProvider] options.baseUrl is required");
|
|
2138
|
-
this.http =
|
|
2138
|
+
this.http = axios6.create({
|
|
2139
2139
|
baseURL: baseUrl,
|
|
2140
2140
|
headers: { "Content-Type": "application/json" }
|
|
2141
2141
|
});
|
|
@@ -2149,7 +2149,7 @@ var init_ChromaDBProvider = __esm({
|
|
|
2149
2149
|
const { data } = await this.http.get(`/api/v1/collections/${this.indexName}`);
|
|
2150
2150
|
this.collectionId = data.id;
|
|
2151
2151
|
} catch (err) {
|
|
2152
|
-
if (
|
|
2152
|
+
if (axios6.isAxiosError(err) && ((_a2 = err.response) == null ? void 0 : _a2.status) === 404) {
|
|
2153
2153
|
const { data } = await this.http.post("/api/v1/collections", {
|
|
2154
2154
|
name: this.indexName
|
|
2155
2155
|
});
|
|
@@ -2230,7 +2230,7 @@ var RedisProvider_exports = {};
|
|
|
2230
2230
|
__export(RedisProvider_exports, {
|
|
2231
2231
|
RedisProvider: () => RedisProvider
|
|
2232
2232
|
});
|
|
2233
|
-
import
|
|
2233
|
+
import axios7 from "axios";
|
|
2234
2234
|
var RedisProvider;
|
|
2235
2235
|
var init_RedisProvider = __esm({
|
|
2236
2236
|
"src/providers/vectordb/RedisProvider.ts"() {
|
|
@@ -2242,7 +2242,7 @@ var init_RedisProvider = __esm({
|
|
|
2242
2242
|
const opts = config.options;
|
|
2243
2243
|
const baseUrl = opts.baseUrl || opts.url || (opts.host ? `http://${opts.host}:${opts.port || 6379}` : void 0);
|
|
2244
2244
|
if (!baseUrl) throw new Error("[RedisProvider] options.baseUrl is required");
|
|
2245
|
-
this.http =
|
|
2245
|
+
this.http = axios7.create({
|
|
2246
2246
|
baseURL: baseUrl,
|
|
2247
2247
|
headers: __spreadValues({
|
|
2248
2248
|
"Content-Type": "application/json"
|
|
@@ -2312,7 +2312,7 @@ var WeaviateProvider_exports = {};
|
|
|
2312
2312
|
__export(WeaviateProvider_exports, {
|
|
2313
2313
|
WeaviateProvider: () => WeaviateProvider
|
|
2314
2314
|
});
|
|
2315
|
-
import
|
|
2315
|
+
import axios8 from "axios";
|
|
2316
2316
|
var WeaviateProvider;
|
|
2317
2317
|
var init_WeaviateProvider = __esm({
|
|
2318
2318
|
"src/providers/vectordb/WeaviateProvider.ts"() {
|
|
@@ -2324,7 +2324,7 @@ var init_WeaviateProvider = __esm({
|
|
|
2324
2324
|
const opts = config.options;
|
|
2325
2325
|
const baseUrl = opts.baseUrl || opts.url;
|
|
2326
2326
|
if (!baseUrl) throw new Error("[WeaviateProvider] options.baseUrl is required");
|
|
2327
|
-
this.http =
|
|
2327
|
+
this.http = axios8.create({
|
|
2328
2328
|
baseURL: baseUrl,
|
|
2329
2329
|
headers: __spreadValues(__spreadValues({
|
|
2330
2330
|
"Content-Type": "application/json"
|
|
@@ -2464,7 +2464,7 @@ var UniversalVectorProvider_exports = {};
|
|
|
2464
2464
|
__export(UniversalVectorProvider_exports, {
|
|
2465
2465
|
UniversalVectorProvider: () => UniversalVectorProvider
|
|
2466
2466
|
});
|
|
2467
|
-
import
|
|
2467
|
+
import axios9 from "axios";
|
|
2468
2468
|
var UniversalVectorProvider;
|
|
2469
2469
|
var init_UniversalVectorProvider = __esm({
|
|
2470
2470
|
"src/providers/vectordb/UniversalVectorProvider.ts"() {
|
|
@@ -2481,7 +2481,7 @@ var init_UniversalVectorProvider = __esm({
|
|
|
2481
2481
|
}
|
|
2482
2482
|
async initialize() {
|
|
2483
2483
|
var _a2;
|
|
2484
|
-
this.http =
|
|
2484
|
+
this.http = axios9.create({
|
|
2485
2485
|
baseURL: this.opts.baseUrl,
|
|
2486
2486
|
headers: __spreadValues({
|
|
2487
2487
|
"Content-Type": "application/json"
|
|
@@ -3061,7 +3061,9 @@ var LLM_PROVIDERS = [
|
|
|
3061
3061
|
"qwen",
|
|
3062
3062
|
"rest",
|
|
3063
3063
|
"universal_rest",
|
|
3064
|
-
"custom"
|
|
3064
|
+
"custom",
|
|
3065
|
+
"custom_embedding",
|
|
3066
|
+
"local_embedding"
|
|
3065
3067
|
];
|
|
3066
3068
|
var EMBEDDING_PROVIDERS = [
|
|
3067
3069
|
"openai",
|
|
@@ -3070,7 +3072,9 @@ var EMBEDDING_PROVIDERS = [
|
|
|
3070
3072
|
"qwen",
|
|
3071
3073
|
"rest",
|
|
3072
3074
|
"universal_rest",
|
|
3073
|
-
"custom"
|
|
3075
|
+
"custom",
|
|
3076
|
+
"custom_embedding",
|
|
3077
|
+
"local_embedding"
|
|
3074
3078
|
];
|
|
3075
3079
|
var PROVIDERS_WITH_EMBEDDINGS = [
|
|
3076
3080
|
"openai",
|
|
@@ -3078,7 +3082,10 @@ var PROVIDERS_WITH_EMBEDDINGS = [
|
|
|
3078
3082
|
"gemini",
|
|
3079
3083
|
"qwen",
|
|
3080
3084
|
"rest",
|
|
3081
|
-
"universal_rest"
|
|
3085
|
+
"universal_rest",
|
|
3086
|
+
"custom",
|
|
3087
|
+
"custom_embedding",
|
|
3088
|
+
"local_embedding"
|
|
3082
3089
|
];
|
|
3083
3090
|
|
|
3084
3091
|
// src/config/serverConfig.ts
|
|
@@ -3824,8 +3831,8 @@ var OllamaProvider = class {
|
|
|
3824
3831
|
const baseUrl = config.baseUrl || "http://localhost:11434";
|
|
3825
3832
|
const modelName = config.model;
|
|
3826
3833
|
try {
|
|
3827
|
-
const
|
|
3828
|
-
const { data } = await
|
|
3834
|
+
const axios11 = (await import("axios")).default;
|
|
3835
|
+
const { data } = await axios11.get(`${baseUrl}/api/tags`);
|
|
3829
3836
|
const models = data.models || [];
|
|
3830
3837
|
const hasModel = models.some((m) => m.name === modelName || m.name.startsWith(`${modelName}:`));
|
|
3831
3838
|
return {
|
|
@@ -4942,6 +4949,158 @@ ${context != null ? context : "None"}` },
|
|
|
4942
4949
|
}
|
|
4943
4950
|
};
|
|
4944
4951
|
|
|
4952
|
+
// src/llm/providers/CustomEmbeddingProvider.ts
|
|
4953
|
+
init_templateUtils();
|
|
4954
|
+
import axios3 from "axios";
|
|
4955
|
+
var CustomEmbeddingProvider = class {
|
|
4956
|
+
constructor(config) {
|
|
4957
|
+
var _a2, _b;
|
|
4958
|
+
this.model = config.model || "custom-embedding-model";
|
|
4959
|
+
this.apiKey = config.apiKey;
|
|
4960
|
+
const options = (_a2 = config.options) != null ? _a2 : {};
|
|
4961
|
+
this.opts = {
|
|
4962
|
+
baseUrl: config.baseUrl || options.baseUrl,
|
|
4963
|
+
embedPath: options.embedPath || "/embeddings",
|
|
4964
|
+
pingPath: options.pingPath || "/health",
|
|
4965
|
+
queryPrefix: options.queryPrefix || "",
|
|
4966
|
+
documentPrefix: options.documentPrefix || "",
|
|
4967
|
+
embedPayloadTemplate: options.embedPayloadTemplate,
|
|
4968
|
+
embedExtractPath: options.embedExtractPath,
|
|
4969
|
+
headers: options.headers || {},
|
|
4970
|
+
timeout: options.timeout || 3e4
|
|
4971
|
+
};
|
|
4972
|
+
this.baseUrl = (_b = this.opts.baseUrl) != null ? _b : "";
|
|
4973
|
+
if (!this.baseUrl) {
|
|
4974
|
+
throw new Error("[CustomEmbeddingProvider] baseUrl is required in config or config.options");
|
|
4975
|
+
}
|
|
4976
|
+
const headers = __spreadValues(__spreadValues({
|
|
4977
|
+
"Content-Type": "application/json"
|
|
4978
|
+
}, this.apiKey ? { Authorization: `Bearer ${this.apiKey}` } : {}), this.opts.headers || {});
|
|
4979
|
+
this.http = axios3.create({
|
|
4980
|
+
baseURL: this.baseUrl.replace(/\/$/, ""),
|
|
4981
|
+
headers,
|
|
4982
|
+
timeout: this.opts.timeout
|
|
4983
|
+
});
|
|
4984
|
+
}
|
|
4985
|
+
/**
|
|
4986
|
+
* Dummy chat implementation. CustomEmbeddingProvider is dedicated to embedding generation.
|
|
4987
|
+
*/
|
|
4988
|
+
async chat(_messages, _context, _options) {
|
|
4989
|
+
throw new Error("[CustomEmbeddingProvider] chat() is not supported on a dedicated embedding provider.");
|
|
4990
|
+
}
|
|
4991
|
+
/**
|
|
4992
|
+
* Generate vector embedding for a single string.
|
|
4993
|
+
*/
|
|
4994
|
+
async embed(text, options) {
|
|
4995
|
+
var _a2;
|
|
4996
|
+
const taskType = (_a2 = options == null ? void 0 : options.taskType) != null ? _a2 : "document";
|
|
4997
|
+
const prefix = taskType === "query" ? this.opts.queryPrefix : this.opts.documentPrefix;
|
|
4998
|
+
const formattedText = prefix ? `${prefix}${text}` : text;
|
|
4999
|
+
const modelToUse = (options == null ? void 0 : options.model) || this.model;
|
|
5000
|
+
const path2 = this.opts.embedPath || "/embeddings";
|
|
5001
|
+
let payload;
|
|
5002
|
+
if (this.opts.embedPayloadTemplate) {
|
|
5003
|
+
payload = buildPayload(this.opts.embedPayloadTemplate, {
|
|
5004
|
+
input: formattedText,
|
|
5005
|
+
model: modelToUse
|
|
5006
|
+
});
|
|
5007
|
+
} else {
|
|
5008
|
+
payload = {
|
|
5009
|
+
model: modelToUse,
|
|
5010
|
+
input: formattedText
|
|
5011
|
+
};
|
|
5012
|
+
}
|
|
5013
|
+
try {
|
|
5014
|
+
const { data } = await this.http.post(path2, payload);
|
|
5015
|
+
const vector = this.extractVector(data);
|
|
5016
|
+
if (vector) return vector;
|
|
5017
|
+
throw new Error(`[CustomEmbeddingProvider] Failed to extract embedding vector from response at ${path2}`);
|
|
5018
|
+
} catch (err) {
|
|
5019
|
+
console.error("[CustomEmbeddingProvider] Embedding request failed:", {
|
|
5020
|
+
baseUrl: this.baseUrl,
|
|
5021
|
+
path: path2,
|
|
5022
|
+
model: modelToUse,
|
|
5023
|
+
error: (err == null ? void 0 : err.message) || err
|
|
5024
|
+
});
|
|
5025
|
+
throw err;
|
|
5026
|
+
}
|
|
5027
|
+
}
|
|
5028
|
+
/**
|
|
5029
|
+
* Batch embedding generation for multiple texts.
|
|
5030
|
+
*/
|
|
5031
|
+
async batchEmbed(texts, options) {
|
|
5032
|
+
var _a2;
|
|
5033
|
+
if (!Array.isArray(texts) || texts.length === 0) return [];
|
|
5034
|
+
const taskType = (_a2 = options == null ? void 0 : options.taskType) != null ? _a2 : "document";
|
|
5035
|
+
const prefix = taskType === "query" ? this.opts.queryPrefix : this.opts.documentPrefix;
|
|
5036
|
+
const formattedTexts = prefix ? texts.map((t) => `${prefix}${t}`) : texts;
|
|
5037
|
+
const modelToUse = (options == null ? void 0 : options.model) || this.model;
|
|
5038
|
+
const path2 = this.opts.embedPath || "/embeddings";
|
|
5039
|
+
if (!this.opts.embedPayloadTemplate) {
|
|
5040
|
+
try {
|
|
5041
|
+
const payload = {
|
|
5042
|
+
model: modelToUse,
|
|
5043
|
+
input: formattedTexts
|
|
5044
|
+
};
|
|
5045
|
+
const { data } = await this.http.post(path2, payload);
|
|
5046
|
+
const batchVectors = this.extractBatchVectors(data);
|
|
5047
|
+
if (batchVectors && batchVectors.length === texts.length) {
|
|
5048
|
+
return batchVectors;
|
|
5049
|
+
}
|
|
5050
|
+
} catch (e) {
|
|
5051
|
+
}
|
|
5052
|
+
}
|
|
5053
|
+
return Promise.all(texts.map((text) => this.embed(text, options)));
|
|
5054
|
+
}
|
|
5055
|
+
/**
|
|
5056
|
+
* Ping provider endpoint for health check.
|
|
5057
|
+
*/
|
|
5058
|
+
async ping() {
|
|
5059
|
+
try {
|
|
5060
|
+
const pingPath = this.opts.pingPath || "/health";
|
|
5061
|
+
const res = await this.http.get(pingPath);
|
|
5062
|
+
return res.status >= 200 && res.status < 300;
|
|
5063
|
+
} catch (e) {
|
|
5064
|
+
try {
|
|
5065
|
+
const embedPath = this.opts.embedPath || "/embeddings";
|
|
5066
|
+
await this.http.post(embedPath, { input: "ping", model: this.model });
|
|
5067
|
+
return true;
|
|
5068
|
+
} catch (e2) {
|
|
5069
|
+
return false;
|
|
5070
|
+
}
|
|
5071
|
+
}
|
|
5072
|
+
}
|
|
5073
|
+
extractVector(data) {
|
|
5074
|
+
if (!data) return void 0;
|
|
5075
|
+
if (this.opts.embedExtractPath) {
|
|
5076
|
+
const extracted = resolvePath(data, this.opts.embedExtractPath);
|
|
5077
|
+
if (Array.isArray(extracted) && typeof extracted[0] === "number") {
|
|
5078
|
+
return extracted;
|
|
5079
|
+
}
|
|
5080
|
+
}
|
|
5081
|
+
const directVector = resolvePath(data, "data[0].embedding") || resolvePath(data, "embedding") || resolvePath(data, "embeddings[0]") || resolvePath(data, "data[0].vector") || resolvePath(data, "vector");
|
|
5082
|
+
if (Array.isArray(directVector) && typeof directVector[0] === "number") {
|
|
5083
|
+
return directVector;
|
|
5084
|
+
}
|
|
5085
|
+
if (Array.isArray(data) && typeof data[0] === "number") {
|
|
5086
|
+
return data;
|
|
5087
|
+
}
|
|
5088
|
+
return void 0;
|
|
5089
|
+
}
|
|
5090
|
+
extractBatchVectors(data) {
|
|
5091
|
+
if (!data) return void 0;
|
|
5092
|
+
if (typeof data === "object" && data !== null && Array.isArray(data.data)) {
|
|
5093
|
+
const list = data.data;
|
|
5094
|
+
const vectors = list.map((item) => (item == null ? void 0 : item.embedding) || (item == null ? void 0 : item.vector)).filter((v) => Array.isArray(v));
|
|
5095
|
+
if (vectors.length > 0) return vectors;
|
|
5096
|
+
}
|
|
5097
|
+
if (Array.isArray(data) && Array.isArray(data[0]) && typeof data[0][0] === "number") {
|
|
5098
|
+
return data;
|
|
5099
|
+
}
|
|
5100
|
+
return void 0;
|
|
5101
|
+
}
|
|
5102
|
+
};
|
|
5103
|
+
|
|
4945
5104
|
// src/llm/LLMFactory.ts
|
|
4946
5105
|
var customProviders = /* @__PURE__ */ new Map();
|
|
4947
5106
|
var LLMFactory = class _LLMFactory {
|
|
@@ -4984,6 +5143,8 @@ var LLMFactory = class _LLMFactory {
|
|
|
4984
5143
|
"rest",
|
|
4985
5144
|
"universal_rest",
|
|
4986
5145
|
"custom",
|
|
5146
|
+
"custom_embedding",
|
|
5147
|
+
"local_embedding",
|
|
4987
5148
|
...Array.from(customProviders.keys())
|
|
4988
5149
|
];
|
|
4989
5150
|
}
|
|
@@ -5002,6 +5163,9 @@ var LLMFactory = class _LLMFactory {
|
|
|
5002
5163
|
return new GroqProvider(llmConfig, embeddingConfig);
|
|
5003
5164
|
case "qwen":
|
|
5004
5165
|
return new QwenProvider(llmConfig, embeddingConfig);
|
|
5166
|
+
case "custom_embedding":
|
|
5167
|
+
case "local_embedding":
|
|
5168
|
+
return new CustomEmbeddingProvider(llmConfig);
|
|
5005
5169
|
case "rest":
|
|
5006
5170
|
case "universal_rest":
|
|
5007
5171
|
case "custom":
|
|
@@ -12478,7 +12642,7 @@ _LicenseValidator.SUCCESS_CACHE_TTL_MS = 5 * 60 * 1e3;
|
|
|
12478
12642
|
var LicenseValidator = _LicenseValidator;
|
|
12479
12643
|
|
|
12480
12644
|
// src/config/LicenseConfigResolver.ts
|
|
12481
|
-
import
|
|
12645
|
+
import axios10 from "axios";
|
|
12482
12646
|
var LicenseConfigResolver = class {
|
|
12483
12647
|
/**
|
|
12484
12648
|
* Validate and resolve configuration from license key
|
|
@@ -12502,7 +12666,7 @@ var LicenseConfigResolver = class {
|
|
|
12502
12666
|
*/
|
|
12503
12667
|
static async fetchTierConfig(licenseKey, projectId) {
|
|
12504
12668
|
try {
|
|
12505
|
-
const response = await
|
|
12669
|
+
const response = await axios10.post(
|
|
12506
12670
|
this.RETRIVORA_CONFIG_URL,
|
|
12507
12671
|
{ licenseKey, projectId },
|
|
12508
12672
|
{
|
|
@@ -12533,7 +12697,7 @@ var LicenseConfigResolver = class {
|
|
|
12533
12697
|
*/
|
|
12534
12698
|
static async fetchProviderCredentials(licenseKey, projectId) {
|
|
12535
12699
|
try {
|
|
12536
|
-
const response = await
|
|
12700
|
+
const response = await axios10.post(
|
|
12537
12701
|
this.RETRIVORA_CREDENTIALS_URL,
|
|
12538
12702
|
{ licenseKey, projectId },
|
|
12539
12703
|
{
|
|
@@ -12731,12 +12895,12 @@ var _TelemetryService = class _TelemetryService {
|
|
|
12731
12895
|
});
|
|
12732
12896
|
}
|
|
12733
12897
|
/**
|
|
12734
|
-
* Record query execution event
|
|
12898
|
+
* Record query execution event (PII-safe)
|
|
12735
12899
|
*/
|
|
12736
12900
|
recordQueryExecuted(data) {
|
|
12737
12901
|
this.recordEvent({
|
|
12738
12902
|
eventType: "query_executed" /* QUERY_EXECUTED */,
|
|
12739
|
-
|
|
12903
|
+
queryLength: data.queryLength,
|
|
12740
12904
|
resultCount: data.resultCount,
|
|
12741
12905
|
durationMs: data.durationMs,
|
|
12742
12906
|
operationId: data.operationId
|
|
@@ -12982,7 +13146,7 @@ var LicensedRetrivora = class {
|
|
|
12982
13146
|
const durationMs = Date.now() - startTime;
|
|
12983
13147
|
if (telemetry) {
|
|
12984
13148
|
telemetry.recordQueryExecuted({
|
|
12985
|
-
queryText,
|
|
13149
|
+
queryLength: queryText.length,
|
|
12986
13150
|
resultCount: ((_a2 = response.sources) == null ? void 0 : _a2.length) || 0,
|
|
12987
13151
|
durationMs,
|
|
12988
13152
|
operationId
|
|
@@ -13063,6 +13227,7 @@ export {
|
|
|
13063
13227
|
ConfigResolver,
|
|
13064
13228
|
ConfigValidator,
|
|
13065
13229
|
ConfigurationException,
|
|
13230
|
+
CustomEmbeddingProvider,
|
|
13066
13231
|
DocumentChunker,
|
|
13067
13232
|
DocumentParser,
|
|
13068
13233
|
EmbeddingFailedException,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@retrivora-ai/rag-engine",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.6",
|
|
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",
|