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