@ai-sdk/gateway 3.0.144 → 3.0.145
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.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +39 -12
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +39 -12
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
- package/src/gateway-image-model.ts +7 -1
- package/src/gateway-speech-model.ts +8 -6
- package/src/gateway-transcription-model.ts +7 -2
- package/src/gateway-video-model-settings.ts +2 -0
- package/src/gateway-video-model.ts +7 -1
- package/src/map-gateway-warnings.ts +21 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @ai-sdk/gateway
|
|
2
2
|
|
|
3
|
+
## 3.0.145
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 9c54a9f: fix(gateway): accept deprecated warnings in image, speech, transcription, and video responses
|
|
8
|
+
- bbc4bd5: Backport: chore(provider/gateway): update gateway model settings files
|
|
9
|
+
- Updated dependencies [d559de9]
|
|
10
|
+
- @ai-sdk/provider-utils@4.0.37
|
|
11
|
+
|
|
3
12
|
## 3.0.144
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -10,7 +10,7 @@ type GatewaySpeechModelId = 'openai/tts-1' | 'openai/tts-1-hd' | 'xai/grok-tts'
|
|
|
10
10
|
|
|
11
11
|
type GatewayTranscriptionModelId = 'openai/gpt-4o-mini-transcribe' | 'openai/gpt-4o-transcribe' | 'openai/whisper-1' | 'xai/grok-stt' | (string & {});
|
|
12
12
|
|
|
13
|
-
type GatewayVideoModelId = 'alibaba/wan-v2.5-t2v-preview' | 'alibaba/wan-v2.6-i2v' | 'alibaba/wan-v2.6-i2v-flash' | 'alibaba/wan-v2.6-r2v' | 'alibaba/wan-v2.6-r2v-flash' | 'alibaba/wan-v2.6-t2v' | 'bytedance/seedance-2.0' | 'bytedance/seedance-2.0-fast' | 'bytedance/seedance-v1.0-pro' | 'bytedance/seedance-v1.0-pro-fast' | 'bytedance/seedance-v1.5-pro' | 'google/veo-3.0-fast-generate-001' | 'google/veo-3.0-generate-001' | 'google/veo-3.1-fast-generate-001' | 'google/veo-3.1-generate-001' | 'klingai/kling-v2.5-turbo-i2v' | 'klingai/kling-v2.5-turbo-t2v' | 'klingai/kling-v2.6-i2v' | 'klingai/kling-v2.6-motion-control' | 'klingai/kling-v2.6-t2v' | 'klingai/kling-v3.0-i2v' | 'klingai/kling-v3.0-motion-control' | 'klingai/kling-v3.0-t2v' | 'xai/grok-imagine-video' | 'xai/grok-imagine-video-1.5' | 'xai/grok-imagine-video-1.5-preview' | (string & {});
|
|
13
|
+
type GatewayVideoModelId = 'alibaba/wan-v2.5-t2v-preview' | 'alibaba/wan-v2.6-i2v' | 'alibaba/wan-v2.6-i2v-flash' | 'alibaba/wan-v2.6-r2v' | 'alibaba/wan-v2.6-r2v-flash' | 'alibaba/wan-v2.6-t2v' | 'alibaba/wan-v2.7-r2v' | 'alibaba/wan-v2.7-t2v' | 'bytedance/seedance-2.0' | 'bytedance/seedance-2.0-fast' | 'bytedance/seedance-v1.0-pro' | 'bytedance/seedance-v1.0-pro-fast' | 'bytedance/seedance-v1.5-pro' | 'google/veo-3.0-fast-generate-001' | 'google/veo-3.0-generate-001' | 'google/veo-3.1-fast-generate-001' | 'google/veo-3.1-generate-001' | 'klingai/kling-v2.5-turbo-i2v' | 'klingai/kling-v2.5-turbo-t2v' | 'klingai/kling-v2.6-i2v' | 'klingai/kling-v2.6-motion-control' | 'klingai/kling-v2.6-t2v' | 'klingai/kling-v3.0-i2v' | 'klingai/kling-v3.0-motion-control' | 'klingai/kling-v3.0-t2v' | 'xai/grok-imagine-video' | 'xai/grok-imagine-video-1.5' | 'xai/grok-imagine-video-1.5-preview' | (string & {});
|
|
14
14
|
|
|
15
15
|
declare const KNOWN_MODEL_TYPES: readonly ["embedding", "image", "language", "reranking", "speech", "transcription", "video"];
|
|
16
16
|
type KnownModelType = (typeof KNOWN_MODEL_TYPES)[number];
|
package/dist/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ type GatewaySpeechModelId = 'openai/tts-1' | 'openai/tts-1-hd' | 'xai/grok-tts'
|
|
|
10
10
|
|
|
11
11
|
type GatewayTranscriptionModelId = 'openai/gpt-4o-mini-transcribe' | 'openai/gpt-4o-transcribe' | 'openai/whisper-1' | 'xai/grok-stt' | (string & {});
|
|
12
12
|
|
|
13
|
-
type GatewayVideoModelId = 'alibaba/wan-v2.5-t2v-preview' | 'alibaba/wan-v2.6-i2v' | 'alibaba/wan-v2.6-i2v-flash' | 'alibaba/wan-v2.6-r2v' | 'alibaba/wan-v2.6-r2v-flash' | 'alibaba/wan-v2.6-t2v' | 'bytedance/seedance-2.0' | 'bytedance/seedance-2.0-fast' | 'bytedance/seedance-v1.0-pro' | 'bytedance/seedance-v1.0-pro-fast' | 'bytedance/seedance-v1.5-pro' | 'google/veo-3.0-fast-generate-001' | 'google/veo-3.0-generate-001' | 'google/veo-3.1-fast-generate-001' | 'google/veo-3.1-generate-001' | 'klingai/kling-v2.5-turbo-i2v' | 'klingai/kling-v2.5-turbo-t2v' | 'klingai/kling-v2.6-i2v' | 'klingai/kling-v2.6-motion-control' | 'klingai/kling-v2.6-t2v' | 'klingai/kling-v3.0-i2v' | 'klingai/kling-v3.0-motion-control' | 'klingai/kling-v3.0-t2v' | 'xai/grok-imagine-video' | 'xai/grok-imagine-video-1.5' | 'xai/grok-imagine-video-1.5-preview' | (string & {});
|
|
13
|
+
type GatewayVideoModelId = 'alibaba/wan-v2.5-t2v-preview' | 'alibaba/wan-v2.6-i2v' | 'alibaba/wan-v2.6-i2v-flash' | 'alibaba/wan-v2.6-r2v' | 'alibaba/wan-v2.6-r2v-flash' | 'alibaba/wan-v2.6-t2v' | 'alibaba/wan-v2.7-r2v' | 'alibaba/wan-v2.7-t2v' | 'bytedance/seedance-2.0' | 'bytedance/seedance-2.0-fast' | 'bytedance/seedance-v1.0-pro' | 'bytedance/seedance-v1.0-pro-fast' | 'bytedance/seedance-v1.5-pro' | 'google/veo-3.0-fast-generate-001' | 'google/veo-3.0-generate-001' | 'google/veo-3.1-fast-generate-001' | 'google/veo-3.1-generate-001' | 'klingai/kling-v2.5-turbo-i2v' | 'klingai/kling-v2.5-turbo-t2v' | 'klingai/kling-v2.6-i2v' | 'klingai/kling-v2.6-motion-control' | 'klingai/kling-v2.6-t2v' | 'klingai/kling-v3.0-i2v' | 'klingai/kling-v3.0-motion-control' | 'klingai/kling-v3.0-t2v' | 'xai/grok-imagine-video' | 'xai/grok-imagine-video-1.5' | 'xai/grok-imagine-video-1.5-preview' | (string & {});
|
|
14
14
|
|
|
15
15
|
declare const KNOWN_MODEL_TYPES: readonly ["embedding", "image", "language", "reranking", "speech", "transcription", "video"];
|
|
16
16
|
type KnownModelType = (typeof KNOWN_MODEL_TYPES)[number];
|
package/dist/index.js
CHANGED
|
@@ -1099,6 +1099,15 @@ var gatewayEmbeddingResponseSchema = (0, import_provider_utils9.lazySchema)(
|
|
|
1099
1099
|
// src/gateway-image-model.ts
|
|
1100
1100
|
var import_provider_utils10 = require("@ai-sdk/provider-utils");
|
|
1101
1101
|
var import_v49 = require("zod/v4");
|
|
1102
|
+
|
|
1103
|
+
// src/map-gateway-warnings.ts
|
|
1104
|
+
function mapGatewayWarnings(warnings) {
|
|
1105
|
+
return (warnings != null ? warnings : []).map(
|
|
1106
|
+
(warning) => warning.type === "deprecated" ? { type: "other", message: warning.message } : warning
|
|
1107
|
+
);
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1110
|
+
// src/gateway-image-model.ts
|
|
1102
1111
|
var GatewayImageModel = class {
|
|
1103
1112
|
constructor(modelId, config) {
|
|
1104
1113
|
this.modelId = modelId;
|
|
@@ -1122,7 +1131,7 @@ var GatewayImageModel = class {
|
|
|
1122
1131
|
headers,
|
|
1123
1132
|
abortSignal
|
|
1124
1133
|
}) {
|
|
1125
|
-
var _a11, _b11, _c
|
|
1134
|
+
var _a11, _b11, _c;
|
|
1126
1135
|
const resolvedHeaders = await (0, import_provider_utils10.resolve)(this.config.headers());
|
|
1127
1136
|
try {
|
|
1128
1137
|
const {
|
|
@@ -1162,7 +1171,7 @@ var GatewayImageModel = class {
|
|
|
1162
1171
|
return {
|
|
1163
1172
|
images: responseBody.images,
|
|
1164
1173
|
// Always base64 strings from server
|
|
1165
|
-
warnings: (
|
|
1174
|
+
warnings: mapGatewayWarnings(responseBody.warnings),
|
|
1166
1175
|
providerMetadata: responseBody.providerMetadata,
|
|
1167
1176
|
response: {
|
|
1168
1177
|
timestamp: /* @__PURE__ */ new Date(),
|
|
@@ -1171,9 +1180,9 @@ var GatewayImageModel = class {
|
|
|
1171
1180
|
},
|
|
1172
1181
|
...responseBody.usage != null && {
|
|
1173
1182
|
usage: {
|
|
1174
|
-
inputTokens: (
|
|
1175
|
-
outputTokens: (
|
|
1176
|
-
totalTokens: (
|
|
1183
|
+
inputTokens: (_a11 = responseBody.usage.inputTokens) != null ? _a11 : void 0,
|
|
1184
|
+
outputTokens: (_b11 = responseBody.usage.outputTokens) != null ? _b11 : void 0,
|
|
1185
|
+
totalTokens: (_c = responseBody.usage.totalTokens) != null ? _c : void 0
|
|
1177
1186
|
}
|
|
1178
1187
|
}
|
|
1179
1188
|
};
|
|
@@ -1214,6 +1223,11 @@ var gatewayImageWarningSchema = import_v49.z.discriminatedUnion("type", [
|
|
|
1214
1223
|
feature: import_v49.z.string(),
|
|
1215
1224
|
details: import_v49.z.string().optional()
|
|
1216
1225
|
}),
|
|
1226
|
+
import_v49.z.object({
|
|
1227
|
+
type: import_v49.z.literal("deprecated"),
|
|
1228
|
+
setting: import_v49.z.string(),
|
|
1229
|
+
message: import_v49.z.string()
|
|
1230
|
+
}),
|
|
1217
1231
|
import_v49.z.object({
|
|
1218
1232
|
type: import_v49.z.literal("other"),
|
|
1219
1233
|
message: import_v49.z.string()
|
|
@@ -1263,7 +1277,6 @@ var GatewayVideoModel = class {
|
|
|
1263
1277
|
headers,
|
|
1264
1278
|
abortSignal
|
|
1265
1279
|
}) {
|
|
1266
|
-
var _a11;
|
|
1267
1280
|
const resolvedHeaders = await (0, import_provider_utils11.resolve)(this.config.headers());
|
|
1268
1281
|
try {
|
|
1269
1282
|
const { responseHeaders, value: responseBody } = await (0, import_provider_utils11.postJsonToApi)({
|
|
@@ -1371,7 +1384,7 @@ var GatewayVideoModel = class {
|
|
|
1371
1384
|
});
|
|
1372
1385
|
return {
|
|
1373
1386
|
videos: responseBody.videos,
|
|
1374
|
-
warnings: (
|
|
1387
|
+
warnings: mapGatewayWarnings(responseBody.warnings),
|
|
1375
1388
|
providerMetadata: responseBody.providerMetadata,
|
|
1376
1389
|
response: {
|
|
1377
1390
|
timestamp: /* @__PURE__ */ new Date(),
|
|
@@ -1428,6 +1441,11 @@ var gatewayVideoWarningSchema = import_v410.z.discriminatedUnion("type", [
|
|
|
1428
1441
|
feature: import_v410.z.string(),
|
|
1429
1442
|
details: import_v410.z.string().optional()
|
|
1430
1443
|
}),
|
|
1444
|
+
import_v410.z.object({
|
|
1445
|
+
type: import_v410.z.literal("deprecated"),
|
|
1446
|
+
setting: import_v410.z.string(),
|
|
1447
|
+
message: import_v410.z.string()
|
|
1448
|
+
}),
|
|
1431
1449
|
import_v410.z.object({
|
|
1432
1450
|
type: import_v410.z.literal("other"),
|
|
1433
1451
|
message: import_v410.z.string()
|
|
@@ -1574,7 +1592,6 @@ var GatewaySpeechModel = class {
|
|
|
1574
1592
|
headers,
|
|
1575
1593
|
abortSignal
|
|
1576
1594
|
}) {
|
|
1577
|
-
var _a11;
|
|
1578
1595
|
const resolvedHeaders = await (0, import_provider_utils13.resolve)(this.config.headers());
|
|
1579
1596
|
try {
|
|
1580
1597
|
const {
|
|
@@ -1610,7 +1627,7 @@ var GatewaySpeechModel = class {
|
|
|
1610
1627
|
});
|
|
1611
1628
|
return {
|
|
1612
1629
|
audio: responseBody.audio,
|
|
1613
|
-
warnings: (
|
|
1630
|
+
warnings: mapGatewayWarnings(responseBody.warnings),
|
|
1614
1631
|
providerMetadata: responseBody.providerMetadata,
|
|
1615
1632
|
response: {
|
|
1616
1633
|
timestamp: /* @__PURE__ */ new Date(),
|
|
@@ -1648,6 +1665,11 @@ var gatewaySpeechWarningSchema = import_v412.z.discriminatedUnion("type", [
|
|
|
1648
1665
|
feature: import_v412.z.string(),
|
|
1649
1666
|
details: import_v412.z.string().optional()
|
|
1650
1667
|
}),
|
|
1668
|
+
import_v412.z.object({
|
|
1669
|
+
type: import_v412.z.literal("deprecated"),
|
|
1670
|
+
setting: import_v412.z.string(),
|
|
1671
|
+
message: import_v412.z.string()
|
|
1672
|
+
}),
|
|
1651
1673
|
import_v412.z.object({
|
|
1652
1674
|
type: import_v412.z.literal("other"),
|
|
1653
1675
|
message: import_v412.z.string()
|
|
@@ -1678,7 +1700,7 @@ var GatewayTranscriptionModel = class {
|
|
|
1678
1700
|
headers,
|
|
1679
1701
|
abortSignal
|
|
1680
1702
|
}) {
|
|
1681
|
-
var _a11, _b11, _c
|
|
1703
|
+
var _a11, _b11, _c;
|
|
1682
1704
|
const resolvedHeaders = await (0, import_provider_utils14.resolve)(this.config.headers());
|
|
1683
1705
|
try {
|
|
1684
1706
|
const {
|
|
@@ -1713,7 +1735,7 @@ var GatewayTranscriptionModel = class {
|
|
|
1713
1735
|
segments: (_a11 = responseBody.segments) != null ? _a11 : [],
|
|
1714
1736
|
language: (_b11 = responseBody.language) != null ? _b11 : void 0,
|
|
1715
1737
|
durationInSeconds: (_c = responseBody.durationInSeconds) != null ? _c : void 0,
|
|
1716
|
-
warnings: (
|
|
1738
|
+
warnings: mapGatewayWarnings(responseBody.warnings),
|
|
1717
1739
|
providerMetadata: responseBody.providerMetadata,
|
|
1718
1740
|
response: {
|
|
1719
1741
|
timestamp: /* @__PURE__ */ new Date(),
|
|
@@ -1751,6 +1773,11 @@ var gatewayTranscriptionWarningSchema = import_v413.z.discriminatedUnion("type",
|
|
|
1751
1773
|
feature: import_v413.z.string(),
|
|
1752
1774
|
details: import_v413.z.string().optional()
|
|
1753
1775
|
}),
|
|
1776
|
+
import_v413.z.object({
|
|
1777
|
+
type: import_v413.z.literal("deprecated"),
|
|
1778
|
+
setting: import_v413.z.string(),
|
|
1779
|
+
message: import_v413.z.string()
|
|
1780
|
+
}),
|
|
1754
1781
|
import_v413.z.object({
|
|
1755
1782
|
type: import_v413.z.literal("other"),
|
|
1756
1783
|
message: import_v413.z.string()
|
|
@@ -2103,7 +2130,7 @@ async function getVercelRequestId() {
|
|
|
2103
2130
|
}
|
|
2104
2131
|
|
|
2105
2132
|
// src/version.ts
|
|
2106
|
-
var VERSION = true ? "3.0.
|
|
2133
|
+
var VERSION = true ? "3.0.145" : "0.0.0-test";
|
|
2107
2134
|
|
|
2108
2135
|
// src/gateway-provider.ts
|
|
2109
2136
|
var AI_GATEWAY_PROTOCOL_VERSION = "0.0.1";
|