@ai-sdk/xai 2.0.66 → 2.0.68

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,19 @@
1
1
  # @ai-sdk/xai
2
2
 
3
+ ## 2.0.68
4
+
5
+ ### Patch Changes
6
+
7
+ - 5543cd1: Add AI Gateway hint to provider READMEs
8
+ - Updated dependencies [5543cd1]
9
+ - @ai-sdk/openai-compatible@1.0.36
10
+
11
+ ## 2.0.67
12
+
13
+ ### Patch Changes
14
+
15
+ - 21ff967: fix (provider/xai): handle mid-stream error chunks
16
+
3
17
  ## 2.0.66
4
18
 
5
19
  ### Patch Changes
package/README.md CHANGED
@@ -3,6 +3,8 @@
3
3
  The **[xAI Grok provider](https://ai-sdk.dev/providers/ai-sdk-providers/xai)** for the [AI SDK](https://ai-sdk.dev/docs)
4
4
  contains language model support for the xAI chat and completion APIs.
5
5
 
6
+ > **Deploying to Vercel?** With Vercel's AI Gateway you can access xAI (and hundreds of models from other providers) — no additional packages, API keys, or extra cost. [Get started with AI Gateway](https://vercel.com/ai-gateway).
7
+
6
8
  ## Setup
7
9
 
8
10
  The xAI Grok provider is available in the `@ai-sdk/xai` module. You can install it with
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.68" : "0.0.0-test";
2341
2351
 
2342
2352
  // src/xai-provider.ts
2343
2353
  var xaiErrorStructure = {