@ai-sdk/xai 4.0.0-beta.29 → 4.0.0-beta.30

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
+ ## 4.0.0-beta.30
4
+
5
+ ### Patch Changes
6
+
7
+ - e5bdc8d: fix (provider/xai): handle mid-stream error chunks
8
+
3
9
  ## 4.0.0-beta.29
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1685,6 +1685,12 @@ var xaiResponsesChunkSchema = import_v46.z.union([
1685
1685
  usage: xaiResponsesUsageSchema.nullish()
1686
1686
  })
1687
1687
  }),
1688
+ import_v46.z.object({
1689
+ type: import_v46.z.literal("error"),
1690
+ code: import_v46.z.string().nullish(),
1691
+ message: import_v46.z.string(),
1692
+ param: import_v46.z.string().nullish()
1693
+ }),
1688
1694
  import_v46.z.object({
1689
1695
  type: import_v46.z.literal("response.done"),
1690
1696
  response: xaiResponsesResponseSchema
@@ -2519,6 +2525,10 @@ var XaiResponsesLanguageModel = class {
2519
2525
  }
2520
2526
  return;
2521
2527
  }
2528
+ if (event.type === "error") {
2529
+ controller.enqueue({ type: "error", error: event });
2530
+ return;
2531
+ }
2522
2532
  if (event.type === "response.custom_tool_call_input.delta" || event.type === "response.custom_tool_call_input.done") {
2523
2533
  return;
2524
2534
  }
@@ -2808,7 +2818,7 @@ var xaiTools = {
2808
2818
  };
2809
2819
 
2810
2820
  // src/version.ts
2811
- var VERSION = true ? "4.0.0-beta.29" : "0.0.0-test";
2821
+ var VERSION = true ? "4.0.0-beta.30" : "0.0.0-test";
2812
2822
 
2813
2823
  // src/files/xai-files.ts
2814
2824
  var import_provider_utils17 = require("@ai-sdk/provider-utils");