@ai-sdk/xai 4.0.3 → 4.0.4
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 +8 -0
- package/dist/index.js +1 -1
- package/docs/01-xai.mdx +7 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
package/dist/index.js
CHANGED
package/docs/01-xai.mdx
CHANGED
|
@@ -79,7 +79,12 @@ first argument is the model id, e.g. `grok-4.20-non-reasoning`.
|
|
|
79
79
|
const model = xai('grok-4.20-non-reasoning');
|
|
80
80
|
```
|
|
81
81
|
|
|
82
|
-
|
|
82
|
+
<Note>
|
|
83
|
+
Since AI SDK 7, `xai(modelId)` uses the xAI Responses API by default. To use
|
|
84
|
+
the [Chat Completions
|
|
85
|
+
API](https://docs.x.ai/docs/api-reference#chat-completions) (legacy), use
|
|
86
|
+
`xai.chat(modelId)`.
|
|
87
|
+
</Note>
|
|
83
88
|
|
|
84
89
|
### Example
|
|
85
90
|
|
|
@@ -165,7 +170,7 @@ calling pattern.
|
|
|
165
170
|
|
|
166
171
|
## Responses API (Agentic Tools)
|
|
167
172
|
|
|
168
|
-
The xAI Responses API is the default when using `xai(modelId)
|
|
173
|
+
The xAI Responses API is the default when using `xai(modelId)` (since AI SDK 7). You can also use `xai.responses(modelId)` explicitly. This enables the model to autonomously orchestrate tool calls and research on xAI's servers.
|
|
169
174
|
|
|
170
175
|
```ts
|
|
171
176
|
const model = xai.responses('grok-4.20-non-reasoning');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/xai",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
}
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@ai-sdk/openai-compatible": "3.0.
|
|
32
|
+
"@ai-sdk/openai-compatible": "3.0.3",
|
|
33
33
|
"@ai-sdk/provider": "4.0.1",
|
|
34
|
-
"@ai-sdk/provider-utils": "5.0.
|
|
34
|
+
"@ai-sdk/provider-utils": "5.0.3"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"@types/node": "22.19.19",
|