@ai-sdk/gateway 4.0.0-beta.2 → 4.0.0-beta.21
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 +130 -4
- package/dist/index.d.mts +15 -15
- package/dist/index.d.ts +15 -15
- package/dist/index.js +14 -14
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +11 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -6
- package/src/gateway-embedding-model.ts +8 -8
- package/src/gateway-fetch-metadata.ts +1 -1
- package/src/gateway-image-model-settings.ts +6 -0
- package/src/gateway-image-model.ts +10 -10
- package/src/gateway-language-model-settings.ts +14 -10
- package/src/gateway-language-model.ts +19 -19
- package/src/gateway-model-entry.ts +2 -2
- package/src/gateway-provider.ts +17 -17
- package/src/gateway-video-model.ts +15 -15
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
export type GatewayImageModelId =
|
|
2
|
+
| 'bfl/flux-2-flex'
|
|
3
|
+
| 'bfl/flux-2-klein-4b'
|
|
4
|
+
| 'bfl/flux-2-klein-9b'
|
|
5
|
+
| 'bfl/flux-2-max'
|
|
6
|
+
| 'bfl/flux-2-pro'
|
|
2
7
|
| 'bfl/flux-kontext-max'
|
|
3
8
|
| 'bfl/flux-kontext-pro'
|
|
4
9
|
| 'bfl/flux-pro-1.0-fill'
|
|
@@ -10,6 +15,7 @@ export type GatewayImageModelId =
|
|
|
10
15
|
| 'openai/gpt-image-1'
|
|
11
16
|
| 'openai/gpt-image-1-mini'
|
|
12
17
|
| 'openai/gpt-image-1.5'
|
|
18
|
+
| 'prodia/flux-fast-schnell'
|
|
13
19
|
| 'recraft/recraft-v2'
|
|
14
20
|
| 'recraft/recraft-v3'
|
|
15
21
|
| 'recraft/recraft-v4'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
2
|
+
ImageModelV4,
|
|
3
|
+
ImageModelV4File,
|
|
4
|
+
ImageModelV4ProviderMetadata,
|
|
5
5
|
} from '@ai-sdk/provider';
|
|
6
6
|
import {
|
|
7
7
|
combineHeaders,
|
|
@@ -17,8 +17,8 @@ import type { GatewayConfig } from './gateway-config';
|
|
|
17
17
|
import { asGatewayError } from './errors';
|
|
18
18
|
import { parseAuthMethod } from './errors/parse-auth-method';
|
|
19
19
|
|
|
20
|
-
export class GatewayImageModel implements
|
|
21
|
-
readonly specificationVersion = '
|
|
20
|
+
export class GatewayImageModel implements ImageModelV4 {
|
|
21
|
+
readonly specificationVersion = 'v4' as const;
|
|
22
22
|
// Set a very large number to prevent client-side splitting of requests
|
|
23
23
|
readonly maxImagesPerCall = Number.MAX_SAFE_INTEGER;
|
|
24
24
|
|
|
@@ -45,8 +45,8 @@ export class GatewayImageModel implements ImageModelV3 {
|
|
|
45
45
|
providerOptions,
|
|
46
46
|
headers,
|
|
47
47
|
abortSignal,
|
|
48
|
-
}: Parameters<
|
|
49
|
-
Awaited<ReturnType<
|
|
48
|
+
}: Parameters<ImageModelV4['doGenerate']>[0]): Promise<
|
|
49
|
+
Awaited<ReturnType<ImageModelV4['doGenerate']>>
|
|
50
50
|
> {
|
|
51
51
|
const resolvedHeaders = await resolve(this.config.headers());
|
|
52
52
|
try {
|
|
@@ -89,7 +89,7 @@ export class GatewayImageModel implements ImageModelV3 {
|
|
|
89
89
|
images: responseBody.images, // Always base64 strings from server
|
|
90
90
|
warnings: responseBody.warnings ?? [],
|
|
91
91
|
providerMetadata:
|
|
92
|
-
responseBody.providerMetadata as
|
|
92
|
+
responseBody.providerMetadata as ImageModelV4ProviderMetadata,
|
|
93
93
|
response: {
|
|
94
94
|
timestamp: new Date(),
|
|
95
95
|
modelId: this.modelId,
|
|
@@ -114,13 +114,13 @@ export class GatewayImageModel implements ImageModelV3 {
|
|
|
114
114
|
|
|
115
115
|
private getModelConfigHeaders() {
|
|
116
116
|
return {
|
|
117
|
-
'ai-image-model-specification-version': '
|
|
117
|
+
'ai-image-model-specification-version': '4',
|
|
118
118
|
'ai-model-id': this.modelId,
|
|
119
119
|
};
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
function maybeEncodeImageFile(file:
|
|
123
|
+
function maybeEncodeImageFile(file: ImageModelV4File) {
|
|
124
124
|
if (file.type === 'file' && file.data instanceof Uint8Array) {
|
|
125
125
|
return {
|
|
126
126
|
...file,
|
|
@@ -51,8 +51,6 @@ export type GatewayModelId =
|
|
|
51
51
|
| 'google/gemini-2.5-flash'
|
|
52
52
|
| 'google/gemini-2.5-flash-image'
|
|
53
53
|
| 'google/gemini-2.5-flash-lite'
|
|
54
|
-
| 'google/gemini-2.5-flash-lite-preview-09-2025'
|
|
55
|
-
| 'google/gemini-2.5-flash-preview-09-2025'
|
|
56
54
|
| 'google/gemini-2.5-pro'
|
|
57
55
|
| 'google/gemini-3-flash'
|
|
58
56
|
| 'google/gemini-3-pro-image'
|
|
@@ -65,6 +63,7 @@ export type GatewayModelId =
|
|
|
65
63
|
| 'kwaipilot/kat-coder-pro-v1'
|
|
66
64
|
| 'meituan/longcat-flash-chat'
|
|
67
65
|
| 'meituan/longcat-flash-thinking'
|
|
66
|
+
| 'meituan/longcat-flash-thinking-2601'
|
|
68
67
|
| 'meta/llama-3.1-70b'
|
|
69
68
|
| 'meta/llama-3.1-8b'
|
|
70
69
|
| 'meta/llama-3.2-11b'
|
|
@@ -78,6 +77,9 @@ export type GatewayModelId =
|
|
|
78
77
|
| 'minimax/minimax-m2.1'
|
|
79
78
|
| 'minimax/minimax-m2.1-lightning'
|
|
80
79
|
| 'minimax/minimax-m2.5'
|
|
80
|
+
| 'minimax/minimax-m2.5-highspeed'
|
|
81
|
+
| 'minimax/minimax-m2.7'
|
|
82
|
+
| 'minimax/minimax-m2.7-highspeed'
|
|
81
83
|
| 'mistral/codestral'
|
|
82
84
|
| 'mistral/devstral-2'
|
|
83
85
|
| 'mistral/devstral-small'
|
|
@@ -105,7 +107,6 @@ export type GatewayModelId =
|
|
|
105
107
|
| 'nvidia/nemotron-3-nano-30b-a3b'
|
|
106
108
|
| 'nvidia/nemotron-nano-12b-v2-vl'
|
|
107
109
|
| 'nvidia/nemotron-nano-9b-v2'
|
|
108
|
-
| 'openai/codex-mini'
|
|
109
110
|
| 'openai/gpt-3.5-turbo'
|
|
110
111
|
| 'openai/gpt-3.5-turbo-instruct'
|
|
111
112
|
| 'openai/gpt-4-turbo'
|
|
@@ -130,12 +131,12 @@ export type GatewayModelId =
|
|
|
130
131
|
| 'openai/gpt-5.2-chat'
|
|
131
132
|
| 'openai/gpt-5.2-codex'
|
|
132
133
|
| 'openai/gpt-5.2-pro'
|
|
133
|
-
| 'openai/gpt-5.4'
|
|
134
|
-
| 'openai/gpt-5.4-2026-03-05'
|
|
135
|
-
| 'openai/gpt-5.4-pro'
|
|
136
|
-
| 'openai/gpt-5.4-pro-2026-03-05'
|
|
137
134
|
| 'openai/gpt-5.3-chat'
|
|
138
135
|
| 'openai/gpt-5.3-codex'
|
|
136
|
+
| 'openai/gpt-5.4'
|
|
137
|
+
| 'openai/gpt-5.4-mini'
|
|
138
|
+
| 'openai/gpt-5.4-nano'
|
|
139
|
+
| 'openai/gpt-5.4-pro'
|
|
139
140
|
| 'openai/gpt-oss-120b'
|
|
140
141
|
| 'openai/gpt-oss-20b'
|
|
141
142
|
| 'openai/gpt-oss-safeguard-20b'
|
|
@@ -147,11 +148,8 @@ export type GatewayModelId =
|
|
|
147
148
|
| 'openai/o4-mini'
|
|
148
149
|
| 'perplexity/sonar'
|
|
149
150
|
| 'perplexity/sonar-pro'
|
|
150
|
-
| 'perplexity/sonar-reasoning'
|
|
151
151
|
| 'perplexity/sonar-reasoning-pro'
|
|
152
152
|
| 'prime-intellect/intellect-3'
|
|
153
|
-
| 'vercel/v0-1.0-md'
|
|
154
|
-
| 'vercel/v0-1.5-md'
|
|
155
153
|
| 'xai/grok-2-vision'
|
|
156
154
|
| 'xai/grok-3'
|
|
157
155
|
| 'xai/grok-3-fast'
|
|
@@ -162,8 +160,12 @@ export type GatewayModelId =
|
|
|
162
160
|
| 'xai/grok-4-fast-reasoning'
|
|
163
161
|
| 'xai/grok-4.1-fast-non-reasoning'
|
|
164
162
|
| 'xai/grok-4.1-fast-reasoning'
|
|
163
|
+
| 'xai/grok-4.20-multi-agent'
|
|
164
|
+
| 'xai/grok-4.20-non-reasoning'
|
|
165
|
+
| 'xai/grok-4.20-reasoning'
|
|
165
166
|
| 'xai/grok-code-fast-1'
|
|
166
167
|
| 'xiaomi/mimo-v2-flash'
|
|
168
|
+
| 'xiaomi/mimo-v2-pro'
|
|
167
169
|
| 'zai/glm-4.5'
|
|
168
170
|
| 'zai/glm-4.5-air'
|
|
169
171
|
| 'zai/glm-4.5v'
|
|
@@ -171,6 +173,8 @@ export type GatewayModelId =
|
|
|
171
173
|
| 'zai/glm-4.6v'
|
|
172
174
|
| 'zai/glm-4.6v-flash'
|
|
173
175
|
| 'zai/glm-4.7'
|
|
176
|
+
| 'zai/glm-4.7-flash'
|
|
174
177
|
| 'zai/glm-4.7-flashx'
|
|
175
178
|
| 'zai/glm-5'
|
|
179
|
+
| 'zai/glm-5-turbo'
|
|
176
180
|
| (string & {});
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
LanguageModelV4,
|
|
3
|
+
LanguageModelV4CallOptions,
|
|
4
|
+
SharedV4Warning,
|
|
5
|
+
LanguageModelV4FilePart,
|
|
6
|
+
LanguageModelV4StreamPart,
|
|
7
|
+
LanguageModelV4GenerateResult,
|
|
8
|
+
LanguageModelV4StreamResult,
|
|
9
9
|
} from '@ai-sdk/provider';
|
|
10
10
|
import {
|
|
11
11
|
combineHeaders,
|
|
@@ -28,8 +28,8 @@ type GatewayChatConfig = GatewayConfig & {
|
|
|
28
28
|
o11yHeaders: Resolvable<Record<string, string>>;
|
|
29
29
|
};
|
|
30
30
|
|
|
31
|
-
export class GatewayLanguageModel implements
|
|
32
|
-
readonly specificationVersion = '
|
|
31
|
+
export class GatewayLanguageModel implements LanguageModelV4 {
|
|
32
|
+
readonly specificationVersion = 'v4';
|
|
33
33
|
readonly supportedUrls = { '*/*': [/.*/] };
|
|
34
34
|
|
|
35
35
|
constructor(
|
|
@@ -41,7 +41,7 @@ export class GatewayLanguageModel implements LanguageModelV3 {
|
|
|
41
41
|
return this.config.provider;
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
private async getArgs(options:
|
|
44
|
+
private async getArgs(options: LanguageModelV4CallOptions) {
|
|
45
45
|
const { abortSignal: _abortSignal, ...optionsWithoutSignal } = options;
|
|
46
46
|
|
|
47
47
|
return {
|
|
@@ -51,8 +51,8 @@ export class GatewayLanguageModel implements LanguageModelV3 {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
async doGenerate(
|
|
54
|
-
options:
|
|
55
|
-
): Promise<
|
|
54
|
+
options: LanguageModelV4CallOptions,
|
|
55
|
+
): Promise<LanguageModelV4GenerateResult> {
|
|
56
56
|
const { args, warnings } = await this.getArgs(options);
|
|
57
57
|
const { abortSignal } = options;
|
|
58
58
|
|
|
@@ -93,8 +93,8 @@ export class GatewayLanguageModel implements LanguageModelV3 {
|
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
async doStream(
|
|
96
|
-
options:
|
|
97
|
-
): Promise<
|
|
96
|
+
options: LanguageModelV4CallOptions,
|
|
97
|
+
): Promise<LanguageModelV4StreamResult> {
|
|
98
98
|
const { args, warnings } = await this.getArgs(options);
|
|
99
99
|
const { abortSignal } = options;
|
|
100
100
|
|
|
@@ -122,8 +122,8 @@ export class GatewayLanguageModel implements LanguageModelV3 {
|
|
|
122
122
|
return {
|
|
123
123
|
stream: response.pipeThrough(
|
|
124
124
|
new TransformStream<
|
|
125
|
-
ParseResult<
|
|
126
|
-
|
|
125
|
+
ParseResult<LanguageModelV4StreamPart>,
|
|
126
|
+
LanguageModelV4StreamPart
|
|
127
127
|
>({
|
|
128
128
|
start(controller) {
|
|
129
129
|
if (warnings.length > 0) {
|
|
@@ -177,11 +177,11 @@ export class GatewayLanguageModel implements LanguageModelV3 {
|
|
|
177
177
|
* @param options - The options to encode.
|
|
178
178
|
* @returns The options with the file parts encoded.
|
|
179
179
|
*/
|
|
180
|
-
private maybeEncodeFileParts(options:
|
|
180
|
+
private maybeEncodeFileParts(options: LanguageModelV4CallOptions) {
|
|
181
181
|
for (const message of options.prompt) {
|
|
182
182
|
for (const part of message.content) {
|
|
183
183
|
if (this.isFilePart(part)) {
|
|
184
|
-
const filePart = part as
|
|
184
|
+
const filePart = part as LanguageModelV4FilePart;
|
|
185
185
|
// If the file part is a URL it will get cleanly converted to a string.
|
|
186
186
|
// If it's a binary file attachment we convert it to a data url.
|
|
187
187
|
// In either case, server-side we should only ever see URLs as strings.
|
|
@@ -204,7 +204,7 @@ export class GatewayLanguageModel implements LanguageModelV3 {
|
|
|
204
204
|
|
|
205
205
|
private getModelConfigHeaders(modelId: string, streaming: boolean) {
|
|
206
206
|
return {
|
|
207
|
-
'ai-language-model-specification-version': '
|
|
207
|
+
'ai-language-model-specification-version': '4',
|
|
208
208
|
'ai-language-model-id': modelId,
|
|
209
209
|
'ai-language-model-streaming': String(streaming),
|
|
210
210
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LanguageModelV4 } from '@ai-sdk/provider';
|
|
2
2
|
|
|
3
3
|
export interface GatewayLanguageModelEntry {
|
|
4
4
|
/**
|
|
@@ -53,6 +53,6 @@ export interface GatewayLanguageModelEntry {
|
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
export type GatewayLanguageModelSpecification = Pick<
|
|
56
|
-
|
|
56
|
+
LanguageModelV4,
|
|
57
57
|
'specificationVersion' | 'provider' | 'modelId'
|
|
58
58
|
>;
|
package/src/gateway-provider.ts
CHANGED
|
@@ -24,27 +24,27 @@ import { gatewayTools } from './gateway-tools';
|
|
|
24
24
|
import { getVercelOidcToken, getVercelRequestId } from './vercel-environment';
|
|
25
25
|
import type { GatewayModelId } from './gateway-language-model-settings';
|
|
26
26
|
import type {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
LanguageModelV4,
|
|
28
|
+
EmbeddingModelV4,
|
|
29
|
+
ImageModelV4,
|
|
30
|
+
Experimental_VideoModelV4,
|
|
31
|
+
ProviderV4,
|
|
32
32
|
} from '@ai-sdk/provider';
|
|
33
33
|
import { withUserAgentSuffix } from '@ai-sdk/provider-utils';
|
|
34
34
|
import { VERSION } from './version';
|
|
35
35
|
|
|
36
|
-
export interface GatewayProvider extends
|
|
37
|
-
(modelId: GatewayModelId):
|
|
36
|
+
export interface GatewayProvider extends ProviderV4 {
|
|
37
|
+
(modelId: GatewayModelId): LanguageModelV4;
|
|
38
38
|
|
|
39
39
|
/**
|
|
40
40
|
* Creates a model for text generation.
|
|
41
41
|
*/
|
|
42
|
-
chat(modelId: GatewayModelId):
|
|
42
|
+
chat(modelId: GatewayModelId): LanguageModelV4;
|
|
43
43
|
|
|
44
44
|
/**
|
|
45
45
|
* Creates a model for text generation.
|
|
46
46
|
*/
|
|
47
|
-
languageModel(modelId: GatewayModelId):
|
|
47
|
+
languageModel(modelId: GatewayModelId): LanguageModelV4;
|
|
48
48
|
|
|
49
49
|
/**
|
|
50
50
|
* Returns available providers and models for use with the remote provider.
|
|
@@ -59,37 +59,37 @@ export interface GatewayProvider extends ProviderV3 {
|
|
|
59
59
|
/**
|
|
60
60
|
* Creates a model for generating text embeddings.
|
|
61
61
|
*/
|
|
62
|
-
embedding(modelId: GatewayEmbeddingModelId):
|
|
62
|
+
embedding(modelId: GatewayEmbeddingModelId): EmbeddingModelV4;
|
|
63
63
|
|
|
64
64
|
/**
|
|
65
65
|
* Creates a model for generating text embeddings.
|
|
66
66
|
*/
|
|
67
|
-
embeddingModel(modelId: GatewayEmbeddingModelId):
|
|
67
|
+
embeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV4;
|
|
68
68
|
|
|
69
69
|
/**
|
|
70
70
|
* @deprecated Use `embeddingModel` instead.
|
|
71
71
|
*/
|
|
72
|
-
textEmbeddingModel(modelId: GatewayEmbeddingModelId):
|
|
72
|
+
textEmbeddingModel(modelId: GatewayEmbeddingModelId): EmbeddingModelV4;
|
|
73
73
|
|
|
74
74
|
/**
|
|
75
75
|
* Creates a model for generating images.
|
|
76
76
|
*/
|
|
77
|
-
image(modelId: GatewayImageModelId):
|
|
77
|
+
image(modelId: GatewayImageModelId): ImageModelV4;
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
80
|
* Creates a model for generating images.
|
|
81
81
|
*/
|
|
82
|
-
imageModel(modelId: GatewayImageModelId):
|
|
82
|
+
imageModel(modelId: GatewayImageModelId): ImageModelV4;
|
|
83
83
|
|
|
84
84
|
/**
|
|
85
85
|
* Creates a model for generating videos.
|
|
86
86
|
*/
|
|
87
|
-
video(modelId: GatewayVideoModelId):
|
|
87
|
+
video(modelId: GatewayVideoModelId): Experimental_VideoModelV4;
|
|
88
88
|
|
|
89
89
|
/**
|
|
90
90
|
* Creates a model for generating videos.
|
|
91
91
|
*/
|
|
92
|
-
videoModel(modelId: GatewayVideoModelId):
|
|
92
|
+
videoModel(modelId: GatewayVideoModelId): Experimental_VideoModelV4;
|
|
93
93
|
|
|
94
94
|
/**
|
|
95
95
|
* Gateway-specific tools executed server-side.
|
|
@@ -263,7 +263,7 @@ export function createGatewayProvider(
|
|
|
263
263
|
return createLanguageModel(modelId);
|
|
264
264
|
};
|
|
265
265
|
|
|
266
|
-
provider.specificationVersion = '
|
|
266
|
+
provider.specificationVersion = 'v4' as const;
|
|
267
267
|
provider.getAvailableModels = getAvailableModels;
|
|
268
268
|
provider.getCredits = getCredits;
|
|
269
269
|
provider.imageModel = (modelId: GatewayImageModelId) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
Experimental_VideoModelV4,
|
|
3
|
+
Experimental_VideoModelV4CallOptions,
|
|
4
|
+
Experimental_VideoModelV4File,
|
|
5
|
+
Experimental_VideoModelV4VideoData,
|
|
6
|
+
SharedV4ProviderMetadata,
|
|
7
|
+
SharedV4Warning,
|
|
8
8
|
} from '@ai-sdk/provider';
|
|
9
9
|
import { APICallError } from '@ai-sdk/provider';
|
|
10
10
|
import {
|
|
@@ -21,8 +21,8 @@ import type { GatewayConfig } from './gateway-config';
|
|
|
21
21
|
import { asGatewayError } from './errors';
|
|
22
22
|
import { parseAuthMethod } from './errors/parse-auth-method';
|
|
23
23
|
|
|
24
|
-
export class GatewayVideoModel implements
|
|
25
|
-
readonly specificationVersion = '
|
|
24
|
+
export class GatewayVideoModel implements Experimental_VideoModelV4 {
|
|
25
|
+
readonly specificationVersion = 'v4' as const;
|
|
26
26
|
// Set a very large number to prevent client-side splitting of requests
|
|
27
27
|
readonly maxVideosPerCall = Number.MAX_SAFE_INTEGER;
|
|
28
28
|
|
|
@@ -50,10 +50,10 @@ export class GatewayVideoModel implements Experimental_VideoModelV3 {
|
|
|
50
50
|
providerOptions,
|
|
51
51
|
headers,
|
|
52
52
|
abortSignal,
|
|
53
|
-
}:
|
|
54
|
-
videos: Array<
|
|
55
|
-
warnings: Array<
|
|
56
|
-
providerMetadata?:
|
|
53
|
+
}: Experimental_VideoModelV4CallOptions): Promise<{
|
|
54
|
+
videos: Array<Experimental_VideoModelV4VideoData>;
|
|
55
|
+
warnings: Array<SharedV4Warning>;
|
|
56
|
+
providerMetadata?: SharedV4ProviderMetadata;
|
|
57
57
|
response: {
|
|
58
58
|
timestamp: Date;
|
|
59
59
|
modelId: string;
|
|
@@ -170,7 +170,7 @@ export class GatewayVideoModel implements Experimental_VideoModelV3 {
|
|
|
170
170
|
videos: responseBody.videos,
|
|
171
171
|
warnings: responseBody.warnings ?? [],
|
|
172
172
|
providerMetadata:
|
|
173
|
-
responseBody.providerMetadata as
|
|
173
|
+
responseBody.providerMetadata as SharedV4ProviderMetadata,
|
|
174
174
|
response: {
|
|
175
175
|
timestamp: new Date(),
|
|
176
176
|
modelId: this.modelId,
|
|
@@ -188,13 +188,13 @@ export class GatewayVideoModel implements Experimental_VideoModelV3 {
|
|
|
188
188
|
|
|
189
189
|
private getModelConfigHeaders() {
|
|
190
190
|
return {
|
|
191
|
-
'ai-video-model-specification-version': '
|
|
191
|
+
'ai-video-model-specification-version': '4',
|
|
192
192
|
'ai-model-id': this.modelId,
|
|
193
193
|
};
|
|
194
194
|
}
|
|
195
195
|
}
|
|
196
196
|
|
|
197
|
-
function maybeEncodeVideoFile(file:
|
|
197
|
+
function maybeEncodeVideoFile(file: Experimental_VideoModelV4File) {
|
|
198
198
|
if (file.type === 'file' && file.data instanceof Uint8Array) {
|
|
199
199
|
return {
|
|
200
200
|
...file,
|