@ai-sdk/xai 2.0.0-canary.9 → 2.0.0

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 CHANGED
@@ -1,5 +1,593 @@
1
1
  # @ai-sdk/xai
2
2
 
3
+ ## 2.0.0
4
+
5
+ ### Major Changes
6
+
7
+ - d5f588f: AI SDK 5
8
+ - 516be5b: ### Move Image Model Settings into generate options
9
+
10
+ Image Models no longer have settings. Instead, `maxImagesPerCall` can be passed directly to `generateImage()`. All other image settings can be passed to `providerOptions[provider]`.
11
+
12
+ Before
13
+
14
+ ```js
15
+ await generateImage({
16
+ model: luma.image('photon-flash-1', {
17
+ maxImagesPerCall: 5,
18
+ pollIntervalMillis: 500,
19
+ }),
20
+ prompt,
21
+ n: 10,
22
+ });
23
+ ```
24
+
25
+ After
26
+
27
+ ```js
28
+ await generateImage({
29
+ model: luma.image('photon-flash-1'),
30
+ prompt,
31
+ n: 10,
32
+ maxImagesPerCall: 5,
33
+ providerOptions: {
34
+ luma: { pollIntervalMillis: 5 },
35
+ },
36
+ });
37
+ ```
38
+
39
+ Pull Request: https://github.com/vercel/ai/pull/6180
40
+
41
+ ### Minor Changes
42
+
43
+ - b94b4ed: add live search
44
+
45
+ ### Patch Changes
46
+
47
+ - 41cab5c: fix(providers/xai): edit supported models for structured output
48
+ - fa49207: feat(providers/openai-compatible): convert to providerOptions
49
+ - cf8280e: fix(providers/xai): return actual usage when streaming instead of NaN
50
+ - e2aceaf: feat: add raw chunk support
51
+ - eb173f1: chore (providers): remove model shorthand deprecation warnings
52
+ - 9301f86: refactor (image-model): rename `ImageModelV1` to `ImageModelV2`
53
+ - 6d835a7: fix (provider/grok): filter duplicated reasoning chunks
54
+ - d9b26f2: chore (providers/xai): update grok-3 model aliases
55
+ - 66b9661: feat (provider/xai): export XaiProviderOptions
56
+ - 9e986f7: feat (provider/xai): add grok-4 model id
57
+ - d1a034f: feature: using Zod 4 for internal stuff
58
+ - 107cd62: Add native XAI chat language model implementation
59
+ - 205077b: fix: improve Zod compatibility
60
+ - a7d3fbd: feat (providers/xai): add grok-3 models
61
+ - Updated dependencies [a571d6e]
62
+ - Updated dependencies [742b7be]
63
+ - Updated dependencies [e7fcc86]
64
+ - Updated dependencies [7cddb72]
65
+ - Updated dependencies [ccce59b]
66
+ - Updated dependencies [e2b9e4b]
67
+ - Updated dependencies [95857aa]
68
+ - Updated dependencies [45c1ea2]
69
+ - Updated dependencies [6f6bb89]
70
+ - Updated dependencies [060370c]
71
+ - Updated dependencies [dc714f3]
72
+ - Updated dependencies [b5da06a]
73
+ - Updated dependencies [d1a1aa1]
74
+ - Updated dependencies [63f9e9b]
75
+ - Updated dependencies [5d142ab]
76
+ - Updated dependencies [d5f588f]
77
+ - Updated dependencies [e025824]
78
+ - Updated dependencies [0571b98]
79
+ - Updated dependencies [6db02c9]
80
+ - Updated dependencies [b6b43c7]
81
+ - Updated dependencies [4fef487]
82
+ - Updated dependencies [48d257a]
83
+ - Updated dependencies [0c0c0b3]
84
+ - Updated dependencies [0d2c085]
85
+ - Updated dependencies [fa49207]
86
+ - Updated dependencies [40acf9b]
87
+ - Updated dependencies [cf8280e]
88
+ - Updated dependencies [9222aeb]
89
+ - Updated dependencies [b9a6121]
90
+ - Updated dependencies [e2aceaf]
91
+ - Updated dependencies [411e483]
92
+ - Updated dependencies [8ba77a7]
93
+ - Updated dependencies [db72adc]
94
+ - Updated dependencies [7b3ae3f]
95
+ - Updated dependencies [a166433]
96
+ - Updated dependencies [26735b5]
97
+ - Updated dependencies [443d8ec]
98
+ - Updated dependencies [42e32b0]
99
+ - Updated dependencies [a8c8bd5]
100
+ - Updated dependencies [abf9a79]
101
+ - Updated dependencies [14c9410]
102
+ - Updated dependencies [e86be6f]
103
+ - Updated dependencies [9bf7291]
104
+ - Updated dependencies [2e13791]
105
+ - Updated dependencies [7b069ed]
106
+ - Updated dependencies [9f95b35]
107
+ - Updated dependencies [66962ed]
108
+ - Updated dependencies [0d06df6]
109
+ - Updated dependencies [472524a]
110
+ - Updated dependencies [dd3ff01]
111
+ - Updated dependencies [d9209ca]
112
+ - Updated dependencies [d9c98f4]
113
+ - Updated dependencies [05d2819]
114
+ - Updated dependencies [9301f86]
115
+ - Updated dependencies [0a87932]
116
+ - Updated dependencies [737f1e2]
117
+ - Updated dependencies [c4a2fec]
118
+ - Updated dependencies [957b739]
119
+ - Updated dependencies [79457bd]
120
+ - Updated dependencies [a3f768e]
121
+ - Updated dependencies [7435eb5]
122
+ - Updated dependencies [8aa9e20]
123
+ - Updated dependencies [4617fab]
124
+ - Updated dependencies [516be5b]
125
+ - Updated dependencies [ac34802]
126
+ - Updated dependencies [0054544]
127
+ - Updated dependencies [cb68df0]
128
+ - Updated dependencies [ad80501]
129
+ - Updated dependencies [68ecf2f]
130
+ - Updated dependencies [9e9c809]
131
+ - Updated dependencies [32831c6]
132
+ - Updated dependencies [6dc848c]
133
+ - Updated dependencies [6b98118]
134
+ - Updated dependencies [d0f9495]
135
+ - Updated dependencies [63d791d]
136
+ - Updated dependencies [87b828f]
137
+ - Updated dependencies [3f2f00c]
138
+ - Updated dependencies [bfdca8d]
139
+ - Updated dependencies [0ff02bb]
140
+ - Updated dependencies [7979f7f]
141
+ - Updated dependencies [39a4fab]
142
+ - Updated dependencies [44f4aba]
143
+ - Updated dependencies [9bd5ab5]
144
+ - Updated dependencies [57edfcb]
145
+ - Updated dependencies [faf8446]
146
+ - Updated dependencies [7ea4132]
147
+ - Updated dependencies [d1a034f]
148
+ - Updated dependencies [5c56081]
149
+ - Updated dependencies [fd65bc6]
150
+ - Updated dependencies [023ba40]
151
+ - Updated dependencies [ea7a7c9]
152
+ - Updated dependencies [1b101e1]
153
+ - Updated dependencies [26535e0]
154
+ - Updated dependencies [e030615]
155
+ - Updated dependencies [5e57fae]
156
+ - Updated dependencies [393138b]
157
+ - Updated dependencies [c57e248]
158
+ - Updated dependencies [88a8ee5]
159
+ - Updated dependencies [41fa418]
160
+ - Updated dependencies [205077b]
161
+ - Updated dependencies [71f938d]
162
+ - Updated dependencies [3795467]
163
+ - Updated dependencies [28a5ed5]
164
+ - Updated dependencies [7182d14]
165
+ - Updated dependencies [c1e6647]
166
+ - Updated dependencies [1766ede]
167
+ - Updated dependencies [811dff3]
168
+ - Updated dependencies [f10304b]
169
+ - Updated dependencies [dd5fd43]
170
+ - Updated dependencies [33f4a6a]
171
+ - Updated dependencies [383cbfa]
172
+ - Updated dependencies [27deb4d]
173
+ - Updated dependencies [c4df419]
174
+ - Updated dependencies [281bb1c]
175
+ - @ai-sdk/provider-utils@3.0.0
176
+ - @ai-sdk/provider@2.0.0
177
+ - @ai-sdk/openai-compatible@1.0.0
178
+
179
+ ## 2.0.0-beta.15
180
+
181
+ ### Patch Changes
182
+
183
+ - Updated dependencies [88a8ee5]
184
+ - @ai-sdk/provider-utils@3.0.0-beta.10
185
+ - @ai-sdk/openai-compatible@1.0.0-beta.13
186
+
187
+ ## 2.0.0-beta.14
188
+
189
+ ### Patch Changes
190
+
191
+ - Updated dependencies [27deb4d]
192
+ - @ai-sdk/provider@2.0.0-beta.2
193
+ - @ai-sdk/openai-compatible@1.0.0-beta.12
194
+ - @ai-sdk/provider-utils@3.0.0-beta.9
195
+
196
+ ## 2.0.0-beta.13
197
+
198
+ ### Patch Changes
199
+
200
+ - eb173f1: chore (providers): remove model shorthand deprecation warnings
201
+ - Updated dependencies [dd5fd43]
202
+ - @ai-sdk/provider-utils@3.0.0-beta.8
203
+ - @ai-sdk/openai-compatible@1.0.0-beta.11
204
+
205
+ ## 2.0.0-beta.12
206
+
207
+ ### Patch Changes
208
+
209
+ - Updated dependencies [e7fcc86]
210
+ - @ai-sdk/provider-utils@3.0.0-beta.7
211
+ - @ai-sdk/openai-compatible@1.0.0-beta.10
212
+
213
+ ## 2.0.0-beta.11
214
+
215
+ ### Patch Changes
216
+
217
+ - Updated dependencies [737f1e2]
218
+ - Updated dependencies [ac34802]
219
+ - @ai-sdk/openai-compatible@1.0.0-beta.9
220
+ - @ai-sdk/provider-utils@3.0.0-beta.6
221
+
222
+ ## 2.0.0-beta.10
223
+
224
+ ### Patch Changes
225
+
226
+ - Updated dependencies [57edfcb]
227
+ - Updated dependencies [383cbfa]
228
+ - @ai-sdk/provider-utils@3.0.0-beta.5
229
+ - @ai-sdk/openai-compatible@1.0.0-beta.8
230
+
231
+ ## 2.0.0-beta.9
232
+
233
+ ### Patch Changes
234
+
235
+ - 205077b: fix: improve Zod compatibility
236
+ - Updated dependencies [205077b]
237
+ - @ai-sdk/openai-compatible@1.0.0-beta.7
238
+ - @ai-sdk/provider-utils@3.0.0-beta.4
239
+
240
+ ## 2.0.0-beta.8
241
+
242
+ ### Patch Changes
243
+
244
+ - 6d835a7: fix (provider/grok): filter duplicated reasoning chunks
245
+
246
+ ## 2.0.0-beta.7
247
+
248
+ ### Patch Changes
249
+
250
+ - Updated dependencies [281bb1c]
251
+ - @ai-sdk/openai-compatible@1.0.0-beta.6
252
+
253
+ ## 2.0.0-beta.6
254
+
255
+ ### Patch Changes
256
+
257
+ - Updated dependencies [05d2819]
258
+ - @ai-sdk/provider-utils@3.0.0-beta.3
259
+ - @ai-sdk/openai-compatible@1.0.0-beta.5
260
+
261
+ ## 2.0.0-beta.5
262
+
263
+ ### Patch Changes
264
+
265
+ - 66b9661: feat (provider/xai): export XaiProviderOptions
266
+ - Updated dependencies [1b101e1]
267
+ - @ai-sdk/openai-compatible@1.0.0-beta.4
268
+
269
+ ## 2.0.0-beta.4
270
+
271
+ ### Patch Changes
272
+
273
+ - 9e986f7: feat (provider/xai): add grok-4 model id
274
+
275
+ ## 2.0.0-beta.3
276
+
277
+ ### Patch Changes
278
+
279
+ - Updated dependencies [7b069ed]
280
+ - @ai-sdk/openai-compatible@1.0.0-beta.3
281
+
282
+ ## 2.0.0-beta.2
283
+
284
+ ### Patch Changes
285
+
286
+ - d1a034f: feature: using Zod 4 for internal stuff
287
+ - Updated dependencies [0571b98]
288
+ - Updated dependencies [39a4fab]
289
+ - Updated dependencies [d1a034f]
290
+ - @ai-sdk/provider-utils@3.0.0-beta.2
291
+ - @ai-sdk/openai-compatible@1.0.0-beta.2
292
+
293
+ ## 2.0.0-beta.1
294
+
295
+ ### Patch Changes
296
+
297
+ - Updated dependencies [742b7be]
298
+ - Updated dependencies [7cddb72]
299
+ - Updated dependencies [ccce59b]
300
+ - Updated dependencies [e2b9e4b]
301
+ - Updated dependencies [45c1ea2]
302
+ - Updated dependencies [e025824]
303
+ - Updated dependencies [0d06df6]
304
+ - Updated dependencies [472524a]
305
+ - Updated dependencies [dd3ff01]
306
+ - Updated dependencies [7435eb5]
307
+ - Updated dependencies [cb68df0]
308
+ - Updated dependencies [bfdca8d]
309
+ - Updated dependencies [44f4aba]
310
+ - Updated dependencies [023ba40]
311
+ - Updated dependencies [5e57fae]
312
+ - Updated dependencies [71f938d]
313
+ - Updated dependencies [28a5ed5]
314
+ - @ai-sdk/provider@2.0.0-beta.1
315
+ - @ai-sdk/provider-utils@3.0.0-beta.1
316
+ - @ai-sdk/openai-compatible@1.0.0-beta.1
317
+
318
+ ## 2.0.0-alpha.15
319
+
320
+ ### Patch Changes
321
+
322
+ - Updated dependencies [48d257a]
323
+ - Updated dependencies [8ba77a7]
324
+ - @ai-sdk/provider@2.0.0-alpha.15
325
+ - @ai-sdk/provider-utils@3.0.0-alpha.15
326
+ - @ai-sdk/openai-compatible@1.0.0-alpha.15
327
+
328
+ ## 2.0.0-alpha.14
329
+
330
+ ### Patch Changes
331
+
332
+ - Updated dependencies [b5da06a]
333
+ - Updated dependencies [63f9e9b]
334
+ - Updated dependencies [2e13791]
335
+ - @ai-sdk/provider@2.0.0-alpha.14
336
+ - @ai-sdk/openai-compatible@1.0.0-alpha.14
337
+ - @ai-sdk/provider-utils@3.0.0-alpha.14
338
+
339
+ ## 2.0.0-alpha.13
340
+
341
+ ### Patch Changes
342
+
343
+ - Updated dependencies [68ecf2f]
344
+ - @ai-sdk/provider@2.0.0-alpha.13
345
+ - @ai-sdk/openai-compatible@1.0.0-alpha.13
346
+ - @ai-sdk/provider-utils@3.0.0-alpha.13
347
+
348
+ ## 2.0.0-alpha.12
349
+
350
+ ### Patch Changes
351
+
352
+ - e2aceaf: feat: add raw chunk support
353
+ - Updated dependencies [e2aceaf]
354
+ - @ai-sdk/openai-compatible@1.0.0-alpha.12
355
+ - @ai-sdk/provider@2.0.0-alpha.12
356
+ - @ai-sdk/provider-utils@3.0.0-alpha.12
357
+
358
+ ## 2.0.0-alpha.11
359
+
360
+ ### Patch Changes
361
+
362
+ - Updated dependencies [c1e6647]
363
+ - @ai-sdk/provider@2.0.0-alpha.11
364
+ - @ai-sdk/openai-compatible@1.0.0-alpha.11
365
+ - @ai-sdk/provider-utils@3.0.0-alpha.11
366
+
367
+ ## 2.0.0-alpha.10
368
+
369
+ ### Patch Changes
370
+
371
+ - Updated dependencies [c4df419]
372
+ - @ai-sdk/provider@2.0.0-alpha.10
373
+ - @ai-sdk/openai-compatible@1.0.0-alpha.10
374
+ - @ai-sdk/provider-utils@3.0.0-alpha.10
375
+
376
+ ## 2.0.0-alpha.9
377
+
378
+ ### Minor Changes
379
+
380
+ - b94b4ed: add live search
381
+
382
+ ### Patch Changes
383
+
384
+ - 107cd62: Add native XAI chat language model implementation
385
+ - Updated dependencies [811dff3]
386
+ - @ai-sdk/provider@2.0.0-alpha.9
387
+ - @ai-sdk/openai-compatible@1.0.0-alpha.9
388
+ - @ai-sdk/provider-utils@3.0.0-alpha.9
389
+
390
+ ## 2.0.0-alpha.8
391
+
392
+ ### Patch Changes
393
+
394
+ - Updated dependencies [4fef487]
395
+ - Updated dependencies [9222aeb]
396
+ - @ai-sdk/provider-utils@3.0.0-alpha.8
397
+ - @ai-sdk/provider@2.0.0-alpha.8
398
+ - @ai-sdk/openai-compatible@1.0.0-alpha.8
399
+
400
+ ## 2.0.0-alpha.7
401
+
402
+ ### Patch Changes
403
+
404
+ - Updated dependencies [5c56081]
405
+ - @ai-sdk/provider@2.0.0-alpha.7
406
+ - @ai-sdk/openai-compatible@1.0.0-alpha.7
407
+ - @ai-sdk/provider-utils@3.0.0-alpha.7
408
+
409
+ ## 2.0.0-alpha.6
410
+
411
+ ### Patch Changes
412
+
413
+ - Updated dependencies [0d2c085]
414
+ - @ai-sdk/provider@2.0.0-alpha.6
415
+ - @ai-sdk/openai-compatible@1.0.0-alpha.6
416
+ - @ai-sdk/provider-utils@3.0.0-alpha.6
417
+
418
+ ## 2.0.0-alpha.4
419
+
420
+ ### Patch Changes
421
+
422
+ - Updated dependencies [dc714f3]
423
+ - @ai-sdk/provider@2.0.0-alpha.4
424
+ - @ai-sdk/openai-compatible@1.0.0-alpha.4
425
+ - @ai-sdk/provider-utils@3.0.0-alpha.4
426
+
427
+ ## 2.0.0-alpha.3
428
+
429
+ ### Patch Changes
430
+
431
+ - Updated dependencies [6b98118]
432
+ - @ai-sdk/provider@2.0.0-alpha.3
433
+ - @ai-sdk/openai-compatible@1.0.0-alpha.3
434
+ - @ai-sdk/provider-utils@3.0.0-alpha.3
435
+
436
+ ## 2.0.0-alpha.2
437
+
438
+ ### Patch Changes
439
+
440
+ - Updated dependencies [26535e0]
441
+ - @ai-sdk/provider@2.0.0-alpha.2
442
+ - @ai-sdk/openai-compatible@1.0.0-alpha.2
443
+ - @ai-sdk/provider-utils@3.0.0-alpha.2
444
+
445
+ ## 2.0.0-alpha.1
446
+
447
+ ### Patch Changes
448
+
449
+ - Updated dependencies [3f2f00c]
450
+ - @ai-sdk/provider@2.0.0-alpha.1
451
+ - @ai-sdk/openai-compatible@1.0.0-alpha.1
452
+ - @ai-sdk/provider-utils@3.0.0-alpha.1
453
+
454
+ ## 2.0.0-canary.19
455
+
456
+ ### Patch Changes
457
+
458
+ - Updated dependencies [faf8446]
459
+ - @ai-sdk/provider-utils@3.0.0-canary.19
460
+ - @ai-sdk/openai-compatible@1.0.0-canary.19
461
+
462
+ ## 2.0.0-canary.18
463
+
464
+ ### Patch Changes
465
+
466
+ - Updated dependencies [40acf9b]
467
+ - @ai-sdk/provider-utils@3.0.0-canary.18
468
+ - @ai-sdk/openai-compatible@1.0.0-canary.18
469
+
470
+ ## 2.0.0-canary.17
471
+
472
+ ### Major Changes
473
+
474
+ - 516be5b: ### Move Image Model Settings into generate options
475
+
476
+ Image Models no longer have settings. Instead, `maxImagesPerCall` can be passed directly to `generateImage()`. All other image settings can be passed to `providerOptions[provider]`.
477
+
478
+ Before
479
+
480
+ ```js
481
+ await generateImage({
482
+ model: luma.image('photon-flash-1', {
483
+ maxImagesPerCall: 5,
484
+ pollIntervalMillis: 500,
485
+ }),
486
+ prompt,
487
+ n: 10,
488
+ });
489
+ ```
490
+
491
+ After
492
+
493
+ ```js
494
+ await generateImage({
495
+ model: luma.image('photon-flash-1'),
496
+ prompt,
497
+ n: 10,
498
+ maxImagesPerCall: 5,
499
+ providerOptions: {
500
+ luma: { pollIntervalMillis: 5 },
501
+ },
502
+ });
503
+ ```
504
+
505
+ Pull Request: https://github.com/vercel/ai/pull/6180
506
+
507
+ ### Patch Changes
508
+
509
+ - Updated dependencies [516be5b]
510
+ - Updated dependencies [ea7a7c9]
511
+ - @ai-sdk/openai-compatible@1.0.0-canary.17
512
+ - @ai-sdk/provider-utils@3.0.0-canary.17
513
+
514
+ ## 2.0.0-canary.16
515
+
516
+ ### Patch Changes
517
+
518
+ - Updated dependencies [87b828f]
519
+ - @ai-sdk/provider-utils@3.0.0-canary.16
520
+ - @ai-sdk/openai-compatible@1.0.0-canary.16
521
+
522
+ ## 2.0.0-canary.15
523
+
524
+ ### Patch Changes
525
+
526
+ - Updated dependencies [a571d6e]
527
+ - Updated dependencies [a8c8bd5]
528
+ - Updated dependencies [7979f7f]
529
+ - Updated dependencies [41fa418]
530
+ - @ai-sdk/provider-utils@3.0.0-canary.15
531
+ - @ai-sdk/provider@2.0.0-canary.14
532
+ - @ai-sdk/openai-compatible@1.0.0-canary.15
533
+
534
+ ## 2.0.0-canary.14
535
+
536
+ ### Patch Changes
537
+
538
+ - Updated dependencies [957b739]
539
+ - Updated dependencies [9bd5ab5]
540
+ - @ai-sdk/provider-utils@3.0.0-canary.14
541
+ - @ai-sdk/provider@2.0.0-canary.13
542
+ - @ai-sdk/openai-compatible@1.0.0-canary.14
543
+
544
+ ## 2.0.0-canary.13
545
+
546
+ ### Patch Changes
547
+
548
+ - Updated dependencies [7b3ae3f]
549
+ - Updated dependencies [d9209ca]
550
+ - Updated dependencies [0ff02bb]
551
+ - @ai-sdk/provider@2.0.0-canary.12
552
+ - @ai-sdk/openai-compatible@1.0.0-canary.13
553
+ - @ai-sdk/provider-utils@3.0.0-canary.13
554
+
555
+ ## 2.0.0-canary.12
556
+
557
+ ### Patch Changes
558
+
559
+ - Updated dependencies [9bf7291]
560
+ - Updated dependencies [4617fab]
561
+ - Updated dependencies [e030615]
562
+ - @ai-sdk/provider@2.0.0-canary.11
563
+ - @ai-sdk/openai-compatible@1.0.0-canary.12
564
+ - @ai-sdk/provider-utils@3.0.0-canary.12
565
+
566
+ ## 2.0.0-canary.11
567
+
568
+ ### Patch Changes
569
+
570
+ - 9301f86: refactor (image-model): rename `ImageModelV1` to `ImageModelV2`
571
+ - Updated dependencies [db72adc]
572
+ - Updated dependencies [42e32b0]
573
+ - Updated dependencies [66962ed]
574
+ - Updated dependencies [9301f86]
575
+ - Updated dependencies [a3f768e]
576
+ - @ai-sdk/openai-compatible@1.0.0-canary.11
577
+ - @ai-sdk/provider-utils@3.0.0-canary.11
578
+ - @ai-sdk/provider@2.0.0-canary.10
579
+
580
+ ## 2.0.0-canary.10
581
+
582
+ ### Patch Changes
583
+
584
+ - cf8280e: fix(providers/xai): return actual usage when streaming instead of NaN
585
+ - Updated dependencies [cf8280e]
586
+ - Updated dependencies [e86be6f]
587
+ - @ai-sdk/openai-compatible@1.0.0-canary.10
588
+ - @ai-sdk/provider@2.0.0-canary.9
589
+ - @ai-sdk/provider-utils@3.0.0-canary.10
590
+
3
591
  ## 2.0.0-canary.9
4
592
 
5
593
  ### Patch Changes
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # AI SDK - xAI Grok Provider
2
2
 
3
- The **[xAI Grok provider](https://sdk.vercel.ai/providers/ai-sdk-providers/xai)** for the [AI SDK](https://sdk.vercel.ai/docs)
3
+ The **[xAI Grok provider](https://ai-sdk.dev/providers/ai-sdk-providers/xai)** for the [AI SDK](https://ai-sdk.dev/docs)
4
4
  contains language model support for the xAI chat and completion APIs.
5
5
 
6
6
  ## Setup
@@ -33,4 +33,4 @@ const { text } = await generateText({
33
33
 
34
34
  ## Documentation
35
35
 
36
- Please check out the **[xAI Grok provider documentation](https://sdk.vercel.ai/providers/ai-sdk-providers/xai)** for more information.
36
+ Please check out the **[xAI Grok provider documentation](https://ai-sdk.dev/providers/ai-sdk-providers/xai)** for more information.
package/dist/index.d.mts CHANGED
@@ -1,16 +1,56 @@
1
- import { ProviderV2, LanguageModelV2, ImageModelV1 } from '@ai-sdk/provider';
1
+ import { z } from 'zod/v4';
2
+ import { ProviderV2, LanguageModelV2, ImageModelV2 } from '@ai-sdk/provider';
2
3
  import { FetchFunction } from '@ai-sdk/provider-utils';
3
- import { z } from 'zod';
4
4
 
5
- type XaiChatModelId = 'grok-3' | 'grok-3-latest' | 'grok-3-fast' | 'grok-3-fast-latest' | 'grok-3-mini' | 'grok-3-mini-latest' | 'grok-3-mini-fast' | 'grok-3-mini-fast-latest' | 'grok-2-vision-1212' | 'grok-2-vision' | 'grok-2-vision-latest' | 'grok-2-image-1212' | 'grok-2-image' | 'grok-2-image-latest' | 'grok-2-1212' | 'grok-2' | 'grok-2-latest' | 'grok-vision-beta' | 'grok-beta' | (string & {});
5
+ type XaiChatModelId = 'grok-4' | 'grok-4-0709' | 'grok-4-latest' | 'grok-3' | 'grok-3-latest' | 'grok-3-fast' | 'grok-3-fast-latest' | 'grok-3-mini' | 'grok-3-mini-latest' | 'grok-3-mini-fast' | 'grok-3-mini-fast-latest' | 'grok-2-vision-1212' | 'grok-2-vision' | 'grok-2-vision-latest' | 'grok-2-image-1212' | 'grok-2-image' | 'grok-2-image-latest' | 'grok-2-1212' | 'grok-2' | 'grok-2-latest' | 'grok-vision-beta' | 'grok-beta' | (string & {});
6
+ declare const xaiProviderOptions: z.ZodObject<{
7
+ reasoningEffort: z.ZodOptional<z.ZodEnum<{
8
+ low: "low";
9
+ high: "high";
10
+ }>>;
11
+ searchParameters: z.ZodOptional<z.ZodObject<{
12
+ mode: z.ZodEnum<{
13
+ off: "off";
14
+ auto: "auto";
15
+ on: "on";
16
+ }>;
17
+ returnCitations: z.ZodOptional<z.ZodBoolean>;
18
+ fromDate: z.ZodOptional<z.ZodString>;
19
+ toDate: z.ZodOptional<z.ZodString>;
20
+ maxSearchResults: z.ZodOptional<z.ZodNumber>;
21
+ sources: z.ZodOptional<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
22
+ type: z.ZodLiteral<"web">;
23
+ country: z.ZodOptional<z.ZodString>;
24
+ excludedWebsites: z.ZodOptional<z.ZodArray<z.ZodString>>;
25
+ allowedWebsites: z.ZodOptional<z.ZodArray<z.ZodString>>;
26
+ safeSearch: z.ZodOptional<z.ZodBoolean>;
27
+ }, z.core.$strip>, z.ZodObject<{
28
+ type: z.ZodLiteral<"x">;
29
+ xHandles: z.ZodOptional<z.ZodArray<z.ZodString>>;
30
+ }, z.core.$strip>, z.ZodObject<{
31
+ type: z.ZodLiteral<"news">;
32
+ country: z.ZodOptional<z.ZodString>;
33
+ excludedWebsites: z.ZodOptional<z.ZodArray<z.ZodString>>;
34
+ safeSearch: z.ZodOptional<z.ZodBoolean>;
35
+ }, z.core.$strip>, z.ZodObject<{
36
+ type: z.ZodLiteral<"rss">;
37
+ links: z.ZodArray<z.ZodString>;
38
+ }, z.core.$strip>]>>>;
39
+ }, z.core.$strip>>;
40
+ }, z.core.$strip>;
41
+ type XaiProviderOptions = z.infer<typeof xaiProviderOptions>;
42
+
43
+ declare const xaiErrorDataSchema: z.ZodObject<{
44
+ error: z.ZodObject<{
45
+ message: z.ZodString;
46
+ type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
47
+ param: z.ZodOptional<z.ZodNullable<z.ZodAny>>;
48
+ code: z.ZodOptional<z.ZodNullable<z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>>>;
49
+ }, z.core.$strip>;
50
+ }, z.core.$strip>;
51
+ type XaiErrorData = z.infer<typeof xaiErrorDataSchema>;
6
52
 
7
53
  type XaiImageModelId = 'grok-2-image' | (string & {});
8
- interface XaiImageSettings {
9
- /**
10
- Override the maximum number of images per call. Default is 10.
11
- */
12
- maxImagesPerCall?: number;
13
- }
14
54
 
15
55
  interface XaiProvider extends ProviderV2 {
16
56
  /**
@@ -28,11 +68,11 @@ interface XaiProvider extends ProviderV2 {
28
68
  /**
29
69
  Creates an Xai image model for image generation.
30
70
  */
31
- image(modelId: XaiImageModelId, settings?: XaiImageSettings): ImageModelV1;
71
+ image(modelId: XaiImageModelId): ImageModelV2;
32
72
  /**
33
73
  Creates an Xai image model for image generation.
34
74
  */
35
- imageModel(modelId: XaiImageModelId, settings?: XaiImageSettings): ImageModelV1;
75
+ imageModel(modelId: XaiImageModelId): ImageModelV2;
36
76
  }
37
77
  interface XaiProviderSettings {
38
78
  /**
@@ -56,16 +96,4 @@ interface XaiProviderSettings {
56
96
  declare function createXai(options?: XaiProviderSettings): XaiProvider;
57
97
  declare const xai: XaiProvider;
58
98
 
59
- declare const xaiErrorSchema: z.ZodObject<{
60
- code: z.ZodString;
61
- error: z.ZodString;
62
- }, "strip", z.ZodTypeAny, {
63
- code: string;
64
- error: string;
65
- }, {
66
- code: string;
67
- error: string;
68
- }>;
69
- type XaiErrorData = z.infer<typeof xaiErrorSchema>;
70
-
71
- export { type XaiErrorData, type XaiProvider, type XaiProviderSettings, createXai, xai };
99
+ export { type XaiErrorData, type XaiProvider, type XaiProviderOptions, type XaiProviderSettings, createXai, xai };