@ai-sdk/xai 3.0.81 → 3.0.82

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-sdk/xai",
3
- "version": "3.0.81",
3
+ "version": "3.0.82",
4
4
  "license": "Apache-2.0",
5
5
  "sideEffects": false,
6
6
  "main": "./dist/index.js",
@@ -29,9 +29,9 @@
29
29
  }
30
30
  },
31
31
  "dependencies": {
32
+ "@ai-sdk/openai-compatible": "2.0.41",
32
33
  "@ai-sdk/provider": "3.0.8",
33
- "@ai-sdk/provider-utils": "4.0.23",
34
- "@ai-sdk/openai-compatible": "2.0.41"
34
+ "@ai-sdk/provider-utils": "4.0.23"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@types/node": "20.17.24",
@@ -538,6 +538,12 @@ export const xaiResponsesChunkSchema = z.union([
538
538
  usage: xaiResponsesUsageSchema.nullish(),
539
539
  }),
540
540
  }),
541
+ z.object({
542
+ type: z.literal('error'),
543
+ code: z.string().nullish(),
544
+ message: z.string(),
545
+ param: z.string().nullish(),
546
+ }),
541
547
  z.object({
542
548
  type: z.literal('response.done'),
543
549
  response: xaiResponsesResponseSchema,
@@ -684,6 +684,11 @@ export class XaiResponsesLanguageModel implements LanguageModelV3 {
684
684
  return;
685
685
  }
686
686
 
687
+ if (event.type === 'error') {
688
+ controller.enqueue({ type: 'error', error: event });
689
+ return;
690
+ }
691
+
687
692
  // Custom tool call input streaming - already handled by output_item events
688
693
  if (
689
694
  event.type === 'response.custom_tool_call_input.delta' ||