@ai-sdk/xai 3.0.112 → 3.0.113

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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @ai-sdk/xai
2
2
 
3
+ ## 3.0.113
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [9ecdefe]
8
+ - @ai-sdk/provider-utils@4.0.41
9
+ - @ai-sdk/openai-compatible@2.0.63
10
+
3
11
  ## 3.0.112
4
12
 
5
13
  ### Patch Changes
package/dist/index.js CHANGED
@@ -2933,7 +2933,7 @@ var xaiTools = {
2933
2933
  };
2934
2934
 
2935
2935
  // src/version.ts
2936
- var VERSION = true ? "3.0.112" : "0.0.0-test";
2936
+ var VERSION = true ? "3.0.113" : "0.0.0-test";
2937
2937
 
2938
2938
  // src/xai-video-model.ts
2939
2939
  var import_provider6 = require("@ai-sdk/provider");
package/dist/index.mjs CHANGED
@@ -2954,7 +2954,7 @@ var xaiTools = {
2954
2954
  };
2955
2955
 
2956
2956
  // src/version.ts
2957
- var VERSION = true ? "3.0.112" : "0.0.0-test";
2957
+ var VERSION = true ? "3.0.113" : "0.0.0-test";
2958
2958
 
2959
2959
  // src/xai-video-model.ts
2960
2960
  import {
package/docs/01-xai.mdx CHANGED
@@ -99,6 +99,26 @@ xAI language models can also be used in the `streamText` function
99
99
  and support structured data generation with [`Output`](/docs/reference/ai-sdk-core/output)
100
100
  (see [AI SDK Core](/docs/ai-sdk-core)).
101
101
 
102
+ ### Reasoning Effort
103
+
104
+ For models with configurable reasoning, you can control how much effort the
105
+ model spends thinking before responding with
106
+ `providerOptions.xai.reasoningEffort`. The AI SDK option accepts `'none'`,
107
+ `'low'`, `'medium'`, and `'high'`, but each xAI model supports a subset.
108
+
109
+ <Note>
110
+ Support and defaults are model-specific. `grok-4.3` supports `'none'`,
111
+ `'low'`, `'medium'`, and `'high'`. `grok-4.5` supports `'low'`, `'medium'`,
112
+ and `'high'`, defaults to `'high'`, and cannot disable reasoning. The
113
+ `grok-4.20-reasoning` and `grok-4.20-non-reasoning` variants do not accept
114
+ this option, and neither does `grok-build-0.1`. For
115
+ `grok-4.20-multi-agent`, `'low'`, `'medium'`, and `'high'` control the number
116
+ of agents instead of reasoning depth. See xAI's [reasoning
117
+ docs](https://docs.x.ai/developers/model-capabilities/text/reasoning) and
118
+ [Grok 4.3 model page](https://docs.x.ai/developers/models/grok-4.3) for
119
+ current details.
120
+ </Note>
121
+
102
122
  ### Provider Options
103
123
 
104
124
  xAI chat models support additional provider options that are not part of
@@ -107,7 +127,7 @@ the [standard call settings](/docs/ai-sdk-core/settings). You can pass them in t
107
127
  ```ts
108
128
  import { xai, type XaiLanguageModelChatOptions } from '@ai-sdk/xai';
109
129
 
110
- const model = xai('grok-3-mini');
130
+ const model = xai('grok-4.5');
111
131
 
112
132
  await generateText({
113
133
  model,
@@ -123,14 +143,7 @@ The following optional provider options are available for xAI chat models:
123
143
 
124
144
  - **reasoningEffort** _'none' | 'low' | 'medium' | 'high'_
125
145
 
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>
146
+ Control the reasoning effort for supported models. See [Reasoning Effort](#reasoning-effort) for model-specific values and defaults.
134
147
 
135
148
  - **logprobs** _boolean_
136
149
 
@@ -485,7 +498,7 @@ import { xai, type XaiLanguageModelResponsesOptions } from '@ai-sdk/xai';
485
498
  import { generateText } from 'ai';
486
499
 
487
500
  const result = await generateText({
488
- model: xai.responses('grok-4.20-non-reasoning'),
501
+ model: xai.responses('grok-4.5'),
489
502
  providerOptions: {
490
503
  xai: {
491
504
  reasoningEffort: 'high',
@@ -499,14 +512,7 @@ The following provider options are available:
499
512
 
500
513
  - **reasoningEffort** _'none' | 'low' | 'medium' | 'high'_
501
514
 
502
- 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.
503
-
504
- <Note>
505
- Not every Grok model accepts every reasoning effort, for example
506
- `grok-build-0.1` does not support reasoning effort. See xAI's [reasoning
507
- docs](https://docs.x.ai/docs/guides/reasoning) for the values each model
508
- accepts.
509
- </Note>
515
+ Control the reasoning effort for supported models. See [Reasoning Effort](#reasoning-effort) for model-specific values and defaults.
510
516
 
511
517
  - **logprobs** _boolean_
512
518
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/xai",
3
- "version": "3.0.112",
3
+ "version": "3.0.113",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -29,9 +29,9 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
- "@ai-sdk/openai-compatible": "2.0.62",
32
+ "@ai-sdk/openai-compatible": "2.0.63",
33
33
  "@ai-sdk/provider": "3.0.14",
34
- "@ai-sdk/provider-utils": "4.0.40"
34
+ "@ai-sdk/provider-utils": "4.0.41"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "20.17.24",