@ai-sdk/xai 4.0.0-beta.3 → 4.0.0-beta.31
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 +230 -8
- package/README.md +2 -0
- package/dist/index.d.mts +132 -50
- package/dist/index.d.ts +132 -50
- package/dist/index.js +421 -94
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +433 -88
- package/dist/index.mjs.map +1 -1
- package/docs/01-xai.mdx +173 -381
- package/package.json +4 -6
- package/src/convert-to-xai-chat-messages.ts +22 -6
- package/src/convert-xai-chat-usage.ts +2 -2
- package/src/files/xai-files-api.ts +16 -0
- package/src/files/xai-files-options.ts +15 -0
- package/src/files/xai-files.ts +93 -0
- package/src/index.ts +1 -0
- package/src/map-xai-finish-reason.ts +2 -2
- package/src/responses/convert-to-xai-responses-input.ts +21 -7
- package/src/responses/convert-xai-responses-usage.ts +2 -2
- package/src/responses/map-xai-responses-finish-reason.ts +3 -2
- package/src/responses/xai-responses-api.ts +31 -1
- package/src/responses/xai-responses-language-model.ts +104 -32
- package/src/responses/xai-responses-options.ts +4 -0
- package/src/responses/xai-responses-prepare-tools.ts +6 -6
- package/src/xai-chat-language-model.ts +41 -22
- package/src/xai-chat-options.ts +3 -6
- package/src/xai-chat-prompt.ts +2 -1
- package/src/xai-image-model.ts +35 -12
- package/src/xai-image-options.ts +2 -0
- package/src/xai-image-settings.ts +0 -2
- package/src/xai-prepare-tools.ts +6 -6
- package/src/xai-provider.ts +34 -21
- package/src/xai-video-model.ts +127 -20
- package/src/xai-video-options.ts +136 -14
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
|
-
import { ProviderV3, LanguageModelV3, ImageModelV3, Experimental_VideoModelV3 } from '@ai-sdk/provider';
|
|
3
2
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
4
|
-
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
3
|
+
import { InferSchema, FetchFunction } from '@ai-sdk/provider-utils';
|
|
4
|
+
import { ProviderV4, LanguageModelV4, ImageModelV4, Experimental_VideoModelV4, FilesV4 } from '@ai-sdk/provider';
|
|
5
5
|
|
|
6
|
-
type XaiChatModelId = 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-
|
|
6
|
+
type XaiChatModelId = 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-0309-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-code-fast-1' | 'grok-4' | 'grok-4-0709' | 'grok-4-latest' | 'grok-3' | 'grok-3-latest' | 'grok-3-mini' | 'grok-3-mini-latest' | (string & {});
|
|
7
7
|
declare const xaiLanguageModelChatOptions: z.ZodObject<{
|
|
8
8
|
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
9
9
|
low: "low";
|
|
@@ -58,7 +58,7 @@ declare const xaiErrorDataSchema: z.ZodObject<{
|
|
|
58
58
|
}, z.core.$strip>;
|
|
59
59
|
type XaiErrorData = z.infer<typeof xaiErrorDataSchema>;
|
|
60
60
|
|
|
61
|
-
type XaiResponsesModelId = 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | (string & {});
|
|
61
|
+
type XaiResponsesModelId = 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-0309-reasoning' | 'grok-4.20-multi-agent-0309' | (string & {});
|
|
62
62
|
/**
|
|
63
63
|
* @see https://docs.x.ai/docs/api-reference#create-new-response
|
|
64
64
|
*/
|
|
@@ -68,6 +68,11 @@ declare const xaiLanguageModelResponsesOptions: z.ZodObject<{
|
|
|
68
68
|
high: "high";
|
|
69
69
|
medium: "medium";
|
|
70
70
|
}>>;
|
|
71
|
+
reasoningSummary: z.ZodOptional<z.ZodEnum<{
|
|
72
|
+
auto: "auto";
|
|
73
|
+
concise: "concise";
|
|
74
|
+
detailed: "detailed";
|
|
75
|
+
}>>;
|
|
71
76
|
logprobs: z.ZodOptional<z.ZodBoolean>;
|
|
72
77
|
topLogprobs: z.ZodOptional<z.ZodNumber>;
|
|
73
78
|
store: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -86,29 +91,105 @@ declare const xaiImageModelOptions: z.ZodObject<{
|
|
|
86
91
|
"1k": "1k";
|
|
87
92
|
"2k": "2k";
|
|
88
93
|
}>>;
|
|
94
|
+
quality: z.ZodOptional<z.ZodEnum<{
|
|
95
|
+
low: "low";
|
|
96
|
+
high: "high";
|
|
97
|
+
medium: "medium";
|
|
98
|
+
}>>;
|
|
99
|
+
user: z.ZodOptional<z.ZodString>;
|
|
89
100
|
}, z.core.$strip>;
|
|
90
101
|
type XaiImageModelOptions = z.infer<typeof xaiImageModelOptions>;
|
|
91
102
|
|
|
92
103
|
type XaiVideoModelId = 'grok-imagine-video' | (string & {});
|
|
93
104
|
|
|
94
|
-
|
|
105
|
+
declare const resolutionSchema: z.ZodEnum<{
|
|
106
|
+
"480p": "480p";
|
|
107
|
+
"720p": "720p";
|
|
108
|
+
}>;
|
|
109
|
+
type XaiVideoResolution = z.infer<typeof resolutionSchema>;
|
|
110
|
+
interface XaiVideoSharedOptions {
|
|
95
111
|
pollIntervalMs?: number | null;
|
|
96
112
|
pollTimeoutMs?: number | null;
|
|
97
|
-
resolution?:
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
113
|
+
resolution?: XaiVideoResolution | null;
|
|
114
|
+
}
|
|
115
|
+
interface XaiVideoEditModeOptions extends XaiVideoSharedOptions {
|
|
116
|
+
/**
|
|
117
|
+
* Select edit-video mode explicitly for best autocomplete and narrowing.
|
|
118
|
+
*/
|
|
119
|
+
mode: 'edit-video';
|
|
120
|
+
/** Source video URL to edit. */
|
|
121
|
+
videoUrl: string;
|
|
122
|
+
}
|
|
123
|
+
interface XaiVideoExtendModeOptions extends XaiVideoSharedOptions {
|
|
124
|
+
/**
|
|
125
|
+
* Select extend-video mode explicitly for best autocomplete and narrowing.
|
|
126
|
+
*/
|
|
127
|
+
mode: 'extend-video';
|
|
128
|
+
/** Source video URL to extend from its last frame. */
|
|
129
|
+
videoUrl: string;
|
|
130
|
+
}
|
|
131
|
+
interface XaiVideoReferenceToVideoOptions extends XaiVideoSharedOptions {
|
|
132
|
+
/**
|
|
133
|
+
* Select reference-to-video mode explicitly for best autocomplete and narrowing.
|
|
134
|
+
*/
|
|
135
|
+
mode: 'reference-to-video';
|
|
136
|
+
/** Reference image URLs (1-7) for R2V generation. */
|
|
137
|
+
referenceImageUrls: string[];
|
|
138
|
+
}
|
|
139
|
+
interface XaiVideoGenerationOptions extends XaiVideoSharedOptions {
|
|
140
|
+
mode?: undefined;
|
|
141
|
+
videoUrl?: undefined;
|
|
142
|
+
referenceImageUrls?: undefined;
|
|
143
|
+
}
|
|
144
|
+
interface XaiLegacyEditVideoOptions extends XaiVideoSharedOptions {
|
|
145
|
+
/**
|
|
146
|
+
* Legacy backward-compatible shape: omitting `mode` while providing
|
|
147
|
+
* `videoUrl` behaves like edit-video.
|
|
148
|
+
*/
|
|
149
|
+
mode?: undefined;
|
|
150
|
+
videoUrl: string;
|
|
151
|
+
}
|
|
152
|
+
interface XaiLegacyReferenceToVideoOptions extends XaiVideoSharedOptions {
|
|
153
|
+
/**
|
|
154
|
+
* Legacy backward-compatible shape: omitting `mode` while providing
|
|
155
|
+
* `referenceImageUrls` behaves like reference-to-video.
|
|
156
|
+
*/
|
|
157
|
+
mode?: undefined;
|
|
158
|
+
referenceImageUrls: string[];
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Provider options for xAI video generation.
|
|
162
|
+
*
|
|
163
|
+
* Use the `mode` option to select the operation:
|
|
164
|
+
*
|
|
165
|
+
* - `'edit-video'` + `videoUrl` -- video editing (`POST /v1/videos/edits`)
|
|
166
|
+
* - `'extend-video'` + `videoUrl` -- video extension (`POST /v1/videos/extensions`)
|
|
167
|
+
* - `'reference-to-video'` + `referenceImageUrls` -- R2V generation (`POST /v1/videos/generations`)
|
|
168
|
+
* - no `mode` -- standard generation from text prompts or image input
|
|
169
|
+
*
|
|
170
|
+
* Runtime remains backward compatible with legacy auto-detected provider
|
|
171
|
+
* options, but the public TypeScript type is intentionally explicit so editors
|
|
172
|
+
* can suggest valid modes and flag invalid field combinations.
|
|
173
|
+
*/
|
|
174
|
+
type XaiVideoModelOptions = XaiVideoGenerationOptions | XaiVideoEditModeOptions | XaiVideoExtendModeOptions | XaiVideoReferenceToVideoOptions | XaiLegacyEditVideoOptions | XaiLegacyReferenceToVideoOptions;
|
|
175
|
+
|
|
176
|
+
declare const xaiFilesOptionsSchema: _ai_sdk_provider_utils.LazySchema<{
|
|
177
|
+
[x: string]: unknown;
|
|
178
|
+
teamId?: string | undefined;
|
|
179
|
+
filePath?: string | undefined;
|
|
180
|
+
}>;
|
|
181
|
+
type XaiFilesOptions = InferSchema<typeof xaiFilesOptionsSchema>;
|
|
101
182
|
|
|
102
|
-
type XaiImageModelId = 'grok-
|
|
183
|
+
type XaiImageModelId = 'grok-imagine-image' | 'grok-imagine-image-pro' | (string & {});
|
|
103
184
|
|
|
104
185
|
declare const codeExecutionToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, {
|
|
105
186
|
output: string;
|
|
106
187
|
error?: string | undefined;
|
|
107
|
-
}, object>;
|
|
188
|
+
}, object, {}>;
|
|
108
189
|
declare const codeExecution: (args?: Parameters<typeof codeExecutionToolFactory>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
109
190
|
output: string;
|
|
110
191
|
error?: string | undefined;
|
|
111
|
-
}>;
|
|
192
|
+
}, {}>;
|
|
112
193
|
|
|
113
194
|
declare const mcpServerToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
114
195
|
name: string;
|
|
@@ -121,32 +202,32 @@ declare const mcpServerToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWi
|
|
|
121
202
|
allowedTools?: string[];
|
|
122
203
|
headers?: Record<string, string>;
|
|
123
204
|
authorization?: string;
|
|
124
|
-
}>;
|
|
205
|
+
}, {}>;
|
|
125
206
|
declare const mcpServer: (args: Parameters<typeof mcpServerToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
126
207
|
name: string;
|
|
127
208
|
arguments: string;
|
|
128
209
|
result: unknown;
|
|
129
|
-
}>;
|
|
210
|
+
}, {}>;
|
|
130
211
|
|
|
131
212
|
declare const viewImageToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, {
|
|
132
213
|
description: string;
|
|
133
214
|
objects?: string[] | undefined;
|
|
134
|
-
}, object>;
|
|
215
|
+
}, object, {}>;
|
|
135
216
|
declare const viewImage: (args?: Parameters<typeof viewImageToolFactory>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
136
217
|
description: string;
|
|
137
218
|
objects?: string[] | undefined;
|
|
138
|
-
}>;
|
|
219
|
+
}, {}>;
|
|
139
220
|
|
|
140
221
|
declare const viewXVideoToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, {
|
|
141
222
|
description: string;
|
|
142
223
|
transcript?: string | undefined;
|
|
143
224
|
duration?: number | undefined;
|
|
144
|
-
}, object>;
|
|
225
|
+
}, object, {}>;
|
|
145
226
|
declare const viewXVideo: (args?: Parameters<typeof viewXVideoToolFactory>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
146
227
|
description: string;
|
|
147
228
|
transcript?: string | undefined;
|
|
148
229
|
duration?: number | undefined;
|
|
149
|
-
}>;
|
|
230
|
+
}, {}>;
|
|
150
231
|
|
|
151
232
|
declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
152
233
|
query: string;
|
|
@@ -159,7 +240,7 @@ declare const webSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWi
|
|
|
159
240
|
allowedDomains?: string[];
|
|
160
241
|
excludedDomains?: string[];
|
|
161
242
|
enableImageUnderstanding?: boolean;
|
|
162
|
-
}>;
|
|
243
|
+
}, {}>;
|
|
163
244
|
declare const webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
164
245
|
query: string;
|
|
165
246
|
sources: Array<{
|
|
@@ -167,7 +248,7 @@ declare const webSearch: (args?: Parameters<typeof webSearchToolFactory>[0]) =>
|
|
|
167
248
|
url: string;
|
|
168
249
|
snippet: string;
|
|
169
250
|
}>;
|
|
170
|
-
}>;
|
|
251
|
+
}, {}>;
|
|
171
252
|
|
|
172
253
|
declare const xSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
173
254
|
query: string;
|
|
@@ -184,7 +265,7 @@ declare const xSearchToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWith
|
|
|
184
265
|
toDate?: string;
|
|
185
266
|
enableImageUnderstanding?: boolean;
|
|
186
267
|
enableVideoUnderstanding?: boolean;
|
|
187
|
-
}>;
|
|
268
|
+
}, {}>;
|
|
188
269
|
declare const xSearch: (args?: Parameters<typeof xSearchToolFactory>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
189
270
|
query: string;
|
|
190
271
|
posts: Array<{
|
|
@@ -193,16 +274,16 @@ declare const xSearch: (args?: Parameters<typeof xSearchToolFactory>[0]) => _ai_
|
|
|
193
274
|
url: string;
|
|
194
275
|
likes: number;
|
|
195
276
|
}>;
|
|
196
|
-
}>;
|
|
277
|
+
}, {}>;
|
|
197
278
|
|
|
198
279
|
declare const xaiTools: {
|
|
199
280
|
codeExecution: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, {
|
|
200
281
|
output: string;
|
|
201
282
|
error?: string | undefined;
|
|
202
|
-
}, object>>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
283
|
+
}, object, {}>>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
203
284
|
output: string;
|
|
204
285
|
error?: string | undefined;
|
|
205
|
-
}>;
|
|
286
|
+
}, {}>;
|
|
206
287
|
fileSearch: (args: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
207
288
|
queries: string[];
|
|
208
289
|
results: null | {
|
|
@@ -214,7 +295,7 @@ declare const xaiTools: {
|
|
|
214
295
|
}, {
|
|
215
296
|
vectorStoreIds: string[];
|
|
216
297
|
maxNumResults?: number;
|
|
217
|
-
}>>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
298
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
218
299
|
queries: string[];
|
|
219
300
|
results: null | {
|
|
220
301
|
fileId: string;
|
|
@@ -222,7 +303,7 @@ declare const xaiTools: {
|
|
|
222
303
|
score: number;
|
|
223
304
|
text: string;
|
|
224
305
|
}[];
|
|
225
|
-
}>;
|
|
306
|
+
}, {}>;
|
|
226
307
|
mcpServer: (args: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
227
308
|
name: string;
|
|
228
309
|
arguments: string;
|
|
@@ -234,27 +315,27 @@ declare const xaiTools: {
|
|
|
234
315
|
allowedTools?: string[];
|
|
235
316
|
headers?: Record<string, string>;
|
|
236
317
|
authorization?: string;
|
|
237
|
-
}>>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
318
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
238
319
|
name: string;
|
|
239
320
|
arguments: string;
|
|
240
321
|
result: unknown;
|
|
241
|
-
}>;
|
|
322
|
+
}, {}>;
|
|
242
323
|
viewImage: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, {
|
|
243
324
|
description: string;
|
|
244
325
|
objects?: string[] | undefined;
|
|
245
|
-
}, object>>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
326
|
+
}, object, {}>>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
246
327
|
description: string;
|
|
247
328
|
objects?: string[] | undefined;
|
|
248
|
-
}>;
|
|
329
|
+
}, {}>;
|
|
249
330
|
viewXVideo: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, {
|
|
250
331
|
description: string;
|
|
251
332
|
transcript?: string | undefined;
|
|
252
333
|
duration?: number | undefined;
|
|
253
|
-
}, object>>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
334
|
+
}, object, {}>>[0]) => _ai_sdk_provider_utils.Tool<Record<string, never>, {
|
|
254
335
|
description: string;
|
|
255
336
|
transcript?: string | undefined;
|
|
256
337
|
duration?: number | undefined;
|
|
257
|
-
}>;
|
|
338
|
+
}, {}>;
|
|
258
339
|
webSearch: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
259
340
|
query: string;
|
|
260
341
|
sources: Array<{
|
|
@@ -266,14 +347,14 @@ declare const xaiTools: {
|
|
|
266
347
|
allowedDomains?: string[];
|
|
267
348
|
excludedDomains?: string[];
|
|
268
349
|
enableImageUnderstanding?: boolean;
|
|
269
|
-
}>>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
350
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
270
351
|
query: string;
|
|
271
352
|
sources: Array<{
|
|
272
353
|
title: string;
|
|
273
354
|
url: string;
|
|
274
355
|
snippet: string;
|
|
275
356
|
}>;
|
|
276
|
-
}>;
|
|
357
|
+
}, {}>;
|
|
277
358
|
xSearch: (args?: Parameters<_ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<{}, {
|
|
278
359
|
query: string;
|
|
279
360
|
posts: Array<{
|
|
@@ -289,7 +370,7 @@ declare const xaiTools: {
|
|
|
289
370
|
toDate?: string;
|
|
290
371
|
enableImageUnderstanding?: boolean;
|
|
291
372
|
enableVideoUnderstanding?: boolean;
|
|
292
|
-
}>>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
373
|
+
}, {}>>[0]) => _ai_sdk_provider_utils.Tool<{}, {
|
|
293
374
|
query: string;
|
|
294
375
|
posts: Array<{
|
|
295
376
|
author: string;
|
|
@@ -297,42 +378,43 @@ declare const xaiTools: {
|
|
|
297
378
|
url: string;
|
|
298
379
|
likes: number;
|
|
299
380
|
}>;
|
|
300
|
-
}>;
|
|
381
|
+
}, {}>;
|
|
301
382
|
};
|
|
302
383
|
|
|
303
|
-
interface XaiProvider extends
|
|
304
|
-
|
|
305
|
-
* Creates an Xai chat model for text generation.
|
|
306
|
-
*/
|
|
307
|
-
(modelId: XaiChatModelId): LanguageModelV3;
|
|
384
|
+
interface XaiProvider extends ProviderV4 {
|
|
385
|
+
(modelId: XaiResponsesModelId): LanguageModelV4;
|
|
308
386
|
/**
|
|
309
387
|
* Creates an Xai language model for text generation.
|
|
310
388
|
*/
|
|
311
|
-
languageModel(modelId:
|
|
389
|
+
languageModel(modelId: XaiResponsesModelId): LanguageModelV4;
|
|
312
390
|
/**
|
|
313
391
|
* Creates an Xai chat model for text generation.
|
|
314
392
|
*/
|
|
315
|
-
chat: (modelId: XaiChatModelId) =>
|
|
393
|
+
chat: (modelId: XaiChatModelId) => LanguageModelV4;
|
|
316
394
|
/**
|
|
317
|
-
* Creates an Xai responses model for
|
|
395
|
+
* Creates an Xai responses model for text generation.
|
|
318
396
|
*/
|
|
319
|
-
responses: (modelId: XaiResponsesModelId) =>
|
|
397
|
+
responses: (modelId: XaiResponsesModelId) => LanguageModelV4;
|
|
320
398
|
/**
|
|
321
399
|
* Creates an Xai image model for image generation.
|
|
322
400
|
*/
|
|
323
|
-
image(modelId: XaiImageModelId):
|
|
401
|
+
image(modelId: XaiImageModelId): ImageModelV4;
|
|
324
402
|
/**
|
|
325
403
|
* Creates an Xai image model for image generation.
|
|
326
404
|
*/
|
|
327
|
-
imageModel(modelId: XaiImageModelId):
|
|
405
|
+
imageModel(modelId: XaiImageModelId): ImageModelV4;
|
|
328
406
|
/**
|
|
329
407
|
* Creates an Xai video model for video generation.
|
|
330
408
|
*/
|
|
331
|
-
video(modelId: XaiVideoModelId):
|
|
409
|
+
video(modelId: XaiVideoModelId): Experimental_VideoModelV4;
|
|
332
410
|
/**
|
|
333
411
|
* Creates an Xai video model for video generation.
|
|
334
412
|
*/
|
|
335
|
-
videoModel(modelId: XaiVideoModelId):
|
|
413
|
+
videoModel(modelId: XaiVideoModelId): Experimental_VideoModelV4;
|
|
414
|
+
/**
|
|
415
|
+
* Returns the xAI files interface for uploading files.
|
|
416
|
+
*/
|
|
417
|
+
files(): FilesV4;
|
|
336
418
|
/**
|
|
337
419
|
* Server-side agentic tools for use with the responses API.
|
|
338
420
|
*/
|
|
@@ -366,4 +448,4 @@ declare const xai: XaiProvider;
|
|
|
366
448
|
|
|
367
449
|
declare const VERSION: string;
|
|
368
450
|
|
|
369
|
-
export { VERSION, type XaiErrorData, type XaiImageModelOptions, type XaiImageModelOptions as XaiImageProviderOptions, type XaiLanguageModelChatOptions, type XaiLanguageModelResponsesOptions, type XaiProvider, type XaiLanguageModelChatOptions as XaiProviderOptions, type XaiProviderSettings, type XaiLanguageModelResponsesOptions as XaiResponsesProviderOptions, type XaiVideoModelId, type XaiVideoModelOptions, type XaiVideoModelOptions as XaiVideoProviderOptions, codeExecution, createXai, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools };
|
|
451
|
+
export { VERSION, type XaiErrorData, type XaiFilesOptions, type XaiImageModelOptions, type XaiImageModelOptions as XaiImageProviderOptions, type XaiLanguageModelChatOptions, type XaiLanguageModelResponsesOptions, type XaiProvider, type XaiLanguageModelChatOptions as XaiProviderOptions, type XaiProviderSettings, type XaiLanguageModelResponsesOptions as XaiResponsesProviderOptions, type XaiVideoModelId, type XaiVideoModelOptions, type XaiVideoModelOptions as XaiVideoProviderOptions, codeExecution, createXai, mcpServer, viewImage, viewXVideo, webSearch, xSearch, xai, xaiTools };
|