@truto/truto-jsonata 1.0.8 → 1.0.9
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/main.cjs +18 -0
- package/dist/main.cjs.map +1 -1
- package/dist/module.js +18 -0
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/module.js
CHANGED
|
@@ -1332,6 +1332,23 @@ async function $22f22d9ed76050e5$var$convertMarkdownToHtml(markdown, options) {
|
|
|
1332
1332
|
var $22f22d9ed76050e5$export$2e2bcd8739ae039 = $22f22d9ed76050e5$var$convertMarkdownToHtml;
|
|
1333
1333
|
|
|
1334
1334
|
|
|
1335
|
+
async function $bf2fdaa075f6a5e5$var$generateEmbeddingsCohere(body, api_key) {
|
|
1336
|
+
const response = await fetch("https://api.cohere.com/v2/embed", {
|
|
1337
|
+
method: "POST",
|
|
1338
|
+
headers: {
|
|
1339
|
+
accept: "application/json",
|
|
1340
|
+
"content-type": "application/json",
|
|
1341
|
+
"user-agent": "truto",
|
|
1342
|
+
Authorization: `Bearer ${api_key}`
|
|
1343
|
+
},
|
|
1344
|
+
body: JSON.stringify(body)
|
|
1345
|
+
});
|
|
1346
|
+
if (!response.ok) throw new Error(await response.text());
|
|
1347
|
+
return await response.json();
|
|
1348
|
+
}
|
|
1349
|
+
var $bf2fdaa075f6a5e5$export$2e2bcd8739ae039 = $bf2fdaa075f6a5e5$var$generateEmbeddingsCohere;
|
|
1350
|
+
|
|
1351
|
+
|
|
1335
1352
|
function $3e1c03caddb74419$export$2e2bcd8739ae039(expression) {
|
|
1336
1353
|
expression.registerFunction("dtFromIso", (0, $9e00534fc92334a4$export$2e2bcd8739ae039));
|
|
1337
1354
|
expression.registerFunction("base64decode", (0, $52da679a67e0b066$export$2e2bcd8739ae039));
|
|
@@ -1367,6 +1384,7 @@ function $3e1c03caddb74419$export$2e2bcd8739ae039(expression) {
|
|
|
1367
1384
|
expression.registerFunction("sign", (0, $9e0fe82470a4aa3f$export$2e2bcd8739ae039));
|
|
1368
1385
|
expression.registerFunction("xmlToJs", (0, $482257986df2ffd5$export$2e2bcd8739ae039));
|
|
1369
1386
|
expression.registerFunction("jsToXml", (0, $9e1852c032fb5537$export$2e2bcd8739ae039));
|
|
1387
|
+
expression.registerFunction("generateEmbeddingsCohere", (0, $bf2fdaa075f6a5e5$export$2e2bcd8739ae039));
|
|
1370
1388
|
expression.registerFunction("groupBy", function(array, key) {
|
|
1371
1389
|
return (0, $hgUW1$groupBy)((0, $hgUW1$castArray)(array), key);
|
|
1372
1390
|
});
|