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