@exulu/backend 1.19.0 → 1.19.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/CHANGELOG.md +3 -3
- package/dist/index.cjs +6 -4
- package/dist/index.js +6 -4
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
1
|
+
## [1.19.1](https://github.com/Qventu/exulu-backend/compare/v1.19.0...v1.19.1) (2025-08-29)
|
|
2
2
|
|
|
3
3
|
|
|
4
|
-
###
|
|
4
|
+
### Bug Fixes
|
|
5
5
|
|
|
6
|
-
*
|
|
6
|
+
* avg tot. relevance score hybrid search returned string, + add normalization vs cosine distance ([44453c6](https://github.com/Qventu/exulu-backend/commit/44453c6df3182b3356cd2d5e84055438f7eb186f))
|
package/dist/index.cjs
CHANGED
|
@@ -1421,7 +1421,7 @@ var ExuluContext = class {
|
|
|
1421
1421
|
COALESCE(1.0 / (? + ft.rank_ix), 0.0) * ?
|
|
1422
1422
|
+
|
|
1423
1423
|
COALESCE(1.0 / (? + se.rank_ix), 0.0) * ?
|
|
1424
|
-
) AS hybrid_score
|
|
1424
|
+
)::float AS hybrid_score
|
|
1425
1425
|
|
|
1426
1426
|
FROM full_text ft
|
|
1427
1427
|
FULL OUTER JOIN semantic se
|
|
@@ -1457,7 +1457,7 @@ var ExuluContext = class {
|
|
|
1457
1457
|
];
|
|
1458
1458
|
items = await db3.raw(hybridSQL, bindings).then((r) => r.rows ?? r);
|
|
1459
1459
|
}
|
|
1460
|
-
console.log("items", items
|
|
1460
|
+
console.log("items", items);
|
|
1461
1461
|
const seenSources = /* @__PURE__ */ new Map();
|
|
1462
1462
|
items = items.reduce((acc, item) => {
|
|
1463
1463
|
if (!seenSources.has(item.source)) {
|
|
@@ -1490,6 +1490,7 @@ var ExuluContext = class {
|
|
|
1490
1490
|
}
|
|
1491
1491
|
return acc;
|
|
1492
1492
|
}, []);
|
|
1493
|
+
console.log("items", items);
|
|
1493
1494
|
items.forEach((item) => {
|
|
1494
1495
|
if (!item.chunks?.length) {
|
|
1495
1496
|
return;
|
|
@@ -1511,7 +1512,8 @@ var ExuluContext = class {
|
|
|
1511
1512
|
item.averageRelevance = average;
|
|
1512
1513
|
item.totalRelevance = total;
|
|
1513
1514
|
} else if (method === "hybridSearch") {
|
|
1514
|
-
|
|
1515
|
+
console.log("item.chunks", item.chunks);
|
|
1516
|
+
const scores = item.chunks.map((c) => typeof c.hybrid_score === "number" ? c.hybrid_score * 10 + 1 : 0);
|
|
1515
1517
|
const total = scores.reduce((a, b) => a + b, 0);
|
|
1516
1518
|
const average = scores.length ? total / scores.length : 0;
|
|
1517
1519
|
item.averageRelevance = average;
|
|
@@ -5058,7 +5060,7 @@ var createWorkers = async (queues2, logger, contexts, _logsDir, tracer) => {
|
|
|
5058
5060
|
const result = await context.createAndUpsertEmbeddings(data.inputs, data.user, {
|
|
5059
5061
|
label: embedder.name,
|
|
5060
5062
|
trigger: data.trigger
|
|
5061
|
-
});
|
|
5063
|
+
}, data.role, bullmqJob.id);
|
|
5062
5064
|
return result;
|
|
5063
5065
|
}
|
|
5064
5066
|
if (bullmqJob.data.type === "workflow") {
|
package/dist/index.js
CHANGED
|
@@ -1380,7 +1380,7 @@ var ExuluContext = class {
|
|
|
1380
1380
|
COALESCE(1.0 / (? + ft.rank_ix), 0.0) * ?
|
|
1381
1381
|
+
|
|
1382
1382
|
COALESCE(1.0 / (? + se.rank_ix), 0.0) * ?
|
|
1383
|
-
) AS hybrid_score
|
|
1383
|
+
)::float AS hybrid_score
|
|
1384
1384
|
|
|
1385
1385
|
FROM full_text ft
|
|
1386
1386
|
FULL OUTER JOIN semantic se
|
|
@@ -1416,7 +1416,7 @@ var ExuluContext = class {
|
|
|
1416
1416
|
];
|
|
1417
1417
|
items = await db3.raw(hybridSQL, bindings).then((r) => r.rows ?? r);
|
|
1418
1418
|
}
|
|
1419
|
-
console.log("items", items
|
|
1419
|
+
console.log("items", items);
|
|
1420
1420
|
const seenSources = /* @__PURE__ */ new Map();
|
|
1421
1421
|
items = items.reduce((acc, item) => {
|
|
1422
1422
|
if (!seenSources.has(item.source)) {
|
|
@@ -1449,6 +1449,7 @@ var ExuluContext = class {
|
|
|
1449
1449
|
}
|
|
1450
1450
|
return acc;
|
|
1451
1451
|
}, []);
|
|
1452
|
+
console.log("items", items);
|
|
1452
1453
|
items.forEach((item) => {
|
|
1453
1454
|
if (!item.chunks?.length) {
|
|
1454
1455
|
return;
|
|
@@ -1470,7 +1471,8 @@ var ExuluContext = class {
|
|
|
1470
1471
|
item.averageRelevance = average;
|
|
1471
1472
|
item.totalRelevance = total;
|
|
1472
1473
|
} else if (method === "hybridSearch") {
|
|
1473
|
-
|
|
1474
|
+
console.log("item.chunks", item.chunks);
|
|
1475
|
+
const scores = item.chunks.map((c) => typeof c.hybrid_score === "number" ? c.hybrid_score * 10 + 1 : 0);
|
|
1474
1476
|
const total = scores.reduce((a, b) => a + b, 0);
|
|
1475
1477
|
const average = scores.length ? total / scores.length : 0;
|
|
1476
1478
|
item.averageRelevance = average;
|
|
@@ -5017,7 +5019,7 @@ var createWorkers = async (queues2, logger, contexts, _logsDir, tracer) => {
|
|
|
5017
5019
|
const result = await context.createAndUpsertEmbeddings(data.inputs, data.user, {
|
|
5018
5020
|
label: embedder.name,
|
|
5019
5021
|
trigger: data.trigger
|
|
5020
|
-
});
|
|
5022
|
+
}, data.role, bullmqJob.id);
|
|
5021
5023
|
return result;
|
|
5022
5024
|
}
|
|
5023
5025
|
if (bullmqJob.data.type === "workflow") {
|