@ai-sdk/xai 3.0.96 → 3.0.98
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 +16 -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 +5 -5
- 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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# @ai-sdk/xai
|
|
2
2
|
|
|
3
|
+
## 3.0.98
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 1b40ac7: Publish all packages under the `@ai-v6` dist tag.
|
|
8
|
+
- Updated dependencies [1b40ac7]
|
|
9
|
+
- @ai-sdk/openai-compatible@2.0.52
|
|
10
|
+
- @ai-sdk/provider-utils@4.0.31
|
|
11
|
+
- @ai-sdk/provider@3.0.11
|
|
12
|
+
|
|
13
|
+
## 3.0.97
|
|
14
|
+
|
|
15
|
+
### Patch Changes
|
|
16
|
+
|
|
17
|
+
- 9300b02: xai: support 'none' and 'medium' reasoning effort and curate model ids to xai's current lineup (add grok-4.3, grok-build-0.1, grok-imagine-image-quality)
|
|
18
|
+
|
|
3
19
|
## 3.0.96
|
|
4
20
|
|
|
5
21
|
### Patch Changes
|
package/dist/index.d.mts
CHANGED
|
@@ -3,10 +3,12 @@ import { ProviderV3, LanguageModelV3, ImageModelV3, Experimental_VideoModelV3 }
|
|
|
3
3
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
4
4
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
5
5
|
|
|
6
|
-
type XaiChatModelId = 'grok-4
|
|
6
|
+
type XaiChatModelId = 'grok-4.3' | 'grok-4.20-0309-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-build-0.1' | (string & {});
|
|
7
7
|
declare const xaiLanguageModelChatOptions: z.ZodObject<{
|
|
8
8
|
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
9
|
+
none: "none";
|
|
9
10
|
low: "low";
|
|
11
|
+
medium: "medium";
|
|
10
12
|
high: "high";
|
|
11
13
|
}>>;
|
|
12
14
|
logprobs: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -61,15 +63,16 @@ declare const xaiErrorDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
61
63
|
}, z.core.$strip>]>;
|
|
62
64
|
type XaiErrorData = z.infer<typeof xaiErrorDataSchema>;
|
|
63
65
|
|
|
64
|
-
type XaiResponsesModelId = 'grok-4
|
|
66
|
+
type XaiResponsesModelId = 'grok-4.3' | 'grok-4.20-0309-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-build-0.1' | (string & {});
|
|
65
67
|
/**
|
|
66
68
|
* @see https://docs.x.ai/docs/api-reference#create-new-response
|
|
67
69
|
*/
|
|
68
70
|
declare const xaiLanguageModelResponsesOptions: z.ZodObject<{
|
|
69
71
|
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
72
|
+
none: "none";
|
|
70
73
|
low: "low";
|
|
71
|
-
high: "high";
|
|
72
74
|
medium: "medium";
|
|
75
|
+
high: "high";
|
|
73
76
|
}>>;
|
|
74
77
|
logprobs: z.ZodOptional<z.ZodBoolean>;
|
|
75
78
|
topLogprobs: z.ZodOptional<z.ZodNumber>;
|
|
@@ -91,8 +94,8 @@ declare const xaiImageModelOptions: z.ZodObject<{
|
|
|
91
94
|
}>>;
|
|
92
95
|
quality: z.ZodOptional<z.ZodEnum<{
|
|
93
96
|
low: "low";
|
|
94
|
-
high: "high";
|
|
95
97
|
medium: "medium";
|
|
98
|
+
high: "high";
|
|
96
99
|
}>>;
|
|
97
100
|
user: z.ZodOptional<z.ZodString>;
|
|
98
101
|
}, z.core.$strip>;
|
|
@@ -171,7 +174,7 @@ interface XaiLegacyReferenceToVideoOptions extends XaiVideoSharedOptions {
|
|
|
171
174
|
*/
|
|
172
175
|
type XaiVideoModelOptions = XaiVideoGenerationOptions | XaiVideoEditModeOptions | XaiVideoExtendModeOptions | XaiVideoReferenceToVideoOptions | XaiLegacyEditVideoOptions | XaiLegacyReferenceToVideoOptions;
|
|
173
176
|
|
|
174
|
-
type XaiImageModelId = 'grok-imagine-image' | 'grok-imagine-image-
|
|
177
|
+
type XaiImageModelId = 'grok-imagine-image' | 'grok-imagine-image-quality' | (string & {});
|
|
175
178
|
|
|
176
179
|
declare const codeExecutionToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, {
|
|
177
180
|
output: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,10 +3,12 @@ import { ProviderV3, LanguageModelV3, ImageModelV3, Experimental_VideoModelV3 }
|
|
|
3
3
|
import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
4
4
|
import { FetchFunction } from '@ai-sdk/provider-utils';
|
|
5
5
|
|
|
6
|
-
type XaiChatModelId = 'grok-4
|
|
6
|
+
type XaiChatModelId = 'grok-4.3' | 'grok-4.20-0309-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-build-0.1' | (string & {});
|
|
7
7
|
declare const xaiLanguageModelChatOptions: z.ZodObject<{
|
|
8
8
|
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
9
|
+
none: "none";
|
|
9
10
|
low: "low";
|
|
11
|
+
medium: "medium";
|
|
10
12
|
high: "high";
|
|
11
13
|
}>>;
|
|
12
14
|
logprobs: z.ZodOptional<z.ZodBoolean>;
|
|
@@ -61,15 +63,16 @@ declare const xaiErrorDataSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
|
61
63
|
}, z.core.$strip>]>;
|
|
62
64
|
type XaiErrorData = z.infer<typeof xaiErrorDataSchema>;
|
|
63
65
|
|
|
64
|
-
type XaiResponsesModelId = 'grok-4
|
|
66
|
+
type XaiResponsesModelId = 'grok-4.3' | 'grok-4.20-0309-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-build-0.1' | (string & {});
|
|
65
67
|
/**
|
|
66
68
|
* @see https://docs.x.ai/docs/api-reference#create-new-response
|
|
67
69
|
*/
|
|
68
70
|
declare const xaiLanguageModelResponsesOptions: z.ZodObject<{
|
|
69
71
|
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
72
|
+
none: "none";
|
|
70
73
|
low: "low";
|
|
71
|
-
high: "high";
|
|
72
74
|
medium: "medium";
|
|
75
|
+
high: "high";
|
|
73
76
|
}>>;
|
|
74
77
|
logprobs: z.ZodOptional<z.ZodBoolean>;
|
|
75
78
|
topLogprobs: z.ZodOptional<z.ZodNumber>;
|
|
@@ -91,8 +94,8 @@ declare const xaiImageModelOptions: z.ZodObject<{
|
|
|
91
94
|
}>>;
|
|
92
95
|
quality: z.ZodOptional<z.ZodEnum<{
|
|
93
96
|
low: "low";
|
|
94
|
-
high: "high";
|
|
95
97
|
medium: "medium";
|
|
98
|
+
high: "high";
|
|
96
99
|
}>>;
|
|
97
100
|
user: z.ZodOptional<z.ZodString>;
|
|
98
101
|
}, z.core.$strip>;
|
|
@@ -171,7 +174,7 @@ interface XaiLegacyReferenceToVideoOptions extends XaiVideoSharedOptions {
|
|
|
171
174
|
*/
|
|
172
175
|
type XaiVideoModelOptions = XaiVideoGenerationOptions | XaiVideoEditModeOptions | XaiVideoExtendModeOptions | XaiVideoReferenceToVideoOptions | XaiLegacyEditVideoOptions | XaiLegacyReferenceToVideoOptions;
|
|
173
176
|
|
|
174
|
-
type XaiImageModelId = 'grok-imagine-image' | 'grok-imagine-image-
|
|
177
|
+
type XaiImageModelId = 'grok-imagine-image' | 'grok-imagine-image-quality' | (string & {});
|
|
175
178
|
|
|
176
179
|
declare const codeExecutionToolFactory: _ai_sdk_provider_utils.ProviderToolFactoryWithOutputSchema<Record<string, never>, {
|
|
177
180
|
output: string;
|
package/dist/index.js
CHANGED
|
@@ -246,7 +246,7 @@ var searchSourceSchema = import_v4.z.discriminatedUnion("type", [
|
|
|
246
246
|
rssSourceSchema
|
|
247
247
|
]);
|
|
248
248
|
var xaiLanguageModelChatOptions = import_v4.z.object({
|
|
249
|
-
reasoningEffort: import_v4.z.enum(["low", "high"]).optional(),
|
|
249
|
+
reasoningEffort: import_v4.z.enum(["none", "low", "medium", "high"]).optional(),
|
|
250
250
|
logprobs: import_v4.z.boolean().optional(),
|
|
251
251
|
topLogprobs: import_v4.z.number().int().min(0).max(8).optional(),
|
|
252
252
|
/**
|
|
@@ -1742,9 +1742,11 @@ var import_v47 = require("zod/v4");
|
|
|
1742
1742
|
var xaiLanguageModelResponsesOptions = import_v47.z.object({
|
|
1743
1743
|
/**
|
|
1744
1744
|
* Constrains how hard a reasoning model thinks before responding.
|
|
1745
|
-
* Possible values are `
|
|
1745
|
+
* Possible values are `none` (disables reasoning), `low` (uses fewer reasoning
|
|
1746
|
+
* tokens), `medium` and `high` (uses more reasoning tokens). Not all models
|
|
1747
|
+
* support reasoning effort; see xAI's docs for the values each model accepts.
|
|
1746
1748
|
*/
|
|
1747
|
-
reasoningEffort: import_v47.z.enum(["low", "medium", "high"]).optional(),
|
|
1749
|
+
reasoningEffort: import_v47.z.enum(["none", "low", "medium", "high"]).optional(),
|
|
1748
1750
|
logprobs: import_v47.z.boolean().optional(),
|
|
1749
1751
|
topLogprobs: import_v47.z.number().int().min(0).max(8).optional(),
|
|
1750
1752
|
/**
|
|
@@ -2841,7 +2843,7 @@ var xaiTools = {
|
|
|
2841
2843
|
};
|
|
2842
2844
|
|
|
2843
2845
|
// src/version.ts
|
|
2844
|
-
var VERSION = true ? "3.0.
|
|
2846
|
+
var VERSION = true ? "3.0.98" : "0.0.0-test";
|
|
2845
2847
|
|
|
2846
2848
|
// src/xai-video-model.ts
|
|
2847
2849
|
var import_provider6 = require("@ai-sdk/provider");
|