@ai-sdk/xai 2.0.66 → 2.0.67

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.67
4
+
5
+ ### Patch Changes
6
+
7
+ - 21ff967: fix (provider/xai): handle mid-stream error chunks
8
+
3
9
  ## 2.0.66
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -1227,6 +1227,12 @@ var xaiResponsesChunkSchema = import_v44.z.union([
1227
1227
  usage: xaiResponsesUsageSchema.nullish()
1228
1228
  })
1229
1229
  }),
1230
+ import_v44.z.object({
1231
+ type: import_v44.z.literal("error"),
1232
+ code: import_v44.z.string().nullish(),
1233
+ message: import_v44.z.string(),
1234
+ param: import_v44.z.string().nullish()
1235
+ }),
1230
1236
  import_v44.z.object({
1231
1237
  type: import_v44.z.literal("response.done"),
1232
1238
  response: xaiResponsesResponseSchema
@@ -2110,6 +2116,10 @@ var XaiResponsesLanguageModel = class {
2110
2116
  }
2111
2117
  return;
2112
2118
  }
2119
+ if (event.type === "error") {
2120
+ controller.enqueue({ type: "error", error: event });
2121
+ return;
2122
+ }
2113
2123
  if (event.type === "response.function_call_arguments.delta") {
2114
2124
  const toolCall = ongoingToolCalls[event.output_index];
2115
2125
  if (toolCall != null) {
@@ -2337,7 +2347,7 @@ var xaiTools = {
2337
2347
  };
2338
2348
 
2339
2349
  // src/version.ts
2340
- var VERSION = true ? "2.0.66" : "0.0.0-test";
2350
+ var VERSION = true ? "2.0.67" : "0.0.0-test";
2341
2351
 
2342
2352
  // src/xai-provider.ts
2343
2353
  var xaiErrorStructure = {