@demicodes/provider 0.4.1 → 0.4.3

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.
Files changed (2) hide show
  1. package/dist/index.mjs +3 -3
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -139,9 +139,9 @@ function httpErrorCode(status, message) {
139
139
  function normalizeErrorCode(code, message) {
140
140
  const value = `${code ?? ""} ${message}`.toLowerCase();
141
141
  if (/context|too long|max.*token/.test(value)) return "context_length_exceeded";
142
- if (/rate|quota|billing|limit/.test(value)) return "rate_limit";
143
- if (/auth|unauth|invalid.*key|expired/.test(value)) return "auth_expired";
144
- if (/overload|unavailable|timeout/.test(value)) return "overloaded";
142
+ if (/rate|quota|usage|billing|balance|limit/.test(value)) return "rate_limit";
143
+ if (/auth|invalid.*(key|token)|expired/.test(value)) return "auth_expired";
144
+ if (/overload|unavailable|timed?\s?out|fetch failed|network|socket|econn/.test(value)) return "overloaded";
145
145
  return code;
146
146
  }
147
147
  /** Builds a provider `error` event from an unknown thrown value, redacting `secret`. */
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@demicodes/provider",
3
3
  "description": "Provider contract and shared building blocks for Demi inference adapters.",
4
- "version": "0.4.1",
4
+ "version": "0.4.3",
5
5
  "private": false,
6
6
  "type": "module",
7
7
  "exports": {
@@ -20,7 +20,7 @@
20
20
  },
21
21
  "dependencies": {
22
22
  "@demicodes/core": "^0.3.2",
23
- "@demicodes/utils": "^0.3.2"
23
+ "@demicodes/utils": "^0.4.0"
24
24
  },
25
25
  "license": "Apache-2.0",
26
26
  "main": "./dist/index.mjs",