@ai-sdk/xai 4.0.0-beta.7 → 4.0.0-beta.76

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.
Files changed (51) hide show
  1. package/CHANGELOG.md +669 -9
  2. package/README.md +2 -0
  3. package/dist/index.d.ts +213 -68
  4. package/dist/index.js +2074 -781
  5. package/dist/index.js.map +1 -1
  6. package/docs/01-xai.mdx +445 -54
  7. package/package.json +15 -15
  8. package/src/convert-to-xai-chat-messages.ts +48 -27
  9. package/src/convert-xai-chat-usage.ts +3 -3
  10. package/src/files/xai-files-api.ts +16 -0
  11. package/src/files/xai-files-options.ts +19 -0
  12. package/src/files/xai-files.ts +94 -0
  13. package/src/index.ts +9 -4
  14. package/src/map-xai-finish-reason.ts +2 -2
  15. package/src/realtime/index.ts +2 -0
  16. package/src/realtime/xai-realtime-event-mapper.ts +399 -0
  17. package/src/realtime/xai-realtime-model-options.ts +3 -0
  18. package/src/realtime/xai-realtime-model.ts +101 -0
  19. package/src/remove-additional-properties.ts +24 -0
  20. package/src/responses/convert-to-xai-responses-input.ts +100 -23
  21. package/src/responses/convert-xai-responses-usage.ts +3 -3
  22. package/src/responses/map-xai-responses-finish-reason.ts +3 -2
  23. package/src/responses/xai-responses-api.ts +31 -1
  24. package/src/responses/{xai-responses-options.ts → xai-responses-language-model-options.ts} +12 -7
  25. package/src/responses/xai-responses-language-model.ts +157 -60
  26. package/src/responses/xai-responses-prepare-tools.ts +10 -8
  27. package/src/tool/code-execution.ts +2 -2
  28. package/src/tool/file-search.ts +2 -2
  29. package/src/tool/mcp-server.ts +2 -2
  30. package/src/tool/view-image.ts +2 -2
  31. package/src/tool/view-x-video.ts +2 -2
  32. package/src/tool/web-search.ts +4 -2
  33. package/src/tool/x-search.ts +2 -2
  34. package/src/{xai-chat-options.ts → xai-chat-language-model-options.ts} +28 -13
  35. package/src/xai-chat-language-model.ts +65 -29
  36. package/src/xai-chat-prompt.ts +2 -1
  37. package/src/xai-error.ts +13 -3
  38. package/src/xai-image-model.ts +28 -11
  39. package/src/xai-prepare-tools.ts +9 -8
  40. package/src/xai-provider.ts +115 -19
  41. package/src/xai-speech-model-options.ts +55 -0
  42. package/src/xai-speech-model.ts +167 -0
  43. package/src/xai-transcription-model-options.ts +70 -0
  44. package/src/xai-transcription-model.ts +166 -0
  45. package/src/xai-video-model-options.ts +145 -0
  46. package/src/xai-video-model.ts +129 -22
  47. package/dist/index.d.mts +0 -377
  48. package/dist/index.mjs +0 -3070
  49. package/dist/index.mjs.map +0 -1
  50. package/src/xai-video-options.ts +0 -23
  51. /package/src/{xai-image-options.ts → xai-image-model-options.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,666 @@
1
1
  # @ai-sdk/xai
2
2
 
3
+ ## 4.0.0-beta.76
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [0416e3e]
8
+ - @ai-sdk/provider@4.0.0-beta.20
9
+ - @ai-sdk/openai-compatible@3.0.0-beta.58
10
+ - @ai-sdk/provider-utils@5.0.0-beta.50
11
+
12
+ ## 4.0.0-beta.75
13
+
14
+ ### Patch Changes
15
+
16
+ - b8396f0: trigger initial beta release
17
+ - Updated dependencies [b8396f0]
18
+ - @ai-sdk/openai-compatible@3.0.0-beta.57
19
+ - @ai-sdk/provider-utils@5.0.0-beta.49
20
+ - @ai-sdk/provider@4.0.0-beta.19
21
+
22
+ ## 4.0.0-canary.74
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies [aeda373]
27
+ - Updated dependencies [375fdd7]
28
+ - Updated dependencies [b4507d5]
29
+ - @ai-sdk/provider-utils@5.0.0-canary.48
30
+ - @ai-sdk/openai-compatible@3.0.0-canary.56
31
+
32
+ ## 4.0.0-canary.73
33
+
34
+ ### Patch Changes
35
+
36
+ - Updated dependencies [bae5e2b]
37
+ - @ai-sdk/provider-utils@5.0.0-canary.47
38
+ - @ai-sdk/openai-compatible@3.0.0-canary.55
39
+
40
+ ## 4.0.0-canary.72
41
+
42
+ ### Patch Changes
43
+
44
+ - 7486744: Add xAI speech-to-text transcription support.
45
+ - 7486744: feat(provider/xai): add text-to-speech support
46
+
47
+ ## 4.0.0-canary.71
48
+
49
+ ### Patch Changes
50
+
51
+ - ce769dd: feat(provider): add experimental Realtime API support for voice conversations
52
+
53
+ Adds first-class support for realtime (speech-to-speech) APIs:
54
+
55
+ - `Experimental_RealtimeModelV4` spec in `@ai-sdk/provider` with normalized event types and factory
56
+ - OpenAI, Google, and xAI realtime provider implementations
57
+ - `openai.experimental_realtime()` / `google.experimental_realtime()` / `xai.experimental_realtime()` work in both server and browser
58
+ - `.getToken()` static method on each provider for server-side ephemeral token creation
59
+ - `experimental_getRealtimeToolDefinitions` helper for provider session tool definitions
60
+ - `experimental_useRealtime` hook in `@ai-sdk/react` returning `UIMessage[]` (aligned with `useChat`), with `onToolCall` and `addToolOutput` for client-driven tool execution
61
+ - `inputAudioTranscription` session config for showing transcribed user audio messages when supported by the provider
62
+
63
+ - Updated dependencies [ce769dd]
64
+ - @ai-sdk/provider@4.0.0-canary.18
65
+ - @ai-sdk/openai-compatible@3.0.0-canary.54
66
+ - @ai-sdk/provider-utils@5.0.0-canary.46
67
+
68
+ ## 4.0.0-canary.70
69
+
70
+ ### Patch Changes
71
+
72
+ - Updated dependencies [ee798eb]
73
+ - Updated dependencies [daf6637]
74
+ - @ai-sdk/provider-utils@5.0.0-canary.45
75
+ - @ai-sdk/openai-compatible@3.0.0-canary.53
76
+
77
+ ## 4.0.0-canary.69
78
+
79
+ ### Patch Changes
80
+
81
+ - 23f9d72: deprecate searchParameters (xai live search) in favor of web_search/x_search agent tools
82
+ - 1dbecd7: feat(provider/xai): add `enableImageSearch` to the xAI Web Search tool
83
+
84
+ The xAI Responses API supports `enable_image_search` on Web Search tools. `xai.tools.webSearch()` now accepts `enableImageSearch` and sends it through to the API as `enable_image_search`.
85
+
86
+ ## 4.0.0-canary.68
87
+
88
+ ### Patch Changes
89
+
90
+ - Updated dependencies [6c93e36]
91
+ - Updated dependencies [f617ac2]
92
+ - @ai-sdk/provider-utils@5.0.0-canary.44
93
+ - @ai-sdk/openai-compatible@3.0.0-canary.52
94
+
95
+ ## 4.0.0-canary.67
96
+
97
+ ### Patch Changes
98
+
99
+ - Updated dependencies [9f1e1ba]
100
+ - @ai-sdk/openai-compatible@3.0.0-canary.51
101
+
102
+ ## 4.0.0-canary.66
103
+
104
+ ### Patch Changes
105
+
106
+ - 7fc6bd6: Raise minimum supported Node.js version to 22. Supported versions: 22, 24, and 26.
107
+ - Updated dependencies [7fc6bd6]
108
+ - @ai-sdk/openai-compatible@3.0.0-canary.50
109
+ - @ai-sdk/provider-utils@5.0.0-canary.43
110
+ - @ai-sdk/provider@4.0.0-canary.17
111
+
112
+ ## 4.0.0-canary.65
113
+
114
+ ### Patch Changes
115
+
116
+ - Updated dependencies [a6617c5]
117
+ - @ai-sdk/provider-utils@5.0.0-canary.42
118
+ - @ai-sdk/openai-compatible@3.0.0-canary.49
119
+
120
+ ## 4.0.0-canary.64
121
+
122
+ ### Patch Changes
123
+
124
+ - 2dc2a52: fix reasoning-start dedupe on multi-summary-part responses to prevent xai 400 on continuation requests
125
+ - 1293885: surface full xai error detail in APICallError.message instead of falling back to http status text
126
+
127
+ ## 4.0.0-canary.63
128
+
129
+ ### Patch Changes
130
+
131
+ - Updated dependencies [28dfa06]
132
+ - Updated dependencies [e93fa91]
133
+ - @ai-sdk/provider-utils@5.0.0-canary.41
134
+ - @ai-sdk/openai-compatible@3.0.0-canary.48
135
+
136
+ ## 4.0.0-canary.62
137
+
138
+ ### Patch Changes
139
+
140
+ - 85735d8: fix(xai): stop emitting additionalProperties flag
141
+
142
+ ## 4.0.0-canary.61
143
+
144
+ ### Patch Changes
145
+
146
+ - 80e1702: feat(xai): support `'none'` and `'medium'` reasoning effort for `grok-4.3`,
147
+ and curate the model ID autocomplete list
148
+
149
+ `grok-4.3` accepts `reasoning_effort` of `"none" | "low" | "medium" | "high"`,
150
+ where `"none"` disables reasoning entirely (no thinking tokens) and `"medium"`
151
+ provides more thinking for less-latency-sensitive applications.
152
+
153
+ - Adds `'none'` to the allowed values for `providerOptions.xai.reasoningEffort`
154
+ on both the chat (`xai()`) and responses (`xai.responses()`) language models.
155
+ - Adds `'medium'` to the chat model's `reasoningEffort` enum (the responses
156
+ model already supported it).
157
+ - Top-level `reasoning: 'medium'` now maps to `reasoning_effort: 'medium'` for
158
+ the chat model (previously it was coerced to `'low'` because `'medium'` was
159
+ not a valid value).
160
+
161
+ In addition, the `XaiChatModelId` and `XaiResponsesModelId` autocomplete unions
162
+ have been trimmed to xAI's current model lineup
163
+ ([docs](https://docs.x.ai/docs/models)):
164
+
165
+ - `grok-4.20-non-reasoning`
166
+ - `grok-4.20-reasoning`
167
+ - `grok-4.3`
168
+ - `grok-latest`
169
+
170
+ Older entries (`grok-3*`, `grok-4`, `grok-4-0709`, `grok-4-latest`,
171
+ `grok-4-1-fast-*`, `grok-4-fast-*`, `grok-code-fast-1`, and
172
+ `grok-4.20-multi-agent-0309`) have been removed from the autocomplete list.
173
+ This is **not** a runtime change — the model ID type is still open
174
+ (`(string & {})`), so passing any model ID that the xAI API accepts continues
175
+ to work; only IDE autocomplete is affected.
176
+
177
+ ```ts
178
+ import { xai } from "@ai-sdk/xai";
179
+ import { generateText } from "ai";
180
+
181
+ await generateText({
182
+ model: xai("grok-4.3"),
183
+ prompt: "Hi",
184
+ providerOptions: {
185
+ xai: { reasoningEffort: "none" },
186
+ },
187
+ });
188
+ ```
189
+
190
+ ## 4.0.0-canary.60
191
+
192
+ ### Patch Changes
193
+
194
+ - Updated dependencies [a7de9c9]
195
+ - @ai-sdk/provider-utils@5.0.0-canary.40
196
+ - @ai-sdk/openai-compatible@3.0.0-canary.47
197
+
198
+ ## 4.0.0-canary.59
199
+
200
+ ### Patch Changes
201
+
202
+ - Updated dependencies [105f95b]
203
+ - @ai-sdk/provider-utils@5.0.0-canary.39
204
+ - @ai-sdk/openai-compatible@3.0.0-canary.46
205
+
206
+ ## 4.0.0-canary.58
207
+
208
+ ### Patch Changes
209
+
210
+ - Updated dependencies [ca446f8]
211
+ - @ai-sdk/provider-utils@5.0.0-canary.38
212
+ - @ai-sdk/openai-compatible@3.0.0-canary.45
213
+
214
+ ## 4.0.0-canary.57
215
+
216
+ ### Patch Changes
217
+
218
+ - Updated dependencies [d848405]
219
+ - @ai-sdk/provider-utils@5.0.0-canary.37
220
+ - @ai-sdk/openai-compatible@3.0.0-canary.44
221
+
222
+ ## 4.0.0-canary.56
223
+
224
+ ### Patch Changes
225
+
226
+ - Updated dependencies [ca39020]
227
+ - @ai-sdk/provider-utils@5.0.0-canary.36
228
+ - @ai-sdk/openai-compatible@3.0.0-canary.43
229
+
230
+ ## 4.0.0-canary.55
231
+
232
+ ### Patch Changes
233
+
234
+ - Updated dependencies [f634bac]
235
+ - @ai-sdk/provider-utils@5.0.0-canary.35
236
+ - @ai-sdk/openai-compatible@3.0.0-canary.42
237
+
238
+ ## 4.0.0-canary.54
239
+
240
+ ### Patch Changes
241
+
242
+ - Updated dependencies [69254e0]
243
+ - Updated dependencies [3015fc3]
244
+ - @ai-sdk/provider-utils@5.0.0-canary.34
245
+ - @ai-sdk/openai-compatible@3.0.0-canary.41
246
+
247
+ ## 4.0.0-canary.53
248
+
249
+ ### Patch Changes
250
+
251
+ - Updated dependencies [2427d88]
252
+ - @ai-sdk/provider-utils@5.0.0-canary.33
253
+ - @ai-sdk/openai-compatible@3.0.0-canary.40
254
+
255
+ ## 4.0.0-canary.52
256
+
257
+ ### Patch Changes
258
+
259
+ - Updated dependencies [5463d0d]
260
+ - @ai-sdk/provider-utils@5.0.0-canary.32
261
+ - @ai-sdk/provider@4.0.0-canary.16
262
+ - @ai-sdk/openai-compatible@3.0.0-canary.39
263
+
264
+ ## 4.0.0-canary.51
265
+
266
+ ### Patch Changes
267
+
268
+ - Updated dependencies [cd9c311]
269
+ - @ai-sdk/openai-compatible@3.0.0-canary.38
270
+
271
+ ## 4.0.0-canary.50
272
+
273
+ ### Patch Changes
274
+
275
+ - 0c4c275: trigger initial canary release
276
+ - Updated dependencies [0c4c275]
277
+ - @ai-sdk/openai-compatible@3.0.0-canary.37
278
+ - @ai-sdk/provider-utils@5.0.0-canary.31
279
+ - @ai-sdk/provider@4.0.0-canary.15
280
+
281
+ ## 4.0.0-beta.49
282
+
283
+ ### Patch Changes
284
+
285
+ - Updated dependencies [e59c955]
286
+ - @ai-sdk/openai-compatible@3.0.0-beta.36
287
+
288
+ ## 4.0.0-beta.48
289
+
290
+ ### Major Changes
291
+
292
+ - 04e9009: chore: make provider implementations code patterns more consistent, including renaming certain exported symbols
293
+
294
+ For all externally exported symbols that were renamed, the old names continue to work via deprecated aliases.
295
+
296
+ ### Patch Changes
297
+
298
+ - Updated dependencies [08d2129]
299
+ - Updated dependencies [04e9009]
300
+ - @ai-sdk/provider-utils@5.0.0-beta.30
301
+ - @ai-sdk/openai-compatible@3.0.0-beta.35
302
+
303
+ ## 4.0.0-beta.47
304
+
305
+ ### Patch Changes
306
+
307
+ - 9bd6512: feat(provider): change file part data property to be tagged with a type and remove the image part type
308
+ - 258c093: chore: ensure consistent import handling and avoid import duplicates or cycles
309
+ - Updated dependencies [9bd6512]
310
+ - Updated dependencies [258c093]
311
+ - Updated dependencies [b6783da]
312
+ - @ai-sdk/openai-compatible@3.0.0-beta.34
313
+ - @ai-sdk/provider-utils@5.0.0-beta.29
314
+ - @ai-sdk/provider@4.0.0-beta.14
315
+
316
+ ## 4.0.0-beta.46
317
+
318
+ ### Patch Changes
319
+
320
+ - 78b6433: feat(provider/xai): support non-image file parts (PDF, text, CSV) in the Responses API via `input_file` + `file_url`
321
+
322
+ The xAI Responses API accepts `{ type: 'input_file', file_url }` for non-image documents (see https://docs.x.ai/docs/guides/chat-with-files), but the AI SDK xAI Responses provider previously threw `UnsupportedFunctionalityError` for any file part whose `mediaType` did not start with `image/`.
323
+
324
+ When a file part is passed with `data: URL` and a non-image media type, the provider now emits `{ type: 'input_file', file_url }`. `application/pdf` and `text/*` are also added to `supportedUrls` so the SDK does not download them to bytes before reaching the converter.
325
+
326
+ Inline-byte (base64) inputs for non-image media types continue to throw, since xAI's Responses API requires either a public URL or a pre-uploaded `file_id` for non-image documents.
327
+
328
+ ## 4.0.0-beta.45
329
+
330
+ ### Patch Changes
331
+
332
+ - 9f0e36c: trigger release for all packages after provenance setup
333
+ - Updated dependencies [9f0e36c]
334
+ - @ai-sdk/openai-compatible@3.0.0-beta.33
335
+ - @ai-sdk/provider@4.0.0-beta.13
336
+ - @ai-sdk/provider-utils@5.0.0-beta.28
337
+
338
+ ## 4.0.0-beta.44
339
+
340
+ ### Patch Changes
341
+
342
+ - 58a2ad7: fix: more precise default message for tool execution denial
343
+ - Updated dependencies [ab81968]
344
+ - Updated dependencies [785fe16]
345
+ - Updated dependencies [67df0a0]
346
+ - Updated dependencies [befb78c]
347
+ - Updated dependencies [0458559]
348
+ - Updated dependencies [58a2ad7]
349
+ - Updated dependencies [5852c0a]
350
+ - Updated dependencies [fc92055]
351
+ - @ai-sdk/openai-compatible@3.0.0-beta.32
352
+ - @ai-sdk/provider-utils@5.0.0-beta.27
353
+
354
+ ## 4.0.0-beta.43
355
+
356
+ ### Patch Changes
357
+
358
+ - a0b0a0c: expose costInUsdTicks in responses provider metadata
359
+ - Updated dependencies [2e98477]
360
+ - Updated dependencies [bfb756d]
361
+ - @ai-sdk/provider-utils@5.0.0-beta.26
362
+ - @ai-sdk/openai-compatible@3.0.0-beta.31
363
+
364
+ ## 4.0.0-beta.42
365
+
366
+ ### Patch Changes
367
+
368
+ - Updated dependencies [eea8d98]
369
+ - @ai-sdk/provider-utils@5.0.0-beta.25
370
+ - @ai-sdk/openai-compatible@3.0.0-beta.30
371
+
372
+ ## 4.0.0-beta.41
373
+
374
+ ### Patch Changes
375
+
376
+ - Updated dependencies [f807e45]
377
+ - @ai-sdk/provider-utils@5.0.0-beta.24
378
+ - @ai-sdk/openai-compatible@3.0.0-beta.29
379
+
380
+ ## 4.0.0-beta.40
381
+
382
+ ### Patch Changes
383
+
384
+ - Updated dependencies [350ea38]
385
+ - @ai-sdk/provider-utils@5.0.0-beta.23
386
+ - @ai-sdk/openai-compatible@3.0.0-beta.28
387
+
388
+ ## 4.0.0-beta.39
389
+
390
+ ### Patch Changes
391
+
392
+ - Updated dependencies [083947b]
393
+ - @ai-sdk/provider-utils@5.0.0-beta.22
394
+ - @ai-sdk/openai-compatible@3.0.0-beta.27
395
+
396
+ ## 4.0.0-beta.38
397
+
398
+ ### Patch Changes
399
+
400
+ - Updated dependencies [add1126]
401
+ - @ai-sdk/provider-utils@5.0.0-beta.21
402
+ - @ai-sdk/openai-compatible@3.0.0-beta.26
403
+
404
+ ## 4.0.0-beta.37
405
+
406
+ ### Patch Changes
407
+
408
+ - 8d87577: fix(xai): support encrypted reasoning round-trip for ZDR
409
+
410
+ ## 4.0.0-beta.36
411
+
412
+ ### Patch Changes
413
+
414
+ - b3976a2: Add workflow serialization support to all provider models.
415
+
416
+ **`@ai-sdk/provider-utils`:** New `serializeModel()` helper that extracts only serializable properties from a model instance, filtering out functions and objects containing functions. Third-party provider authors can use this to add workflow support to their own models.
417
+
418
+ **All providers:** `headers` is now optional in provider config types. This is non-breaking — existing code that passes `headers` continues to work. Custom provider implementations that construct model configs manually can now omit `headers`, which is useful when models are deserialized from a workflow step boundary where auth is provided separately.
419
+
420
+ All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
421
+
422
+ - Updated dependencies [b3976a2]
423
+ - Updated dependencies [ff5eba1]
424
+ - @ai-sdk/provider-utils@5.0.0-beta.20
425
+ - @ai-sdk/openai-compatible@3.0.0-beta.25
426
+ - @ai-sdk/provider@4.0.0-beta.12
427
+
428
+ ## 4.0.0-beta.35
429
+
430
+ ### Major Changes
431
+
432
+ - ef992f8: Remove CommonJS exports from all packages. All packages are now ESM-only (`"type": "module"`). Consumers using `require()` must switch to ESM `import` syntax.
433
+
434
+ ### Patch Changes
435
+
436
+ - Updated dependencies [ef992f8]
437
+ - @ai-sdk/openai-compatible@3.0.0-beta.24
438
+ - @ai-sdk/provider@4.0.0-beta.11
439
+ - @ai-sdk/provider-utils@5.0.0-beta.19
440
+
441
+ ## 4.0.0-beta.34
442
+
443
+ ### Patch Changes
444
+
445
+ - 90e2d8a: chore: fix unused vars not being flagged by our lint tooling
446
+ - Updated dependencies [90e2d8a]
447
+ - @ai-sdk/openai-compatible@3.0.0-beta.23
448
+ - @ai-sdk/provider-utils@5.0.0-beta.18
449
+
450
+ ## 4.0.0-beta.33
451
+
452
+ ### Patch Changes
453
+
454
+ - Updated dependencies [3ae1786]
455
+ - @ai-sdk/provider-utils@5.0.0-beta.17
456
+ - @ai-sdk/openai-compatible@3.0.0-beta.22
457
+
458
+ ## 4.0.0-beta.32
459
+
460
+ ### Patch Changes
461
+
462
+ - Updated dependencies [176466a]
463
+ - @ai-sdk/provider@4.0.0-beta.10
464
+ - @ai-sdk/openai-compatible@3.0.0-beta.21
465
+ - @ai-sdk/provider-utils@5.0.0-beta.16
466
+
467
+ ## 4.0.0-beta.31
468
+
469
+ ### Patch Changes
470
+
471
+ - Updated dependencies [e311194]
472
+ - @ai-sdk/provider@4.0.0-beta.9
473
+ - @ai-sdk/openai-compatible@3.0.0-beta.20
474
+ - @ai-sdk/provider-utils@5.0.0-beta.15
475
+
476
+ ## 4.0.0-beta.30
477
+
478
+ ### Patch Changes
479
+
480
+ - e5bdc8d: fix (provider/xai): handle mid-stream error chunks
481
+
482
+ ## 4.0.0-beta.29
483
+
484
+ ### Patch Changes
485
+
486
+ - 813851f: fix (provider/xai): add response.incomplete and response.failed streaming event handling
487
+
488
+ ## 4.0.0-beta.28
489
+
490
+ ### Patch Changes
491
+
492
+ - Updated dependencies [34bd95d]
493
+ - Updated dependencies [008271d]
494
+ - @ai-sdk/provider@4.0.0-beta.8
495
+ - @ai-sdk/openai-compatible@3.0.0-beta.19
496
+ - @ai-sdk/provider-utils@5.0.0-beta.14
497
+
498
+ ## 4.0.0-beta.27
499
+
500
+ ### Patch Changes
501
+
502
+ - Updated dependencies [b0c2869]
503
+ - Updated dependencies [7e26e81]
504
+ - @ai-sdk/provider-utils@5.0.0-beta.13
505
+ - @ai-sdk/openai-compatible@3.0.0-beta.18
506
+
507
+ ## 4.0.0-beta.26
508
+
509
+ ### Patch Changes
510
+
511
+ - Updated dependencies [816ff67]
512
+ - @ai-sdk/openai-compatible@3.0.0-beta.17
513
+
514
+ ## 4.0.0-beta.25
515
+
516
+ ### Patch Changes
517
+
518
+ - Updated dependencies [46d1149]
519
+ - @ai-sdk/provider-utils@5.0.0-beta.12
520
+ - @ai-sdk/openai-compatible@3.0.0-beta.16
521
+
522
+ ## 4.0.0-beta.24
523
+
524
+ ### Patch Changes
525
+
526
+ - Updated dependencies [6fd51c0]
527
+ - @ai-sdk/provider-utils@5.0.0-beta.11
528
+ - @ai-sdk/provider@4.0.0-beta.7
529
+ - @ai-sdk/openai-compatible@3.0.0-beta.15
530
+
531
+ ## 4.0.0-beta.23
532
+
533
+ ### Patch Changes
534
+
535
+ - c29a26f: feat(provider): add support for provider references and uploading files as supported per provider
536
+ - Updated dependencies [c29a26f]
537
+ - @ai-sdk/openai-compatible@3.0.0-beta.14
538
+ - @ai-sdk/provider-utils@5.0.0-beta.10
539
+ - @ai-sdk/provider@4.0.0-beta.6
540
+
541
+ ## 4.0.0-beta.22
542
+
543
+ ### Patch Changes
544
+
545
+ - f51c95e: feat(provider/xai): add video extension and reference-to-video (R2V) support
546
+
547
+ ## 4.0.0-beta.21
548
+
549
+ ### Patch Changes
550
+
551
+ - 38fc777: Add AI Gateway hint to provider READMEs
552
+ - Updated dependencies [38fc777]
553
+ - @ai-sdk/openai-compatible@3.0.0-beta.13
554
+
555
+ ## 4.0.0-beta.20
556
+
557
+ ### Patch Changes
558
+
559
+ - Updated dependencies [2e17091]
560
+ - @ai-sdk/provider-utils@5.0.0-beta.9
561
+ - @ai-sdk/openai-compatible@3.0.0-beta.12
562
+
563
+ ## 4.0.0-beta.19
564
+
565
+ ### Patch Changes
566
+
567
+ - Updated dependencies [986c6fd]
568
+ - Updated dependencies [493295c]
569
+ - @ai-sdk/provider-utils@5.0.0-beta.8
570
+ - @ai-sdk/openai-compatible@3.0.0-beta.11
571
+
572
+ ## 4.0.0-beta.18
573
+
574
+ ### Patch Changes
575
+
576
+ - 9f20868: fix(provider/xai): correct finish reason for tool calls
577
+
578
+ ## 4.0.0-beta.17
579
+
580
+ ### Patch Changes
581
+
582
+ - Updated dependencies [1f509d4]
583
+ - @ai-sdk/provider-utils@5.0.0-beta.7
584
+ - @ai-sdk/provider@4.0.0-beta.5
585
+ - @ai-sdk/openai-compatible@3.0.0-beta.10
586
+
587
+ ## 4.0.0-beta.16
588
+
589
+ ### Patch Changes
590
+
591
+ - 4f91b5d: chore(provider/xai): update Grok 4.20 model IDs to their non-beta versions
592
+
593
+ ## 4.0.0-beta.15
594
+
595
+ ### Patch Changes
596
+
597
+ - 74d520f: feat: migrate providers to support new top-level `reasoning` parameter
598
+ - Updated dependencies [74d520f]
599
+ - @ai-sdk/openai-compatible@3.0.0-beta.9
600
+
601
+ ## 4.0.0-beta.14
602
+
603
+ ### Patch Changes
604
+
605
+ - Updated dependencies [3887c70]
606
+ - @ai-sdk/provider-utils@5.0.0-beta.6
607
+ - @ai-sdk/provider@4.0.0-beta.4
608
+ - @ai-sdk/openai-compatible@3.0.0-beta.8
609
+
610
+ ## 4.0.0-beta.13
611
+
612
+ ### Major Changes
613
+
614
+ - 776b617: feat(provider): adding new 'custom' content type
615
+
616
+ ### Patch Changes
617
+
618
+ - Updated dependencies [776b617]
619
+ - @ai-sdk/provider-utils@5.0.0-beta.5
620
+ - @ai-sdk/provider@4.0.0-beta.3
621
+ - @ai-sdk/openai-compatible@3.0.0-beta.7
622
+
623
+ ## 4.0.0-beta.12
624
+
625
+ ### Patch Changes
626
+
627
+ - d20829e: feat(provider/xai): add moderation error, and costInUsdTicks to video model
628
+ - Updated dependencies [61753c3]
629
+ - @ai-sdk/provider-utils@5.0.0-beta.4
630
+ - @ai-sdk/openai-compatible@3.0.0-beta.6
631
+
632
+ ## 4.0.0-beta.11
633
+
634
+ ### Patch Changes
635
+
636
+ - f7d4f01: feat(provider): add support for `reasoning-file` type for files that are part of reasoning
637
+ - Updated dependencies [f7d4f01]
638
+ - @ai-sdk/provider-utils@5.0.0-beta.3
639
+ - @ai-sdk/provider@4.0.0-beta.2
640
+ - @ai-sdk/openai-compatible@3.0.0-beta.5
641
+
642
+ ## 4.0.0-beta.10
643
+
644
+ ### Patch Changes
645
+
646
+ - Updated dependencies [5c2a5a2]
647
+ - @ai-sdk/provider@4.0.0-beta.1
648
+ - @ai-sdk/openai-compatible@3.0.0-beta.4
649
+ - @ai-sdk/provider-utils@5.0.0-beta.2
650
+
651
+ ## 4.0.0-beta.9
652
+
653
+ ### Patch Changes
654
+
655
+ - Updated dependencies [8f3e1da]
656
+ - @ai-sdk/openai-compatible@3.0.0-beta.3
657
+
658
+ ## 4.0.0-beta.8
659
+
660
+ ### Patch Changes
661
+
662
+ - 4799fa5: chore(provider/xai): update provider to use v4 types
663
+
3
664
  ## 4.0.0-beta.7
4
665
 
5
666
  ### Patch Changes
@@ -255,7 +916,6 @@
255
916
  ### Patch Changes
256
917
 
257
918
  - 05f3f36: Add native `file_search` server-side tool support:
258
-
259
919
  - Add `xai.tools.fileSearch()` for vector store search with `vectorStoreIds` and `maxNumResults` parameters
260
920
  - Add `include` option supporting `file_search_call.results` to get inline search results
261
921
  - Add `file_search_call` handling in language model for both `doGenerate` and `doStream`
@@ -555,13 +1215,13 @@
555
1215
  Before
556
1216
 
557
1217
  ```ts
558
- model.textEmbeddingModel('my-model-id');
1218
+ model.textEmbeddingModel("my-model-id");
559
1219
  ```
560
1220
 
561
1221
  After
562
1222
 
563
1223
  ```ts
564
- model.embeddingModel('my-model-id');
1224
+ model.embeddingModel("my-model-id");
565
1225
  ```
566
1226
 
567
1227
  - 2625a04: feat(openai); update spec for mcp approval
@@ -819,13 +1479,13 @@
819
1479
  Before
820
1480
 
821
1481
  ```ts
822
- model.textEmbeddingModel('my-model-id');
1482
+ model.textEmbeddingModel("my-model-id");
823
1483
  ```
824
1484
 
825
1485
  After
826
1486
 
827
1487
  ```ts
828
- model.embeddingModel('my-model-id');
1488
+ model.embeddingModel("my-model-id");
829
1489
  ```
830
1490
 
831
1491
  - 8514146: add grok-4-1 model IDs
@@ -1368,7 +2028,7 @@
1368
2028
 
1369
2029
  ```js
1370
2030
  await generateImage({
1371
- model: luma.image('photon-flash-1', {
2031
+ model: luma.image("photon-flash-1", {
1372
2032
  maxImagesPerCall: 5,
1373
2033
  pollIntervalMillis: 500,
1374
2034
  }),
@@ -1381,7 +2041,7 @@
1381
2041
 
1382
2042
  ```js
1383
2043
  await generateImage({
1384
- model: luma.image('photon-flash-1'),
2044
+ model: luma.image("photon-flash-1"),
1385
2045
  prompt,
1386
2046
  n: 10,
1387
2047
  maxImagesPerCall: 5,
@@ -1697,7 +2357,7 @@
1697
2357
 
1698
2358
  ```js
1699
2359
  await generateImage({
1700
- model: luma.image('photon-flash-1', {
2360
+ model: luma.image("photon-flash-1", {
1701
2361
  maxImagesPerCall: 5,
1702
2362
  pollIntervalMillis: 500,
1703
2363
  }),
@@ -1710,7 +2370,7 @@
1710
2370
 
1711
2371
  ```js
1712
2372
  await generateImage({
1713
- model: luma.image('photon-flash-1'),
2373
+ model: luma.image("photon-flash-1"),
1714
2374
  prompt,
1715
2375
  n: 10,
1716
2376
  maxImagesPerCall: 5,