@digipair/skill-vespa 0.1.12 → 0.1.14
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/index.cjs.js +21 -0
- package/index.esm.js +21 -1
- package/libs/skill-vespa/src/lib/skill-vespa.d.ts +1 -0
- package/package.json +1 -1
package/index.cjs.js
CHANGED
@@ -34723,6 +34723,25 @@ let VespaService = class VespaService {
|
|
34723
34723
|
const results = await this.prepareDocuments(documents);
|
34724
34724
|
return await this.pushDocuments(baseUrl, collection, results);
|
34725
34725
|
}
|
34726
|
+
async remove(params, _pinsSettingsList, context) {
|
34727
|
+
var _context_private;
|
34728
|
+
var _context_private_VESPA_SERVER;
|
34729
|
+
const { baseUrl = (_context_private_VESPA_SERVER = (_context_private = context.private) == null ? void 0 : _context_private.VESPA_SERVER) != null ? _context_private_VESPA_SERVER : VESPA_SERVER, collection = 'knowledge', selection } = params;
|
34730
|
+
const response = await fetch(`${baseUrl}/document/v1/Digipair_default/${collection}/docid?selection=${encodeURI(selection)}&cluster=Digipair_default`, {
|
34731
|
+
method: 'DELETE',
|
34732
|
+
headers: {
|
34733
|
+
'Content-Type': 'application/json'
|
34734
|
+
}
|
34735
|
+
});
|
34736
|
+
if (!response.ok) {
|
34737
|
+
var _error_root;
|
34738
|
+
const error = await response.json();
|
34739
|
+
var _error_root_errors;
|
34740
|
+
console.error('Error - VespaService:remove - fetching', (_error_root_errors = (_error_root = error.root) == null ? void 0 : _error_root.errors) != null ? _error_root_errors : error);
|
34741
|
+
throw new Error(`Error - VespaService:remove - fetching ${collection}`);
|
34742
|
+
}
|
34743
|
+
return await response.json();
|
34744
|
+
}
|
34726
34745
|
constructor(){
|
34727
34746
|
this.embeddingsModel = null;
|
34728
34747
|
}
|
@@ -34731,8 +34750,10 @@ const find = (params, pinsSettingsList, context)=>new VespaService().find(params
|
|
34731
34750
|
const search = (params, pinsSettingsList, context)=>new VespaService().search(params, pinsSettingsList, context);
|
34732
34751
|
const textSplitter = (params, pinsSettingsList, context)=>new VespaService().textSplitter(params, pinsSettingsList, context);
|
34733
34752
|
const push = (params, pinsSettingsList, context)=>new VespaService().push(params, pinsSettingsList, context);
|
34753
|
+
const remove = (params, pinsSettingsList, context)=>new VespaService().remove(params, pinsSettingsList, context);
|
34734
34754
|
|
34735
34755
|
exports.find = find;
|
34736
34756
|
exports.push = push;
|
34757
|
+
exports.remove = remove;
|
34737
34758
|
exports.search = search;
|
34738
34759
|
exports.textSplitter = textSplitter;
|
package/index.esm.js
CHANGED
@@ -34719,6 +34719,25 @@ let VespaService = class VespaService {
|
|
34719
34719
|
const results = await this.prepareDocuments(documents);
|
34720
34720
|
return await this.pushDocuments(baseUrl, collection, results);
|
34721
34721
|
}
|
34722
|
+
async remove(params, _pinsSettingsList, context) {
|
34723
|
+
var _context_private;
|
34724
|
+
var _context_private_VESPA_SERVER;
|
34725
|
+
const { baseUrl = (_context_private_VESPA_SERVER = (_context_private = context.private) == null ? void 0 : _context_private.VESPA_SERVER) != null ? _context_private_VESPA_SERVER : VESPA_SERVER, collection = 'knowledge', selection } = params;
|
34726
|
+
const response = await fetch(`${baseUrl}/document/v1/Digipair_default/${collection}/docid?selection=${encodeURI(selection)}&cluster=Digipair_default`, {
|
34727
|
+
method: 'DELETE',
|
34728
|
+
headers: {
|
34729
|
+
'Content-Type': 'application/json'
|
34730
|
+
}
|
34731
|
+
});
|
34732
|
+
if (!response.ok) {
|
34733
|
+
var _error_root;
|
34734
|
+
const error = await response.json();
|
34735
|
+
var _error_root_errors;
|
34736
|
+
console.error('Error - VespaService:remove - fetching', (_error_root_errors = (_error_root = error.root) == null ? void 0 : _error_root.errors) != null ? _error_root_errors : error);
|
34737
|
+
throw new Error(`Error - VespaService:remove - fetching ${collection}`);
|
34738
|
+
}
|
34739
|
+
return await response.json();
|
34740
|
+
}
|
34722
34741
|
constructor(){
|
34723
34742
|
this.embeddingsModel = null;
|
34724
34743
|
}
|
@@ -34727,5 +34746,6 @@ const find = (params, pinsSettingsList, context)=>new VespaService().find(params
|
|
34727
34746
|
const search = (params, pinsSettingsList, context)=>new VespaService().search(params, pinsSettingsList, context);
|
34728
34747
|
const textSplitter = (params, pinsSettingsList, context)=>new VespaService().textSplitter(params, pinsSettingsList, context);
|
34729
34748
|
const push = (params, pinsSettingsList, context)=>new VespaService().push(params, pinsSettingsList, context);
|
34749
|
+
const remove = (params, pinsSettingsList, context)=>new VespaService().remove(params, pinsSettingsList, context);
|
34730
34750
|
|
34731
|
-
export { find, push, search, textSplitter };
|
34751
|
+
export { find, push, remove, search, textSplitter };
|
@@ -3,4 +3,5 @@ export declare const find: (params: any, pinsSettingsList: PinsSettings[], conte
|
|
3
3
|
export declare const search: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
4
4
|
export declare const textSplitter: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
5
5
|
export declare const push: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
6
|
+
export declare const remove: (params: any, pinsSettingsList: PinsSettings[], context: any) => Promise<any>;
|
6
7
|
export {};
|