ninegrid2 6.625.0 → 6.627.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/ai/aiContainer.js +5 -1
- package/dist/bundle.cjs.js +5 -1
- package/dist/bundle.esm.js +5 -1
- package/package.json +1 -1
- package/src/ai/aiContainer.js +5 -1
package/dist/ai/aiContainer.js
CHANGED
|
@@ -117,6 +117,10 @@ class aiContainer extends HTMLElement
|
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
+
#isEmptyObject = (obj) => {
|
|
121
|
+
return Object.keys(obj).length === 0 && obj.constructor === Object;
|
|
122
|
+
}
|
|
123
|
+
|
|
120
124
|
#extractJsonSnippet = (text) => {
|
|
121
125
|
const match = text.match(/```json([\s\S]*?)```/);
|
|
122
126
|
return match ? match[1].trim() : text;
|
|
@@ -242,7 +246,7 @@ class aiContainer extends HTMLElement
|
|
|
242
246
|
const filter = await this.#generateQdrantFilter();
|
|
243
247
|
console.log(filter);
|
|
244
248
|
|
|
245
|
-
const searchResults = (filter
|
|
249
|
+
const searchResults = this.#isEmptyObject(filter) ? [] : ninegrid.filter(this.#getData(), filter);
|
|
246
250
|
|
|
247
251
|
await this.#answer(searchResults);
|
|
248
252
|
};
|
package/dist/bundle.cjs.js
CHANGED
|
@@ -54290,6 +54290,10 @@ class aiContainer extends HTMLElement
|
|
|
54290
54290
|
}
|
|
54291
54291
|
};
|
|
54292
54292
|
|
|
54293
|
+
#isEmptyObject = (obj) => {
|
|
54294
|
+
return Object.keys(obj).length === 0 && obj.constructor === Object;
|
|
54295
|
+
}
|
|
54296
|
+
|
|
54293
54297
|
#extractJsonSnippet = (text) => {
|
|
54294
54298
|
const match = text.match(/```json([\s\S]*?)```/);
|
|
54295
54299
|
return match ? match[1].trim() : text;
|
|
@@ -54409,7 +54413,7 @@ class aiContainer extends HTMLElement
|
|
|
54409
54413
|
const filter = await this.#generateQdrantFilter();
|
|
54410
54414
|
console.log(filter);
|
|
54411
54415
|
|
|
54412
|
-
const searchResults = (filter
|
|
54416
|
+
const searchResults = this.#isEmptyObject(filter) ? [] : ninegrid.filter(this.#getData(), filter);
|
|
54413
54417
|
|
|
54414
54418
|
await this.#answer(searchResults);
|
|
54415
54419
|
};
|
package/dist/bundle.esm.js
CHANGED
|
@@ -54286,6 +54286,10 @@ class aiContainer extends HTMLElement
|
|
|
54286
54286
|
}
|
|
54287
54287
|
};
|
|
54288
54288
|
|
|
54289
|
+
#isEmptyObject = (obj) => {
|
|
54290
|
+
return Object.keys(obj).length === 0 && obj.constructor === Object;
|
|
54291
|
+
}
|
|
54292
|
+
|
|
54289
54293
|
#extractJsonSnippet = (text) => {
|
|
54290
54294
|
const match = text.match(/```json([\s\S]*?)```/);
|
|
54291
54295
|
return match ? match[1].trim() : text;
|
|
@@ -54405,7 +54409,7 @@ class aiContainer extends HTMLElement
|
|
|
54405
54409
|
const filter = await this.#generateQdrantFilter();
|
|
54406
54410
|
console.log(filter);
|
|
54407
54411
|
|
|
54408
|
-
const searchResults = (filter
|
|
54412
|
+
const searchResults = this.#isEmptyObject(filter) ? [] : ninegrid.filter(this.#getData(), filter);
|
|
54409
54413
|
|
|
54410
54414
|
await this.#answer(searchResults);
|
|
54411
54415
|
};
|
package/package.json
CHANGED
package/src/ai/aiContainer.js
CHANGED
|
@@ -117,6 +117,10 @@ class aiContainer extends HTMLElement
|
|
|
117
117
|
}
|
|
118
118
|
};
|
|
119
119
|
|
|
120
|
+
#isEmptyObject = (obj) => {
|
|
121
|
+
return Object.keys(obj).length === 0 && obj.constructor === Object;
|
|
122
|
+
}
|
|
123
|
+
|
|
120
124
|
#extractJsonSnippet = (text) => {
|
|
121
125
|
const match = text.match(/```json([\s\S]*?)```/);
|
|
122
126
|
return match ? match[1].trim() : text;
|
|
@@ -242,7 +246,7 @@ class aiContainer extends HTMLElement
|
|
|
242
246
|
const filter = await this.#generateQdrantFilter();
|
|
243
247
|
console.log(filter);
|
|
244
248
|
|
|
245
|
-
const searchResults = (filter
|
|
249
|
+
const searchResults = this.#isEmptyObject(filter) ? [] : ninegrid.filter(this.#getData(), filter);
|
|
246
250
|
|
|
247
251
|
await this.#answer(searchResults);
|
|
248
252
|
};
|