@ai-sdk/xai 2.0.85 → 2.0.86

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,11 @@
1
1
  # @ai-sdk/xai
2
2
 
3
+ ## 2.0.86
4
+
5
+ ### Patch Changes
6
+
7
+ - 1e632f7: feat(xai): add Grok 4.6 models
8
+
3
9
  ## 2.0.85
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.mts CHANGED
@@ -3,11 +3,13 @@ import { ProviderV2, LanguageModelV2, ImageModelV2 } from '@ai-sdk/provider';
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.5' | 'grok-4-1' | 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-0309-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-code-fast-1' | 'grok-4' | 'grok-4-0709' | 'grok-4-latest' | 'grok-3' | 'grok-3-latest' | 'grok-3-fast' | 'grok-3-fast-latest' | 'grok-3-mini' | 'grok-3-mini-latest' | 'grok-3-mini-fast' | 'grok-3-mini-fast-latest' | 'grok-2-vision-1212' | 'grok-2-vision' | 'grok-2-vision-latest' | 'grok-2-image-1212' | 'grok-2-image' | 'grok-2-image-latest' | 'grok-2-1212' | 'grok-2' | 'grok-2-latest' | 'grok-vision-beta' | 'grok-beta' | (string & {});
6
+ type XaiChatModelId = 'grok-4.6' | 'grok-4.5' | 'grok-4-1' | 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-0309-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-code-fast-1' | 'grok-4' | 'grok-4-0709' | 'grok-4-latest' | 'grok-3' | 'grok-3-latest' | 'grok-3-fast' | 'grok-3-fast-latest' | 'grok-3-mini' | 'grok-3-mini-latest' | 'grok-3-mini-fast' | 'grok-3-mini-fast-latest' | 'grok-2-vision-1212' | 'grok-2-vision' | 'grok-2-vision-latest' | 'grok-2-image-1212' | 'grok-2-image' | 'grok-2-image-latest' | 'grok-2-1212' | 'grok-2' | 'grok-2-latest' | 'grok-vision-beta' | 'grok-beta' | (string & {});
7
7
  declare const xaiProviderOptions: z.ZodObject<{
8
8
  reasoningEffort: z.ZodOptional<z.ZodEnum<{
9
9
  low: "low";
10
+ medium: "medium";
10
11
  high: "high";
12
+ xhigh: "xhigh";
11
13
  }>>;
12
14
  parallel_function_calling: z.ZodOptional<z.ZodBoolean>;
13
15
  searchParameters: z.ZodOptional<z.ZodObject<{
@@ -59,15 +61,16 @@ declare const xaiErrorDataSchema: z.ZodUnion<readonly [z.ZodObject<{
59
61
  }, z.core.$strip>]>;
60
62
  type XaiErrorData = z.infer<typeof xaiErrorDataSchema>;
61
63
 
62
- type XaiResponsesModelId = 'grok-4.5' | 'grok-4-1' | 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4' | 'grok-4-fast' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-0309-reasoning' | 'grok-4.20-multi-agent-0309' | (string & {});
64
+ type XaiResponsesModelId = 'grok-4.6' | 'grok-4.5' | 'grok-4-1' | 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4' | 'grok-4-fast' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-0309-reasoning' | 'grok-4.20-multi-agent-0309' | (string & {});
63
65
  /**
64
66
  * @see https://docs.x.ai/docs/api-reference#create-new-response
65
67
  */
66
68
  declare const xaiResponsesProviderOptions: z.ZodObject<{
67
69
  reasoningEffort: z.ZodOptional<z.ZodEnum<{
68
70
  low: "low";
69
- high: "high";
70
71
  medium: "medium";
72
+ high: "high";
73
+ xhigh: "xhigh";
71
74
  }>>;
72
75
  store: z.ZodOptional<z.ZodBoolean>;
73
76
  previousResponseId: z.ZodOptional<z.ZodString>;
package/dist/index.d.ts CHANGED
@@ -3,11 +3,13 @@ import { ProviderV2, LanguageModelV2, ImageModelV2 } from '@ai-sdk/provider';
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.5' | 'grok-4-1' | 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-0309-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-code-fast-1' | 'grok-4' | 'grok-4-0709' | 'grok-4-latest' | 'grok-3' | 'grok-3-latest' | 'grok-3-fast' | 'grok-3-fast-latest' | 'grok-3-mini' | 'grok-3-mini-latest' | 'grok-3-mini-fast' | 'grok-3-mini-fast-latest' | 'grok-2-vision-1212' | 'grok-2-vision' | 'grok-2-vision-latest' | 'grok-2-image-1212' | 'grok-2-image' | 'grok-2-image-latest' | 'grok-2-1212' | 'grok-2' | 'grok-2-latest' | 'grok-vision-beta' | 'grok-beta' | (string & {});
6
+ type XaiChatModelId = 'grok-4.6' | 'grok-4.5' | 'grok-4-1' | 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-0309-reasoning' | 'grok-4.20-multi-agent-0309' | 'grok-code-fast-1' | 'grok-4' | 'grok-4-0709' | 'grok-4-latest' | 'grok-3' | 'grok-3-latest' | 'grok-3-fast' | 'grok-3-fast-latest' | 'grok-3-mini' | 'grok-3-mini-latest' | 'grok-3-mini-fast' | 'grok-3-mini-fast-latest' | 'grok-2-vision-1212' | 'grok-2-vision' | 'grok-2-vision-latest' | 'grok-2-image-1212' | 'grok-2-image' | 'grok-2-image-latest' | 'grok-2-1212' | 'grok-2' | 'grok-2-latest' | 'grok-vision-beta' | 'grok-beta' | (string & {});
7
7
  declare const xaiProviderOptions: z.ZodObject<{
8
8
  reasoningEffort: z.ZodOptional<z.ZodEnum<{
9
9
  low: "low";
10
+ medium: "medium";
10
11
  high: "high";
12
+ xhigh: "xhigh";
11
13
  }>>;
12
14
  parallel_function_calling: z.ZodOptional<z.ZodBoolean>;
13
15
  searchParameters: z.ZodOptional<z.ZodObject<{
@@ -59,15 +61,16 @@ declare const xaiErrorDataSchema: z.ZodUnion<readonly [z.ZodObject<{
59
61
  }, z.core.$strip>]>;
60
62
  type XaiErrorData = z.infer<typeof xaiErrorDataSchema>;
61
63
 
62
- type XaiResponsesModelId = 'grok-4.5' | 'grok-4-1' | 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4' | 'grok-4-fast' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-0309-reasoning' | 'grok-4.20-multi-agent-0309' | (string & {});
64
+ type XaiResponsesModelId = 'grok-4.6' | 'grok-4.5' | 'grok-4-1' | 'grok-4-1-fast-reasoning' | 'grok-4-1-fast-non-reasoning' | 'grok-4' | 'grok-4-fast' | 'grok-4-fast-non-reasoning' | 'grok-4-fast-reasoning' | 'grok-4.20-0309-non-reasoning' | 'grok-4.20-0309-reasoning' | 'grok-4.20-multi-agent-0309' | (string & {});
63
65
  /**
64
66
  * @see https://docs.x.ai/docs/api-reference#create-new-response
65
67
  */
66
68
  declare const xaiResponsesProviderOptions: z.ZodObject<{
67
69
  reasoningEffort: z.ZodOptional<z.ZodEnum<{
68
70
  low: "low";
69
- high: "high";
70
71
  medium: "medium";
72
+ high: "high";
73
+ xhigh: "xhigh";
71
74
  }>>;
72
75
  store: z.ZodOptional<z.ZodBoolean>;
73
76
  previousResponseId: z.ZodOptional<z.ZodString>;
package/dist/index.js CHANGED
@@ -241,7 +241,11 @@ var searchSourceSchema = import_v4.z.discriminatedUnion("type", [
241
241
  rssSourceSchema
242
242
  ]);
243
243
  var xaiProviderOptions = import_v4.z.object({
244
- reasoningEffort: import_v4.z.enum(["low", "high"]).optional(),
244
+ /**
245
+ * Reasoning effort for reasoning models.
246
+ * `xhigh` is supported by `grok-4.6`.
247
+ */
248
+ reasoningEffort: import_v4.z.enum(["low", "medium", "high", "xhigh"]).optional(),
245
249
  /**
246
250
  * Whether to enable parallel function calling during tool use.
247
251
  * When true, the model can call multiple functions in parallel.
@@ -1275,9 +1279,11 @@ var import_v45 = require("zod/v4");
1275
1279
  var xaiResponsesProviderOptions = import_v45.z.object({
1276
1280
  /**
1277
1281
  * Constrains how hard a reasoning model thinks before responding.
1278
- * Possible values are `low` (uses fewer reasoning tokens), `medium` and `high` (uses more reasoning tokens).
1282
+ * Possible values are `low` (uses fewer reasoning tokens), `medium`, `high`
1283
+ * (uses more reasoning tokens), and `xhigh` (supported by `grok-4.6`).
1284
+ * Defaults to `high` for models that support reasoning effort.
1279
1285
  */
1280
- reasoningEffort: import_v45.z.enum(["low", "medium", "high"]).optional(),
1286
+ reasoningEffort: import_v45.z.enum(["low", "medium", "high", "xhigh"]).optional(),
1281
1287
  /**
1282
1288
  * Whether to store the input message(s) and model response for later retrieval.
1283
1289
  * @default true
@@ -2401,7 +2407,7 @@ var xaiTools = {
2401
2407
  };
2402
2408
 
2403
2409
  // src/version.ts
2404
- var VERSION = true ? "2.0.85" : "0.0.0-test";
2410
+ var VERSION = true ? "2.0.86" : "0.0.0-test";
2405
2411
 
2406
2412
  // src/xai-provider.ts
2407
2413
  var xaiErrorStructure = {