@pellux/goodvibes-sdk 0.27.7 → 0.27.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_internal/contracts/artifacts/operator-contract.json +1 -1
- package/dist/_internal/contracts/generated/foundation-metadata.d.ts +1 -1
- package/dist/_internal/contracts/generated/foundation-metadata.js +1 -1
- package/dist/_internal/contracts/generated/operator-contract.js +1 -1
- package/dist/_internal/platform/knowledge/semantic/answer.js +1 -0
- package/dist/_internal/platform/knowledge/semantic/fact-quality.d.ts.map +1 -1
- package/dist/_internal/platform/knowledge/semantic/fact-quality.js +26 -2
- package/dist/_internal/platform/version.js +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Synced from packages/contracts/src/generated/foundation-metadata.ts
|
|
2
2
|
export const FOUNDATION_METADATA = {
|
|
3
3
|
"productId": "goodvibes",
|
|
4
|
-
"productVersion": "0.27.
|
|
4
|
+
"productVersion": "0.27.8",
|
|
5
5
|
"operatorMethodCount": 256,
|
|
6
6
|
"operatorEventCount": 30,
|
|
7
7
|
"peerEndpointCount": 6
|
|
@@ -357,6 +357,7 @@ function selectEvidenceExcerpt(query, text, facts) {
|
|
|
357
357
|
const factLines = facts
|
|
358
358
|
.map(renderFactForPrompt)
|
|
359
359
|
.filter((line) => scoreSemanticText(line, tokens) > 0)
|
|
360
|
+
.filter((line) => !featureIntent || !isLowValueFeatureOrSpecText(line))
|
|
360
361
|
.slice(0, 12);
|
|
361
362
|
const windows = evidenceWindows(text, tokens)
|
|
362
363
|
.filter((line) => !featureIntent || !isLowValueFeatureOrSpecText(line))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fact-quality.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/knowledge/semantic/fact-quality.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAcvD,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAK/E;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAQlE;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"fact-quality.d.ts","sourceRoot":"","sources":["../../../../../src/_internal/platform/knowledge/semantic/fact-quality.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAcvD,wBAAgB,4BAA4B,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAK/E;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,mBAAmB,GAAG,MAAM,CAQlE;AAED,wBAAgB,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAgCjE;AAWD,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9D;AAED,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,mBAAmB,GAAG,OAAO,CAa5E"}
|
|
@@ -29,13 +29,27 @@ export function semanticFactText(fact) {
|
|
|
29
29
|
export function isLowValueFeatureOrSpecText(text) {
|
|
30
30
|
const lower = text.toLowerCase();
|
|
31
31
|
const magicRemoteDetail = /\bmagic remote\b/.test(lower) || /\bbluetooth\b/.test(lower);
|
|
32
|
-
if (
|
|
32
|
+
if (isTruncatedManualFragment(lower))
|
|
33
|
+
return true;
|
|
34
|
+
if (/\b(items? supplied|supplied items?|included accessories|optional extras?|sold separately|separate purchase|accessories may vary|contents? of (this )?manual|may be changed|may change|subject to change|without prior notice|available menus? and options?|certified cable|unapproved items?)\b/.test(lower)) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
if (/\b(new features? may be added|features? may be added|specifications? may change|product upgrades?|due to product upgrades?)\b/.test(lower)) {
|
|
38
|
+
return true;
|
|
39
|
+
}
|
|
40
|
+
if (/\b(recommended hdmi cable types?|hdmi cable types?|ultra high speed hdmi cables?|usb extension cable|extension cable|physically fit)\b/.test(lower)) {
|
|
41
|
+
return true;
|
|
42
|
+
}
|
|
43
|
+
if (/\b(button|buttons|remote control)\b/.test(lower) && /[\u25b2\u25bc\u25c4\u25ba]|[▲▼◄►]|\\u25/.test(text)) {
|
|
33
44
|
return true;
|
|
34
45
|
}
|
|
35
46
|
if (!magicRemoteDetail && /\b(may vary|depending (upon|on) (the )?model|depending on country|depending on region)\b/.test(lower)) {
|
|
36
47
|
return true;
|
|
37
48
|
}
|
|
38
|
-
if (/\b(fasten|screws?|stand|tip over|overturn|fall over|transporting|move the tv|moving the tv|oils?|lubricants?|cleaning cloth|power cord|electric shock|fire hazard|near water|ventilation|antenna grounding)\b/.test(lower)) {
|
|
49
|
+
if (/\b(fasten|screws?|stand|tip over|overturn|fall over|transporting|move the tv|moving the tv|oils?|lubricants?|cleaning cloth|dry cloth|power cord|electric shock|fire hazard|near water|ventilation|antenna grounding|qualified personnel|customer service|servicing|repair is required|refer all servicing)\b/.test(lower)) {
|
|
50
|
+
return true;
|
|
51
|
+
}
|
|
52
|
+
if (/\bbatter(y|ies)\b/.test(lower) && /\b(remote|magic remote|button)\b/.test(lower)) {
|
|
39
53
|
return true;
|
|
40
54
|
}
|
|
41
55
|
if (/\b(bezel|less than \d+(?:\.\d+)?\s*(mm|cm|inches?)|does not fit|will not fit|fit your tv'?s usb port|usb port may not fit)\b/.test(lower)) {
|
|
@@ -46,6 +60,16 @@ export function isLowValueFeatureOrSpecText(text) {
|
|
|
46
60
|
}
|
|
47
61
|
return false;
|
|
48
62
|
}
|
|
63
|
+
function isTruncatedManualFragment(value) {
|
|
64
|
+
const trimmed = value.trim();
|
|
65
|
+
if (trimmed.length === 0)
|
|
66
|
+
return false;
|
|
67
|
+
const openParens = trimmed.match(/\(/g)?.length ?? 0;
|
|
68
|
+
const closeParens = trimmed.match(/\)/g)?.length ?? 0;
|
|
69
|
+
if (openParens > closeParens && /[\w\d]$/.test(trimmed))
|
|
70
|
+
return true;
|
|
71
|
+
return false;
|
|
72
|
+
}
|
|
49
73
|
export function hasConcreteFeatureSignal(text) {
|
|
50
74
|
return /\b(hdmi|usb|hdr|hdr10|dolby|vision|earc|arc|bluetooth|wi-?fi|ethernet|voice|remote|game|filmmaker|airplay|chromecast|resolution|4k|8k|refresh|ports?|speakers?|audio|display|screen|apps?|streaming|matter|energy monitoring|scheduling|sensor|battery|z-?wave|zigbee|thread|motion|temperature|humidity|camera|recording|lock|garage|local control|api|automation)\b/.test(text.toLowerCase());
|
|
51
75
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { readFileSync } from 'node:fs';
|
|
2
2
|
import { join } from 'node:path';
|
|
3
|
-
let version = '0.27.
|
|
3
|
+
let version = '0.27.8';
|
|
4
4
|
try {
|
|
5
5
|
const pkg = JSON.parse(readFileSync(join(import.meta.dir, '..', '..', 'package.json'), 'utf-8'));
|
|
6
6
|
version = pkg.version ?? version;
|