@ai-sdk/gateway 3.0.105 → 3.0.106
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/CHANGELOG.md +9 -0
- package/dist/index.js +17 -20
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +21 -21
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/errors/as-gateway-error.ts +2 -1
- package/src/errors/create-gateway-error.ts +1 -1
- package/src/errors/gateway-response-error.ts +1 -1
- package/src/gateway-provider-options.ts +5 -1
- package/src/gateway-provider.ts +1 -1
- package/src/gateway-video-model.ts +8 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @ai-sdk/gateway
|
|
2
2
|
|
|
3
|
+
## 3.0.106
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a727da4: chore: ensure consistent import handling and avoid import duplicates or cycles
|
|
8
|
+
- Updated dependencies [a727da4]
|
|
9
|
+
- @ai-sdk/provider-utils@4.0.25
|
|
10
|
+
- @ai-sdk/provider@3.0.10
|
|
11
|
+
|
|
3
12
|
## 3.0.105
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.js
CHANGED
|
@@ -361,6 +361,21 @@ var gatewayErrorResponseSchema = (0, import_provider_utils2.lazySchema)(
|
|
|
361
361
|
)
|
|
362
362
|
);
|
|
363
363
|
|
|
364
|
+
// src/errors/extract-api-call-response.ts
|
|
365
|
+
function extractApiCallResponse(error) {
|
|
366
|
+
if (error.data !== void 0) {
|
|
367
|
+
return error.data;
|
|
368
|
+
}
|
|
369
|
+
if (error.responseBody != null) {
|
|
370
|
+
try {
|
|
371
|
+
return JSON.parse(error.responseBody);
|
|
372
|
+
} catch (e) {
|
|
373
|
+
return error.responseBody;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
return {};
|
|
377
|
+
}
|
|
378
|
+
|
|
364
379
|
// src/errors/gateway-timeout-error.ts
|
|
365
380
|
var name7 = "GatewayTimeoutError";
|
|
366
381
|
var marker8 = `vercel.ai.gateway.error.${name7}`;
|
|
@@ -454,21 +469,6 @@ async function asGatewayError(error, authMethod) {
|
|
|
454
469
|
});
|
|
455
470
|
}
|
|
456
471
|
|
|
457
|
-
// src/errors/extract-api-call-response.ts
|
|
458
|
-
function extractApiCallResponse(error) {
|
|
459
|
-
if (error.data !== void 0) {
|
|
460
|
-
return error.data;
|
|
461
|
-
}
|
|
462
|
-
if (error.responseBody != null) {
|
|
463
|
-
try {
|
|
464
|
-
return JSON.parse(error.responseBody);
|
|
465
|
-
} catch (e) {
|
|
466
|
-
return error.responseBody;
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
return {};
|
|
470
|
-
}
|
|
471
|
-
|
|
472
472
|
// src/errors/parse-auth-method.ts
|
|
473
473
|
var import_v43 = require("zod/v4");
|
|
474
474
|
var import_provider_utils3 = require("@ai-sdk/provider-utils");
|
|
@@ -1620,11 +1620,8 @@ async function getVercelRequestId() {
|
|
|
1620
1620
|
return (_a9 = (0, import_oidc.getContext)().headers) == null ? void 0 : _a9["x-vercel-id"];
|
|
1621
1621
|
}
|
|
1622
1622
|
|
|
1623
|
-
// src/gateway-provider.ts
|
|
1624
|
-
var import_provider_utils15 = require("@ai-sdk/provider-utils");
|
|
1625
|
-
|
|
1626
1623
|
// src/version.ts
|
|
1627
|
-
var VERSION = true ? "3.0.
|
|
1624
|
+
var VERSION = true ? "3.0.106" : "0.0.0-test";
|
|
1628
1625
|
|
|
1629
1626
|
// src/gateway-provider.ts
|
|
1630
1627
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|
|
@@ -1638,7 +1635,7 @@ function createGatewayProvider(options = {}) {
|
|
|
1638
1635
|
const getHeaders = async () => {
|
|
1639
1636
|
try {
|
|
1640
1637
|
const auth = await getGatewayAuthToken(options);
|
|
1641
|
-
return (0,
|
|
1638
|
+
return (0, import_provider_utils14.withUserAgentSuffix)(
|
|
1642
1639
|
{
|
|
1643
1640
|
Authorization: `Bearer ${auth.token}`,
|
|
1644
1641
|
"ai-gateway-protocol-version": AI_GATEWAY_PROTOCOL_VERSION,
|