@ai-sdk/xai 4.0.36 → 4.0.37
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 +6 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +8 -6
- package/dist/index.js.map +1 -1
- package/docs/01-xai.mdx +10 -5
- package/package.json +3 -3
- package/src/responses/xai-responses-language-model-options.ts +6 -2
- package/src/responses/xai-responses-language-model.ts +1 -1
- package/src/xai-chat-language-model-options.ts +5 -1
- package/src/xai-chat-language-model.ts +1 -1
package/docs/01-xai.mdx
CHANGED
|
@@ -121,16 +121,20 @@ The AI SDK option accepts these values, but each xAI model supports a subset:
|
|
|
121
121
|
- `'high'` — More reasoning tokens for deeper thinking. Suited for very
|
|
122
122
|
challenging problems, complex math, multi-step logic, and competition-level
|
|
123
123
|
tasks.
|
|
124
|
+
- `'xhigh'` — Uses the most reasoning tokens for the most challenging tasks.
|
|
125
|
+
This level is only supported by `grok-4.6`.
|
|
124
126
|
|
|
125
127
|
<Note>
|
|
126
128
|
Support and defaults are model-specific. `grok-4.3` supports `'none'`,
|
|
127
129
|
`'low'`, `'medium'`, and `'high'`. `grok-4.5` supports `'low'`, `'medium'`,
|
|
128
|
-
and `'high'`, defaults to `'high'`, and cannot disable reasoning.
|
|
129
|
-
`
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
and `'high'`, defaults to `'high'`, and cannot disable reasoning. `grok-4.6`
|
|
131
|
+
supports `'low'`, `'medium'`, `'high'`, and `'xhigh'`, and defaults to
|
|
132
|
+
`'high'`. The `grok-4.20-reasoning` and `grok-4.20-non-reasoning` variants do
|
|
133
|
+
not accept this option. For `grok-4.20-multi-agent`, `'low'`, `'medium'`, and
|
|
134
|
+
`'high'` control the number of agents instead of reasoning depth. See xAI's
|
|
135
|
+
[reasoning
|
|
132
136
|
docs](https://docs.x.ai/developers/model-capabilities/text/reasoning) and
|
|
133
|
-
[Grok 4.
|
|
137
|
+
[Grok 4.6 model page](https://docs.x.ai/developers/models/grok-4.6) for
|
|
134
138
|
current details.
|
|
135
139
|
</Note>
|
|
136
140
|
|
|
@@ -590,6 +594,7 @@ The following provider options are available:
|
|
|
590
594
|
|
|
591
595
|
| Model | Image Input | Object Generation | Tool Usage | Tool Streaming | Reasoning |
|
|
592
596
|
| ----------------------------- | ----------- | ----------------- | ---------- | -------------- | --------- |
|
|
597
|
+
| `grok-4.6` | <Check /> | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
593
598
|
| `grok-4.5` | <Check /> | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
594
599
|
| `grok-4.20-reasoning` | <Check /> | <Check /> | <Check /> | <Check /> | <Check /> |
|
|
595
600
|
| `grok-4.20-non-reasoning` | <Check /> | <Check /> | <Check /> | <Check /> | <Cross /> |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-sdk/xai",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.37",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
"tsup": "^8.5.1",
|
|
38
38
|
"typescript": "5.8.3",
|
|
39
39
|
"zod": "3.25.76",
|
|
40
|
-
"@ai-
|
|
41
|
-
"@
|
|
40
|
+
"@vercel/ai-tsconfig": "0.0.0",
|
|
41
|
+
"@ai-sdk/test-server": "2.0.1"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"zod": "^3.25.76 || ^4.1.8"
|
|
@@ -5,6 +5,7 @@ export type XaiResponsesModelId =
|
|
|
5
5
|
| 'grok-4.20-reasoning'
|
|
6
6
|
| 'grok-4.3'
|
|
7
7
|
| 'grok-4.5'
|
|
8
|
+
| 'grok-4.6'
|
|
8
9
|
| 'grok-latest'
|
|
9
10
|
| (string & {});
|
|
10
11
|
|
|
@@ -16,11 +17,14 @@ export const xaiLanguageModelResponsesOptions = z.object({
|
|
|
16
17
|
* Constrains how hard a reasoning model thinks before responding.
|
|
17
18
|
* Possible values are `none` (disables reasoning entirely; supported by
|
|
18
19
|
* `grok-4.3` and newer reasoning models), `low` (uses fewer reasoning
|
|
19
|
-
* tokens), `medium`,
|
|
20
|
+
* tokens), `medium`, `high` (uses more reasoning tokens), and `xhigh`
|
|
21
|
+
* (supported by `grok-4.6`).
|
|
20
22
|
*
|
|
21
23
|
* @see https://docs.x.ai/docs/guides/reasoning
|
|
22
24
|
*/
|
|
23
|
-
reasoningEffort: z
|
|
25
|
+
reasoningEffort: z
|
|
26
|
+
.enum(['none', 'low', 'medium', 'high', 'xhigh'])
|
|
27
|
+
.optional(),
|
|
24
28
|
reasoningSummary: z.enum(['auto', 'concise', 'detailed']).optional(),
|
|
25
29
|
logprobs: z.boolean().optional(),
|
|
26
30
|
topLogprobs: z.number().int().min(0).max(8).optional(),
|
|
@@ -6,6 +6,7 @@ export type XaiChatModelId =
|
|
|
6
6
|
| 'grok-4.20-reasoning'
|
|
7
7
|
| 'grok-4.3'
|
|
8
8
|
| 'grok-4.5'
|
|
9
|
+
| 'grok-4.6'
|
|
9
10
|
| 'grok-latest'
|
|
10
11
|
| (string & {});
|
|
11
12
|
|
|
@@ -59,13 +60,16 @@ export const xaiLanguageModelChatOptions = z.object({
|
|
|
59
60
|
* - `low` (default): Uses some reasoning tokens, but still fast.
|
|
60
61
|
* - `medium`: More thinking for less-latency-sensitive applications.
|
|
61
62
|
* - `high`: Uses more reasoning tokens for deeper thinking.
|
|
63
|
+
* - `xhigh`: Uses the most reasoning tokens (supported by `grok-4.6`).
|
|
62
64
|
*
|
|
63
65
|
* Note: Not every Grok model accepts every value. Refer to xAI's docs for
|
|
64
66
|
* the values supported by your selected model.
|
|
65
67
|
*
|
|
66
68
|
* @see https://docs.x.ai/docs/guides/reasoning
|
|
67
69
|
*/
|
|
68
|
-
reasoningEffort: z
|
|
70
|
+
reasoningEffort: z
|
|
71
|
+
.enum(['none', 'low', 'medium', 'high', 'xhigh'])
|
|
72
|
+
.optional(),
|
|
69
73
|
logprobs: z.boolean().optional(),
|
|
70
74
|
topLogprobs: z.number().int().min(0).max(8).optional(),
|
|
71
75
|
|