@truto/truto-jsonata 1.0.16 → 1.0.18
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 +16 -6
- package/dist/main.cjs.map +1 -1
- package/dist/module.js +17 -7
- package/dist/module.js.map +1 -1
- package/package.json +4 -4
package/dist/main.cjs
CHANGED
|
@@ -1401,11 +1401,16 @@ async function $caaee789061bb8bb$var$generateEmbeddingsCohere(body, api_key) {
|
|
|
1401
1401
|
texts: chunk
|
|
1402
1402
|
})
|
|
1403
1403
|
});
|
|
1404
|
-
if (!response.ok)
|
|
1404
|
+
if (!response.ok) {
|
|
1405
|
+
if (response.status === 429) throw new Error("Rate limit exceeded");
|
|
1406
|
+
if (response.status >= 500) throw new Error("Server error");
|
|
1407
|
+
throw new (0, $dxT2C$pretry.AbortError)(await response.text());
|
|
1408
|
+
}
|
|
1405
1409
|
return await response.json();
|
|
1406
1410
|
}, {
|
|
1407
|
-
retries:
|
|
1408
|
-
maxTimeout:
|
|
1411
|
+
retries: 5,
|
|
1412
|
+
maxTimeout: 5000,
|
|
1413
|
+
minTimeout: 2500
|
|
1409
1414
|
});
|
|
1410
1415
|
}, {
|
|
1411
1416
|
concurrency: 1
|
|
@@ -1421,11 +1426,16 @@ async function $caaee789061bb8bb$var$generateEmbeddingsCohere(body, api_key) {
|
|
|
1421
1426
|
},
|
|
1422
1427
|
body: JSON.stringify(body)
|
|
1423
1428
|
});
|
|
1424
|
-
if (!response.ok)
|
|
1429
|
+
if (!response.ok) {
|
|
1430
|
+
if (response.status === 429) throw new Error("Rate limit exceeded");
|
|
1431
|
+
if (response.status >= 500) throw new Error("Server error");
|
|
1432
|
+
throw new (0, $dxT2C$pretry.AbortError)(await response.text());
|
|
1433
|
+
}
|
|
1425
1434
|
return await response.json();
|
|
1426
1435
|
}, {
|
|
1427
|
-
retries:
|
|
1428
|
-
maxTimeout:
|
|
1436
|
+
retries: 5,
|
|
1437
|
+
maxTimeout: 5000,
|
|
1438
|
+
minTimeout: 2500
|
|
1429
1439
|
});
|
|
1430
1440
|
}
|
|
1431
1441
|
var $caaee789061bb8bb$export$2e2bcd8739ae039 = $caaee789061bb8bb$var$generateEmbeddingsCohere;
|