@ai-sdk/xai 3.0.96 → 3.0.97
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.mts +8 -5
- package/dist/index.d.ts +8 -5
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/docs/01-xai.mdx +18 -4
- package/package.json +1 -1
- package/src/responses/xai-responses-options.ts +7 -8
- package/src/xai-chat-options.ts +4 -14
- package/src/xai-image-settings.ts +1 -1
package/docs/01-xai.mdx
CHANGED
|
@@ -121,9 +121,16 @@ await generateText({
|
|
|
121
121
|
|
|
122
122
|
The following optional provider options are available for xAI chat models:
|
|
123
123
|
|
|
124
|
-
- **reasoningEffort** _'low' | 'high'_
|
|
124
|
+
- **reasoningEffort** _'none' | 'low' | 'medium' | 'high'_
|
|
125
125
|
|
|
126
|
-
Reasoning effort for reasoning models.
|
|
126
|
+
Reasoning effort for reasoning models. `'none'` disables reasoning entirely.
|
|
127
|
+
|
|
128
|
+
<Note>
|
|
129
|
+
Not every Grok model accepts every reasoning effort, for example
|
|
130
|
+
`grok-build-0.1` does not support reasoning effort. See xAI's [reasoning
|
|
131
|
+
docs](https://docs.x.ai/docs/guides/reasoning) for the values each model
|
|
132
|
+
accepts.
|
|
133
|
+
</Note>
|
|
127
134
|
|
|
128
135
|
- **logprobs** _boolean_
|
|
129
136
|
|
|
@@ -454,9 +461,16 @@ const result = await generateText({
|
|
|
454
461
|
|
|
455
462
|
The following provider options are available:
|
|
456
463
|
|
|
457
|
-
- **reasoningEffort** _'low' | 'medium' | 'high'_
|
|
464
|
+
- **reasoningEffort** _'none' | 'low' | 'medium' | 'high'_
|
|
458
465
|
|
|
459
|
-
Control the reasoning effort for the model. Higher effort may produce more thorough results at the cost of increased latency and token usage.
|
|
466
|
+
Control the reasoning effort for the model. Higher effort may produce more thorough results at the cost of increased latency and token usage. `'none'` disables reasoning entirely.
|
|
467
|
+
|
|
468
|
+
<Note>
|
|
469
|
+
Not every Grok model accepts every reasoning effort, for example
|
|
470
|
+
`grok-build-0.1` does not support reasoning effort. See xAI's [reasoning
|
|
471
|
+
docs](https://docs.x.ai/docs/guides/reasoning) for the values each model
|
|
472
|
+
accepts.
|
|
473
|
+
</Note>
|
|
460
474
|
|
|
461
475
|
- **logprobs** _boolean_
|
|
462
476
|
|
package/package.json
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { z } from 'zod/v4';
|
|
2
2
|
|
|
3
3
|
export type XaiResponsesModelId =
|
|
4
|
-
| 'grok-4
|
|
5
|
-
| 'grok-4-1-fast-non-reasoning'
|
|
6
|
-
| 'grok-4'
|
|
7
|
-
| 'grok-4-fast-non-reasoning'
|
|
8
|
-
| 'grok-4-fast-reasoning'
|
|
9
|
-
| 'grok-4.20-0309-non-reasoning'
|
|
4
|
+
| 'grok-4.3'
|
|
10
5
|
| 'grok-4.20-0309-reasoning'
|
|
6
|
+
| 'grok-4.20-0309-non-reasoning'
|
|
11
7
|
| 'grok-4.20-multi-agent-0309'
|
|
8
|
+
| 'grok-build-0.1'
|
|
12
9
|
| (string & {});
|
|
13
10
|
|
|
14
11
|
/**
|
|
@@ -17,9 +14,11 @@ export type XaiResponsesModelId =
|
|
|
17
14
|
export const xaiLanguageModelResponsesOptions = z.object({
|
|
18
15
|
/**
|
|
19
16
|
* Constrains how hard a reasoning model thinks before responding.
|
|
20
|
-
* Possible values are `
|
|
17
|
+
* Possible values are `none` (disables reasoning), `low` (uses fewer reasoning
|
|
18
|
+
* tokens), `medium` and `high` (uses more reasoning tokens). Not all models
|
|
19
|
+
* support reasoning effort; see xAI's docs for the values each model accepts.
|
|
21
20
|
*/
|
|
22
|
-
reasoningEffort: z.enum(['low', 'medium', 'high']).optional(),
|
|
21
|
+
reasoningEffort: z.enum(['none', 'low', 'medium', 'high']).optional(),
|
|
23
22
|
logprobs: z.boolean().optional(),
|
|
24
23
|
topLogprobs: z.number().int().min(0).max(8).optional(),
|
|
25
24
|
/**
|
package/src/xai-chat-options.ts
CHANGED
|
@@ -2,21 +2,11 @@ import { z } from 'zod/v4';
|
|
|
2
2
|
|
|
3
3
|
// https://docs.x.ai/docs/models
|
|
4
4
|
export type XaiChatModelId =
|
|
5
|
-
| 'grok-4
|
|
6
|
-
| 'grok-4-1-fast-non-reasoning'
|
|
7
|
-
| 'grok-4-fast-non-reasoning'
|
|
8
|
-
| 'grok-4-fast-reasoning'
|
|
9
|
-
| 'grok-4.20-0309-non-reasoning'
|
|
5
|
+
| 'grok-4.3'
|
|
10
6
|
| 'grok-4.20-0309-reasoning'
|
|
7
|
+
| 'grok-4.20-0309-non-reasoning'
|
|
11
8
|
| 'grok-4.20-multi-agent-0309'
|
|
12
|
-
| 'grok-
|
|
13
|
-
| 'grok-4'
|
|
14
|
-
| 'grok-4-0709'
|
|
15
|
-
| 'grok-4-latest'
|
|
16
|
-
| 'grok-3'
|
|
17
|
-
| 'grok-3-latest'
|
|
18
|
-
| 'grok-3-mini'
|
|
19
|
-
| 'grok-3-mini-latest'
|
|
9
|
+
| 'grok-build-0.1'
|
|
20
10
|
| (string & {});
|
|
21
11
|
|
|
22
12
|
// search source schemas
|
|
@@ -61,7 +51,7 @@ const searchSourceSchema = z.discriminatedUnion('type', [
|
|
|
61
51
|
|
|
62
52
|
// xai-specific provider options
|
|
63
53
|
export const xaiLanguageModelChatOptions = z.object({
|
|
64
|
-
reasoningEffort: z.enum(['low', 'high']).optional(),
|
|
54
|
+
reasoningEffort: z.enum(['none', 'low', 'medium', 'high']).optional(),
|
|
65
55
|
logprobs: z.boolean().optional(),
|
|
66
56
|
topLogprobs: z.number().int().min(0).max(8).optional(),
|
|
67
57
|
|