@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/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -3,13 +3,14 @@ import * as _ai_sdk_provider_utils from '@ai-sdk/provider-utils';
|
|
|
3
3
|
import { InferSchema, FetchFunction, WebSocketConstructor } from '@ai-sdk/provider-utils';
|
|
4
4
|
import { ProviderV4, LanguageModelV4, ImageModelV4, Experimental_VideoModelV4, Experimental_RealtimeFactoryV4, SpeechModelV4, TranscriptionModelV4, FilesV4, Experimental_RealtimeModelV4, Experimental_RealtimeModelV4ClientSecretOptions, Experimental_RealtimeModelV4ClientSecretResult, Experimental_RealtimeModelV4ServerEvent, Experimental_RealtimeModelV4ClientEvent, Experimental_RealtimeModelV4SessionConfig } from '@ai-sdk/provider';
|
|
5
5
|
|
|
6
|
-
type XaiChatModelId = 'grok-4.20-non-reasoning' | 'grok-4.20-reasoning' | 'grok-4.3' | 'grok-4.5' | 'grok-latest' | (string & {});
|
|
6
|
+
type XaiChatModelId = 'grok-4.20-non-reasoning' | 'grok-4.20-reasoning' | 'grok-4.3' | 'grok-4.5' | 'grok-4.6' | 'grok-latest' | (string & {});
|
|
7
7
|
declare const xaiLanguageModelChatOptions: z.ZodObject<{
|
|
8
8
|
reasoningEffort: z.ZodOptional<z.ZodEnum<{
|
|
9
9
|
none: "none";
|
|
10
10
|
low: "low";
|
|
11
11
|
medium: "medium";
|
|
12
12
|
high: "high";
|
|
13
|
+
xhigh: "xhigh";
|
|
13
14
|
}>>;
|
|
14
15
|
logprobs: z.ZodOptional<z.ZodBoolean>;
|
|
15
16
|
topLogprobs: z.ZodOptional<z.ZodNumber>;
|
|
@@ -72,7 +73,7 @@ declare const xaiFilePartProviderOptions: z.ZodObject<{
|
|
|
72
73
|
}, z.core.$strip>;
|
|
73
74
|
type XaiFilePartProviderOptions = z.infer<typeof xaiFilePartProviderOptions>;
|
|
74
75
|
|
|
75
|
-
type XaiResponsesModelId = 'grok-4.20-non-reasoning' | 'grok-4.20-reasoning' | 'grok-4.3' | 'grok-4.5' | 'grok-latest' | (string & {});
|
|
76
|
+
type XaiResponsesModelId = 'grok-4.20-non-reasoning' | 'grok-4.20-reasoning' | 'grok-4.3' | 'grok-4.5' | 'grok-4.6' | 'grok-latest' | (string & {});
|
|
76
77
|
/**
|
|
77
78
|
* @see https://docs.x.ai/docs/api-reference#create-new-response
|
|
78
79
|
*/
|
|
@@ -82,6 +83,7 @@ declare const xaiLanguageModelResponsesOptions: z.ZodObject<{
|
|
|
82
83
|
low: "low";
|
|
83
84
|
medium: "medium";
|
|
84
85
|
high: "high";
|
|
86
|
+
xhigh: "xhigh";
|
|
85
87
|
}>>;
|
|
86
88
|
reasoningSummary: z.ZodOptional<z.ZodEnum<{
|
|
87
89
|
auto: "auto";
|
package/dist/index.js
CHANGED
|
@@ -305,13 +305,14 @@ var xaiLanguageModelChatOptions = z2.object({
|
|
|
305
305
|
* - `low` (default): Uses some reasoning tokens, but still fast.
|
|
306
306
|
* - `medium`: More thinking for less-latency-sensitive applications.
|
|
307
307
|
* - `high`: Uses more reasoning tokens for deeper thinking.
|
|
308
|
+
* - `xhigh`: Uses the most reasoning tokens (supported by `grok-4.6`).
|
|
308
309
|
*
|
|
309
310
|
* Note: Not every Grok model accepts every value. Refer to xAI's docs for
|
|
310
311
|
* the values supported by your selected model.
|
|
311
312
|
*
|
|
312
313
|
* @see https://docs.x.ai/docs/guides/reasoning
|
|
313
314
|
*/
|
|
314
|
-
reasoningEffort: z2.enum(["none", "low", "medium", "high"]).optional(),
|
|
315
|
+
reasoningEffort: z2.enum(["none", "low", "medium", "high", "xhigh"]).optional(),
|
|
315
316
|
logprobs: z2.boolean().optional(),
|
|
316
317
|
topLogprobs: z2.number().int().min(0).max(8).optional(),
|
|
317
318
|
/**
|
|
@@ -557,7 +558,7 @@ var XaiChatLanguageModel = class _XaiChatLanguageModel {
|
|
|
557
558
|
low: "low",
|
|
558
559
|
medium: "medium",
|
|
559
560
|
high: "high",
|
|
560
|
-
xhigh: "high"
|
|
561
|
+
xhigh: this.modelId === "grok-4.6" ? "xhigh" : "high"
|
|
561
562
|
},
|
|
562
563
|
warnings
|
|
563
564
|
});
|
|
@@ -1966,11 +1967,12 @@ var xaiLanguageModelResponsesOptions = z8.object({
|
|
|
1966
1967
|
* Constrains how hard a reasoning model thinks before responding.
|
|
1967
1968
|
* Possible values are `none` (disables reasoning entirely; supported by
|
|
1968
1969
|
* `grok-4.3` and newer reasoning models), `low` (uses fewer reasoning
|
|
1969
|
-
* tokens), `medium`,
|
|
1970
|
+
* tokens), `medium`, `high` (uses more reasoning tokens), and `xhigh`
|
|
1971
|
+
* (supported by `grok-4.6`).
|
|
1970
1972
|
*
|
|
1971
1973
|
* @see https://docs.x.ai/docs/guides/reasoning
|
|
1972
1974
|
*/
|
|
1973
|
-
reasoningEffort: z8.enum(["none", "low", "medium", "high"]).optional(),
|
|
1975
|
+
reasoningEffort: z8.enum(["none", "low", "medium", "high", "xhigh"]).optional(),
|
|
1974
1976
|
reasoningSummary: z8.enum(["auto", "concise", "detailed"]).optional(),
|
|
1975
1977
|
logprobs: z8.boolean().optional(),
|
|
1976
1978
|
topLogprobs: z8.number().int().min(0).max(8).optional(),
|
|
@@ -2461,7 +2463,7 @@ var XaiResponsesLanguageModel = class _XaiResponsesLanguageModel {
|
|
|
2461
2463
|
low: "low",
|
|
2462
2464
|
medium: "medium",
|
|
2463
2465
|
high: "high",
|
|
2464
|
-
xhigh: "high"
|
|
2466
|
+
xhigh: this.modelId === "grok-4.6" ? "xhigh" : "high"
|
|
2465
2467
|
},
|
|
2466
2468
|
warnings
|
|
2467
2469
|
});
|
|
@@ -3687,7 +3689,7 @@ var xaiTools = {
|
|
|
3687
3689
|
};
|
|
3688
3690
|
|
|
3689
3691
|
// src/version.ts
|
|
3690
|
-
var VERSION = true ? "4.0.
|
|
3692
|
+
var VERSION = true ? "4.0.37" : "0.0.0-test";
|
|
3691
3693
|
|
|
3692
3694
|
// src/files/xai-files.ts
|
|
3693
3695
|
import {
|