@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/dist/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// src/gateway-provider.ts
|
|
2
2
|
import {
|
|
3
3
|
loadOptionalSetting,
|
|
4
|
-
withoutTrailingSlash
|
|
4
|
+
withoutTrailingSlash,
|
|
5
|
+
withUserAgentSuffix
|
|
5
6
|
} from "@ai-sdk/provider-utils";
|
|
6
7
|
|
|
7
8
|
// src/errors/as-gateway-error.ts
|
|
@@ -333,6 +334,21 @@ var gatewayErrorResponseSchema = lazySchema2(
|
|
|
333
334
|
)
|
|
334
335
|
);
|
|
335
336
|
|
|
337
|
+
// src/errors/extract-api-call-response.ts
|
|
338
|
+
function extractApiCallResponse(error) {
|
|
339
|
+
if (error.data !== void 0) {
|
|
340
|
+
return error.data;
|
|
341
|
+
}
|
|
342
|
+
if (error.responseBody != null) {
|
|
343
|
+
try {
|
|
344
|
+
return JSON.parse(error.responseBody);
|
|
345
|
+
} catch (e) {
|
|
346
|
+
return error.responseBody;
|
|
347
|
+
}
|
|
348
|
+
}
|
|
349
|
+
return {};
|
|
350
|
+
}
|
|
351
|
+
|
|
336
352
|
// src/errors/gateway-timeout-error.ts
|
|
337
353
|
var name7 = "GatewayTimeoutError";
|
|
338
354
|
var marker8 = `vercel.ai.gateway.error.${name7}`;
|
|
@@ -426,21 +442,6 @@ async function asGatewayError(error, authMethod) {
|
|
|
426
442
|
});
|
|
427
443
|
}
|
|
428
444
|
|
|
429
|
-
// src/errors/extract-api-call-response.ts
|
|
430
|
-
function extractApiCallResponse(error) {
|
|
431
|
-
if (error.data !== void 0) {
|
|
432
|
-
return error.data;
|
|
433
|
-
}
|
|
434
|
-
if (error.responseBody != null) {
|
|
435
|
-
try {
|
|
436
|
-
return JSON.parse(error.responseBody);
|
|
437
|
-
} catch (e) {
|
|
438
|
-
return error.responseBody;
|
|
439
|
-
}
|
|
440
|
-
}
|
|
441
|
-
return {};
|
|
442
|
-
}
|
|
443
|
-
|
|
444
445
|
// src/errors/parse-auth-method.ts
|
|
445
446
|
import { z as z3 } from "zod/v4";
|
|
446
447
|
import {
|
|
@@ -1164,7 +1165,9 @@ var gatewayImageResponseSchema = z9.object({
|
|
|
1164
1165
|
});
|
|
1165
1166
|
|
|
1166
1167
|
// src/gateway-video-model.ts
|
|
1167
|
-
import {
|
|
1168
|
+
import {
|
|
1169
|
+
APICallError as APICallError2
|
|
1170
|
+
} from "@ai-sdk/provider";
|
|
1168
1171
|
import {
|
|
1169
1172
|
combineHeaders as combineHeaders4,
|
|
1170
1173
|
convertUint8ArrayToBase64 as convertUint8ArrayToBase642,
|
|
@@ -1662,11 +1665,8 @@ async function getVercelRequestId() {
|
|
|
1662
1665
|
return (_a9 = getContext().headers) == null ? void 0 : _a9["x-vercel-id"];
|
|
1663
1666
|
}
|
|
1664
1667
|
|
|
1665
|
-
// src/gateway-provider.ts
|
|
1666
|
-
import { withUserAgentSuffix } from "@ai-sdk/provider-utils";
|
|
1667
|
-
|
|
1668
1668
|
// src/version.ts
|
|
1669
|
-
var VERSION = true ? "3.0.
|
|
1669
|
+
var VERSION = true ? "3.0.106" : "0.0.0-test";
|
|
1670
1670
|
|
|
1671
1671
|
// src/gateway-provider.ts
|
|
1672
1672
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|