@digipair/skill-vespa 0.84.2 → 0.84.5
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
CHANGED
@@ -48902,12 +48902,15 @@ let VespaService = class VespaService {
|
|
48902
48902
|
async pushDocuments(modelEmbeddings, baseUrl, namespace, collection, documents, signal) {
|
48903
48903
|
const results = [];
|
48904
48904
|
for (const document of documents){
|
48905
|
-
|
48905
|
+
// eslint-disable-next-line no-control-regex
|
48906
|
+
const content = document.content.replace(/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F]/g, '');
|
48907
|
+
const content_embedding = await modelEmbeddings.embedQuery(content);
|
48906
48908
|
const response = await fetch(`${baseUrl}/document/v1/${namespace}/${collection}/docid/${document.uuid}`, {
|
48907
48909
|
signal,
|
48908
48910
|
method: 'POST',
|
48909
48911
|
body: JSON.stringify({
|
48910
48912
|
fields: _extends({}, document, {
|
48913
|
+
content,
|
48911
48914
|
content_embedding
|
48912
48915
|
})
|
48913
48916
|
}),
|
@@ -48915,7 +48918,11 @@ let VespaService = class VespaService {
|
|
48915
48918
|
'Content-Type': 'application/json'
|
48916
48919
|
}
|
48917
48920
|
});
|
48918
|
-
|
48921
|
+
const json = await response.json();
|
48922
|
+
if (!json.id) {
|
48923
|
+
throw new Error(`Error - VespaService:pushDocuments - pushing ${collection} - ${json.message}`);
|
48924
|
+
}
|
48925
|
+
results.push(json);
|
48919
48926
|
}
|
48920
48927
|
return results;
|
48921
48928
|
}
|
package/index.esm.js
CHANGED
@@ -76867,12 +76867,15 @@ let VespaService = class VespaService {
|
|
76867
76867
|
async pushDocuments(modelEmbeddings, baseUrl, namespace, collection, documents, signal) {
|
76868
76868
|
const results = [];
|
76869
76869
|
for (const document of documents){
|
76870
|
-
|
76870
|
+
// eslint-disable-next-line no-control-regex
|
76871
|
+
const content = document.content.replace(/[\x00-\x09\x0B\x0C\x0E-\x1F\x7F]/g, '');
|
76872
|
+
const content_embedding = await modelEmbeddings.embedQuery(content);
|
76871
76873
|
const response = await fetch(`${baseUrl}/document/v1/${namespace}/${collection}/docid/${document.uuid}`, {
|
76872
76874
|
signal,
|
76873
76875
|
method: 'POST',
|
76874
76876
|
body: JSON.stringify({
|
76875
76877
|
fields: _extends({}, document, {
|
76878
|
+
content,
|
76876
76879
|
content_embedding
|
76877
76880
|
})
|
76878
76881
|
}),
|
@@ -76880,7 +76883,11 @@ let VespaService = class VespaService {
|
|
76880
76883
|
'Content-Type': 'application/json'
|
76881
76884
|
}
|
76882
76885
|
});
|
76883
|
-
|
76886
|
+
const json = await response.json();
|
76887
|
+
if (!json.id) {
|
76888
|
+
throw new Error(`Error - VespaService:pushDocuments - pushing ${collection} - ${json.message}`);
|
76889
|
+
}
|
76890
|
+
results.push(json);
|
76884
76891
|
}
|
76885
76892
|
return results;
|
76886
76893
|
}
|
package/package.json
CHANGED
File without changes
|
File without changes
|