@ai-sdk/xai 3.0.132 → 3.0.134

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,20 @@
1
1
  # @ai-sdk/xai
2
2
 
3
+ ## 3.0.134
4
+
5
+ ### Patch Changes
6
+
7
+ - 1096a27: feat(xai): add grok 4.7 model ID
8
+ - Updated dependencies [82e18b0]
9
+ - @ai-sdk/provider-utils@4.0.52
10
+ - @ai-sdk/openai-compatible@2.0.76
11
+
12
+ ## 3.0.133
13
+
14
+ ### Patch Changes
15
+
16
+ - 8825c65: fix(xai): preserve `additionalProperties: false` in tool schemas
17
+
3
18
  ## 3.0.132
4
19
 
5
20
  ### Patch Changes
package/README.md CHANGED
@@ -36,7 +36,7 @@ import { xai } from '@ai-sdk/xai';
36
36
  import { generateText } from 'ai';
37
37
 
38
38
  const { text } = await generateText({
39
- model: xai('grok-4.6'),
39
+ model: xai('grok-4.7'),
40
40
  prompt: 'Write a vegetarian lasagna recipe for 4 people.',
41
41
  });
42
42
  ```
package/dist/index.d.mts CHANGED
@@ -3,7 +3,7 @@ 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' | 'grok-4.5' | '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 & {});
6
+ type XaiChatModelId = 'grok-4.7' | 'grok-4.6' | 'grok-4.5' | '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
9
  none: "none";
@@ -77,7 +77,7 @@ declare const xaiFilePartProviderOptions: z.ZodObject<{
77
77
  }, z.core.$strip>;
78
78
  type XaiFilePartProviderOptions = z.infer<typeof xaiFilePartProviderOptions>;
79
79
 
80
- type XaiResponsesModelId = 'grok-4.6' | 'grok-4.5' | '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 & {});
80
+ type XaiResponsesModelId = 'grok-4.7' | 'grok-4.6' | 'grok-4.5' | '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 & {});
81
81
  /**
82
82
  * @see https://docs.x.ai/docs/api-reference#create-new-response
83
83
  */
package/dist/index.d.ts CHANGED
@@ -3,7 +3,7 @@ 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' | 'grok-4.5' | '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 & {});
6
+ type XaiChatModelId = 'grok-4.7' | 'grok-4.6' | 'grok-4.5' | '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
9
  none: "none";
@@ -77,7 +77,7 @@ declare const xaiFilePartProviderOptions: z.ZodObject<{
77
77
  }, z.core.$strip>;
78
78
  type XaiFilePartProviderOptions = z.infer<typeof xaiFilePartProviderOptions>;
79
79
 
80
- type XaiResponsesModelId = 'grok-4.6' | 'grok-4.5' | '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 & {});
80
+ type XaiResponsesModelId = 'grok-4.7' | 'grok-4.6' | 'grok-4.5' | '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 & {});
81
81
  /**
82
82
  * @see https://docs.x.ai/docs/api-reference#create-new-response
83
83
  */
package/dist/index.js CHANGED
@@ -357,26 +357,6 @@ var xaiFailedResponseHandler = (0, import_provider_utils2.createJsonErrorRespons
357
357
 
358
358
  // src/xai-prepare-tools.ts
359
359
  var import_provider2 = require("@ai-sdk/provider");
360
-
361
- // src/remove-additional-properties.ts
362
- function removeAdditionalPropertiesFalse(value) {
363
- if (Array.isArray(value)) {
364
- return value.map(removeAdditionalPropertiesFalse);
365
- }
366
- if (value == null || typeof value !== "object") {
367
- return value;
368
- }
369
- const result = {};
370
- for (const [key, propertyValue] of Object.entries(value)) {
371
- if (key === "additionalProperties" && propertyValue === false) {
372
- continue;
373
- }
374
- result[key] = removeAdditionalPropertiesFalse(propertyValue);
375
- }
376
- return result;
377
- }
378
-
379
- // src/xai-prepare-tools.ts
380
360
  function prepareTools({
381
361
  tools,
382
362
  toolChoice
@@ -399,7 +379,7 @@ function prepareTools({
399
379
  function: {
400
380
  name: tool.name,
401
381
  description: tool.description,
402
- parameters: removeAdditionalPropertiesFalse(tool.inputSchema),
382
+ parameters: tool.inputSchema,
403
383
  ...tool.strict != null ? { strict: tool.strict } : {}
404
384
  }
405
385
  });
@@ -2141,7 +2121,7 @@ async function prepareResponsesTools({
2141
2121
  type: "function",
2142
2122
  name: tool.name,
2143
2123
  description: tool.description,
2144
- parameters: removeAdditionalPropertiesFalse(tool.inputSchema),
2124
+ parameters: tool.inputSchema,
2145
2125
  ...tool.strict != null ? { strict: tool.strict } : {}
2146
2126
  });
2147
2127
  }
@@ -3043,7 +3023,7 @@ var xaiTools = {
3043
3023
  };
3044
3024
 
3045
3025
  // src/version.ts
3046
- var VERSION = true ? "3.0.132" : "0.0.0-test";
3026
+ var VERSION = true ? "3.0.134" : "0.0.0-test";
3047
3027
 
3048
3028
  // src/xai-video-model.ts
3049
3029
  var import_provider6 = require("@ai-sdk/provider");