@ai-sdk/xai 4.0.0-beta.35 → 4.0.0-beta.37

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,29 @@
1
1
  # @ai-sdk/xai
2
2
 
3
+ ## 4.0.0-beta.37
4
+
5
+ ### Patch Changes
6
+
7
+ - 8d87577: fix(xai): support encrypted reasoning round-trip for ZDR
8
+
9
+ ## 4.0.0-beta.36
10
+
11
+ ### Patch Changes
12
+
13
+ - b3976a2: Add workflow serialization support to all provider models.
14
+
15
+ **`@ai-sdk/provider-utils`:** New `serializeModel()` helper that extracts only serializable properties from a model instance, filtering out functions and objects containing functions. Third-party provider authors can use this to add workflow support to their own models.
16
+
17
+ **All providers:** `headers` is now optional in provider config types. This is non-breaking — existing code that passes `headers` continues to work. Custom provider implementations that construct model configs manually can now omit `headers`, which is useful when models are deserialized from a workflow step boundary where auth is provided separately.
18
+
19
+ All provider model classes now include `WORKFLOW_SERIALIZE` and `WORKFLOW_DESERIALIZE` static methods, enabling them to cross workflow step boundaries without serialization errors.
20
+
21
+ - Updated dependencies [b3976a2]
22
+ - Updated dependencies [ff5eba1]
23
+ - @ai-sdk/provider-utils@5.0.0-beta.20
24
+ - @ai-sdk/openai-compatible@3.0.0-beta.25
25
+ - @ai-sdk/provider@4.0.0-beta.12
26
+
3
27
  ## 4.0.0-beta.35
4
28
 
5
29
  ### Major Changes
package/dist/index.js CHANGED
@@ -22,7 +22,10 @@ import {
22
22
  mapReasoningToProviderEffort,
23
23
  parseProviderOptions,
24
24
  postJsonToApi,
25
- safeParseJSON
25
+ safeParseJSON,
26
+ serializeModelOptions,
27
+ WORKFLOW_SERIALIZE,
28
+ WORKFLOW_DESERIALIZE
26
29
  } from "@ai-sdk/provider-utils";
27
30
  import { z as z3 } from "zod/v4";
28
31
 
@@ -371,7 +374,7 @@ function prepareTools({
371
374
  }
372
375
 
373
376
  // src/xai-chat-language-model.ts
374
- var XaiChatLanguageModel = class {
377
+ var XaiChatLanguageModel = class _XaiChatLanguageModel {
375
378
  constructor(modelId, config) {
376
379
  this.specificationVersion = "v4";
377
380
  this.supportedUrls = {
@@ -380,6 +383,15 @@ var XaiChatLanguageModel = class {
380
383
  this.modelId = modelId;
381
384
  this.config = config;
382
385
  }
386
+ static [WORKFLOW_SERIALIZE](model) {
387
+ return serializeModelOptions({
388
+ modelId: model.modelId,
389
+ config: model.config
390
+ });
391
+ }
392
+ static [WORKFLOW_DESERIALIZE](options) {
393
+ return new _XaiChatLanguageModel(options.modelId, options.config);
394
+ }
383
395
  get provider() {
384
396
  return this.config.provider;
385
397
  }
@@ -507,7 +519,7 @@ var XaiChatLanguageModel = class {
507
519
  };
508
520
  }
509
521
  async doGenerate(options) {
510
- var _a, _b;
522
+ var _a, _b, _c, _d;
511
523
  const { args: body, warnings } = await this.getArgs(options);
512
524
  const url = `${(_a = this.config.baseURL) != null ? _a : "https://api.x.ai/v1"}/chat/completions`;
513
525
  const {
@@ -516,7 +528,7 @@ var XaiChatLanguageModel = class {
516
528
  rawValue: rawResponse
517
529
  } = await postJsonToApi({
518
530
  url,
519
- headers: combineHeaders(this.config.headers(), options.headers),
531
+ headers: combineHeaders((_c = (_b = this.config).headers) == null ? void 0 : _c.call(_b), options.headers),
520
532
  body,
521
533
  failedResponseHandler: xaiFailedResponseHandler,
522
534
  successfulResponseHandler: createJsonResponseHandler(
@@ -578,7 +590,7 @@ var XaiChatLanguageModel = class {
578
590
  content,
579
591
  finishReason: {
580
592
  unified: mapXaiFinishReason(choice.finish_reason),
581
- raw: (_b = choice.finish_reason) != null ? _b : void 0
593
+ raw: (_d = choice.finish_reason) != null ? _d : void 0
582
594
  },
583
595
  usage: response.usage ? convertXaiChatUsage(response.usage) : {
584
596
  inputTokens: { total: 0, noCache: 0, cacheRead: 0, cacheWrite: 0 },
@@ -594,7 +606,7 @@ var XaiChatLanguageModel = class {
594
606
  };
595
607
  }
596
608
  async doStream(options) {
597
- var _a;
609
+ var _a, _b, _c;
598
610
  const { args, warnings } = await this.getArgs(options);
599
611
  const body = {
600
612
  ...args,
@@ -606,7 +618,7 @@ var XaiChatLanguageModel = class {
606
618
  const url = `${(_a = this.config.baseURL) != null ? _a : "https://api.x.ai/v1"}/chat/completions`;
607
619
  const { responseHeaders, value: response } = await postJsonToApi({
608
620
  url,
609
- headers: combineHeaders(this.config.headers(), options.headers),
621
+ headers: combineHeaders((_c = (_b = this.config).headers) == null ? void 0 : _c.call(_b), options.headers),
610
622
  body,
611
623
  failedResponseHandler: xaiFailedResponseHandler,
612
624
  successfulResponseHandler: async ({ response: response2 }) => {
@@ -906,7 +918,10 @@ import {
906
918
  createStatusCodeErrorResponseHandler,
907
919
  getFromApi,
908
920
  parseProviderOptions as parseProviderOptions2,
909
- postJsonToApi as postJsonToApi2
921
+ postJsonToApi as postJsonToApi2,
922
+ serializeModelOptions as serializeModelOptions2,
923
+ WORKFLOW_SERIALIZE as WORKFLOW_SERIALIZE2,
924
+ WORKFLOW_DESERIALIZE as WORKFLOW_DESERIALIZE2
910
925
  } from "@ai-sdk/provider-utils";
911
926
  import { z as z5 } from "zod/v4";
912
927
 
@@ -922,7 +937,7 @@ var xaiImageModelOptions = z4.object({
922
937
  });
923
938
 
924
939
  // src/xai-image-model.ts
925
- var XaiImageModel = class {
940
+ var XaiImageModel = class _XaiImageModel {
926
941
  constructor(modelId, config) {
927
942
  this.modelId = modelId;
928
943
  this.config = config;
@@ -932,6 +947,15 @@ var XaiImageModel = class {
932
947
  get provider() {
933
948
  return this.config.provider;
934
949
  }
950
+ static [WORKFLOW_SERIALIZE2](model) {
951
+ return serializeModelOptions2({
952
+ modelId: model.modelId,
953
+ config: model.config
954
+ });
955
+ }
956
+ static [WORKFLOW_DESERIALIZE2](options) {
957
+ return new _XaiImageModel(options.modelId, options.config);
958
+ }
935
959
  async doGenerate({
936
960
  prompt,
937
961
  n,
@@ -944,7 +968,7 @@ var XaiImageModel = class {
944
968
  files,
945
969
  mask
946
970
  }) {
947
- var _a, _b, _c, _d, _e;
971
+ var _a, _b, _c, _d, _e, _f, _g;
948
972
  const warnings = [];
949
973
  if (size != null) {
950
974
  warnings.push({
@@ -1009,7 +1033,7 @@ var XaiImageModel = class {
1009
1033
  const currentDate = (_d = (_c = (_b = this.config._internal) == null ? void 0 : _b.currentDate) == null ? void 0 : _c.call(_b)) != null ? _d : /* @__PURE__ */ new Date();
1010
1034
  const { value: response, responseHeaders } = await postJsonToApi2({
1011
1035
  url: `${baseURL}${endpoint}`,
1012
- headers: combineHeaders2(this.config.headers(), headers),
1036
+ headers: combineHeaders2((_f = (_e = this.config).headers) == null ? void 0 : _f.call(_e), headers),
1013
1037
  body,
1014
1038
  failedResponseHandler: xaiFailedResponseHandler,
1015
1039
  successfulResponseHandler: createJsonResponseHandler2(
@@ -1037,7 +1061,7 @@ var XaiImageModel = class {
1037
1061
  images: response.data.map((item) => ({
1038
1062
  ...item.revised_prompt ? { revisedPrompt: item.revised_prompt } : {}
1039
1063
  })),
1040
- ...((_e = response.usage) == null ? void 0 : _e.cost_in_usd_ticks) != null ? { costInUsdTicks: response.usage.cost_in_usd_ticks } : {}
1064
+ ...((_g = response.usage) == null ? void 0 : _g.cost_in_usd_ticks) != null ? { costInUsdTicks: response.usage.cost_in_usd_ticks } : {}
1041
1065
  }
1042
1066
  }
1043
1067
  };
@@ -1074,7 +1098,10 @@ import {
1074
1098
  isCustomReasoning as isCustomReasoning2,
1075
1099
  mapReasoningToProviderEffort as mapReasoningToProviderEffort2,
1076
1100
  parseProviderOptions as parseProviderOptions3,
1077
- postJsonToApi as postJsonToApi3
1101
+ postJsonToApi as postJsonToApi3,
1102
+ serializeModelOptions as serializeModelOptions3,
1103
+ WORKFLOW_SERIALIZE as WORKFLOW_SERIALIZE3,
1104
+ WORKFLOW_DESERIALIZE as WORKFLOW_DESERIALIZE3
1078
1105
  } from "@ai-sdk/provider-utils";
1079
1106
 
1080
1107
  // src/responses/convert-to-xai-responses-input.ts
@@ -1089,7 +1116,7 @@ import {
1089
1116
  async function convertToXaiResponsesInput({
1090
1117
  prompt
1091
1118
  }) {
1092
- var _a, _b, _c, _d, _e;
1119
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
1093
1120
  const input = [];
1094
1121
  const inputWarnings = [];
1095
1122
  for (const message of prompt) {
@@ -1174,7 +1201,34 @@ async function convertToXaiResponsesInput({
1174
1201
  case "tool-result": {
1175
1202
  break;
1176
1203
  }
1177
- case "reasoning":
1204
+ case "reasoning": {
1205
+ const itemId = typeof ((_f = (_e = part.providerOptions) == null ? void 0 : _e.xai) == null ? void 0 : _f.itemId) === "string" ? part.providerOptions.xai.itemId : void 0;
1206
+ const encryptedContent = typeof ((_h = (_g = part.providerOptions) == null ? void 0 : _g.xai) == null ? void 0 : _h.reasoningEncryptedContent) === "string" ? part.providerOptions.xai.reasoningEncryptedContent : void 0;
1207
+ if (itemId != null || encryptedContent != null) {
1208
+ const summaryParts = [];
1209
+ if (part.text.length > 0) {
1210
+ summaryParts.push({
1211
+ type: "summary_text",
1212
+ text: part.text
1213
+ });
1214
+ }
1215
+ input.push({
1216
+ type: "reasoning",
1217
+ id: itemId != null ? itemId : "",
1218
+ summary: summaryParts,
1219
+ status: "completed",
1220
+ ...encryptedContent != null && {
1221
+ encrypted_content: encryptedContent
1222
+ }
1223
+ });
1224
+ } else {
1225
+ inputWarnings.push({
1226
+ type: "other",
1227
+ message: "Reasoning parts without itemId or encrypted content cannot be sent back to xAI. Skipping."
1228
+ });
1229
+ }
1230
+ break;
1231
+ }
1178
1232
  case "reasoning-file":
1179
1233
  case "custom":
1180
1234
  case "file": {
@@ -1208,7 +1262,7 @@ async function convertToXaiResponsesInput({
1208
1262
  outputValue = output.value;
1209
1263
  break;
1210
1264
  case "execution-denied":
1211
- outputValue = (_e = output.reason) != null ? _e : "tool execution denied";
1265
+ outputValue = (_i = output.reason) != null ? _i : "tool execution denied";
1212
1266
  break;
1213
1267
  case "json":
1214
1268
  case "error-json":
@@ -1729,6 +1783,8 @@ var xaiLanguageModelResponsesOptions = z7.object({
1729
1783
  topLogprobs: z7.number().int().min(0).max(8).optional(),
1730
1784
  /**
1731
1785
  * Whether to store the input message(s) and model response for later retrieval.
1786
+ * Must be set to `false` for teams with Zero Data Retention (ZDR) enabled,
1787
+ * otherwise the API will return an error.
1732
1788
  * @default true
1733
1789
  */
1734
1790
  store: z7.boolean().optional(),
@@ -2050,7 +2106,7 @@ async function prepareResponsesTools({
2050
2106
  }
2051
2107
 
2052
2108
  // src/responses/xai-responses-language-model.ts
2053
- var XaiResponsesLanguageModel = class {
2109
+ var XaiResponsesLanguageModel = class _XaiResponsesLanguageModel {
2054
2110
  constructor(modelId, config) {
2055
2111
  this.specificationVersion = "v4";
2056
2112
  this.supportedUrls = {
@@ -2059,6 +2115,15 @@ var XaiResponsesLanguageModel = class {
2059
2115
  this.modelId = modelId;
2060
2116
  this.config = config;
2061
2117
  }
2118
+ static [WORKFLOW_SERIALIZE3](model) {
2119
+ return serializeModelOptions3({
2120
+ modelId: model.modelId,
2121
+ config: model.config
2122
+ });
2123
+ }
2124
+ static [WORKFLOW_DESERIALIZE3](options) {
2125
+ return new _XaiResponsesLanguageModel(options.modelId, options.config);
2126
+ }
2062
2127
  get provider() {
2063
2128
  return this.config.provider;
2064
2129
  }
@@ -2075,7 +2140,7 @@ var XaiResponsesLanguageModel = class {
2075
2140
  toolChoice,
2076
2141
  reasoning
2077
2142
  }) {
2078
- var _a, _b, _c, _d, _e, _f, _g, _h;
2143
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
2079
2144
  const warnings = [];
2080
2145
  const options = (_a = await parseProviderOptions3({
2081
2146
  provider: "xai",
@@ -2102,7 +2167,7 @@ var XaiResponsesLanguageModel = class {
2102
2167
  )) == null ? void 0 : _f.name;
2103
2168
  const { input, inputWarnings } = await convertToXaiResponsesInput({
2104
2169
  prompt,
2105
- store: true
2170
+ store: (_g = options.store) != null ? _g : true
2106
2171
  });
2107
2172
  warnings.push(...inputWarnings);
2108
2173
  const {
@@ -2122,7 +2187,7 @@ var XaiResponsesLanguageModel = class {
2122
2187
  include = [...include, "reasoning.encrypted_content"];
2123
2188
  }
2124
2189
  }
2125
- const resolvedReasoningEffort = (_g = options.reasoningEffort) != null ? _g : isCustomReasoning2(reasoning) ? reasoning === "none" ? void 0 : mapReasoningToProviderEffort2({
2190
+ const resolvedReasoningEffort = (_h = options.reasoningEffort) != null ? _h : isCustomReasoning2(reasoning) ? reasoning === "none" ? void 0 : mapReasoningToProviderEffort2({
2126
2191
  reasoning,
2127
2192
  effortMap: {
2128
2193
  minimal: "low",
@@ -2147,7 +2212,7 @@ var XaiResponsesLanguageModel = class {
2147
2212
  format: responseFormat.schema != null ? {
2148
2213
  type: "json_schema",
2149
2214
  strict: true,
2150
- name: (_h = responseFormat.name) != null ? _h : "response",
2215
+ name: (_i = responseFormat.name) != null ? _i : "response",
2151
2216
  description: responseFormat.description,
2152
2217
  schema: responseFormat.schema
2153
2218
  } : { type: "json_object" }
@@ -2190,7 +2255,7 @@ var XaiResponsesLanguageModel = class {
2190
2255
  };
2191
2256
  }
2192
2257
  async doGenerate(options) {
2193
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
2258
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p;
2194
2259
  const {
2195
2260
  args: body,
2196
2261
  warnings,
@@ -2206,7 +2271,7 @@ var XaiResponsesLanguageModel = class {
2206
2271
  rawValue: rawResponse
2207
2272
  } = await postJsonToApi3({
2208
2273
  url: `${(_a = this.config.baseURL) != null ? _a : "https://api.x.ai/v1"}/responses`,
2209
- headers: combineHeaders3(this.config.headers(), options.headers),
2274
+ headers: combineHeaders3((_c = (_b = this.config).headers) == null ? void 0 : _c.call(_b), options.headers),
2210
2275
  body,
2211
2276
  failedResponseHandler: xaiFailedResponseHandler,
2212
2277
  successfulResponseHandler: createJsonResponseHandler3(
@@ -2243,29 +2308,29 @@ var XaiResponsesLanguageModel = class {
2243
2308
  toolCallId: part.id,
2244
2309
  toolName,
2245
2310
  result: {
2246
- queries: (_b = part.queries) != null ? _b : [],
2247
- results: (_d = (_c = part.results) == null ? void 0 : _c.map((result) => ({
2311
+ queries: (_d = part.queries) != null ? _d : [],
2312
+ results: (_f = (_e = part.results) == null ? void 0 : _e.map((result) => ({
2248
2313
  fileId: result.file_id,
2249
2314
  filename: result.filename,
2250
2315
  score: result.score,
2251
2316
  text: result.text
2252
- }))) != null ? _d : null
2317
+ }))) != null ? _f : null
2253
2318
  }
2254
2319
  });
2255
2320
  continue;
2256
2321
  }
2257
2322
  if (part.type === "web_search_call" || part.type === "x_search_call" || part.type === "code_interpreter_call" || part.type === "code_execution_call" || part.type === "view_image_call" || part.type === "view_x_video_call" || part.type === "custom_tool_call" || part.type === "mcp_call") {
2258
- let toolName = (_e = part.name) != null ? _e : "";
2259
- if (webSearchSubTools.includes((_f = part.name) != null ? _f : "") || part.type === "web_search_call") {
2323
+ let toolName = (_g = part.name) != null ? _g : "";
2324
+ if (webSearchSubTools.includes((_h = part.name) != null ? _h : "") || part.type === "web_search_call") {
2260
2325
  toolName = webSearchToolName != null ? webSearchToolName : "web_search";
2261
- } else if (xSearchSubTools.includes((_g = part.name) != null ? _g : "") || part.type === "x_search_call") {
2326
+ } else if (xSearchSubTools.includes((_i = part.name) != null ? _i : "") || part.type === "x_search_call") {
2262
2327
  toolName = xSearchToolName != null ? xSearchToolName : "x_search";
2263
2328
  } else if (part.name === "code_execution" || part.type === "code_interpreter_call" || part.type === "code_execution_call") {
2264
2329
  toolName = codeExecutionToolName != null ? codeExecutionToolName : "code_execution";
2265
2330
  } else if (part.type === "mcp_call") {
2266
- toolName = (_h = mcpToolName != null ? mcpToolName : part.name) != null ? _h : "mcp";
2331
+ toolName = (_j = mcpToolName != null ? mcpToolName : part.name) != null ? _j : "mcp";
2267
2332
  }
2268
- const toolInput = part.type === "custom_tool_call" ? (_i = part.input) != null ? _i : "" : part.type === "mcp_call" ? (_j = part.arguments) != null ? _j : "" : (_k = part.arguments) != null ? _k : "";
2333
+ const toolInput = part.type === "custom_tool_call" ? (_k = part.input) != null ? _k : "" : part.type === "mcp_call" ? (_l = part.arguments) != null ? _l : "" : (_m = part.arguments) != null ? _m : "";
2269
2334
  content.push({
2270
2335
  type: "tool-call",
2271
2336
  toolCallId: part.id,
@@ -2292,7 +2357,7 @@ var XaiResponsesLanguageModel = class {
2292
2357
  sourceType: "url",
2293
2358
  id: this.config.generateId(),
2294
2359
  url: annotation.url,
2295
- title: (_l = annotation.title) != null ? _l : annotation.url
2360
+ title: (_n = annotation.title) != null ? _n : annotation.url
2296
2361
  });
2297
2362
  }
2298
2363
  }
@@ -2311,13 +2376,14 @@ var XaiResponsesLanguageModel = class {
2311
2376
  break;
2312
2377
  }
2313
2378
  case "reasoning": {
2314
- const texts = part.summary.length > 0 ? part.summary.map((s) => s.text) : ((_m = part.content) != null ? _m : []).map((c) => c.text);
2379
+ const texts = part.summary.length > 0 ? part.summary.map((s) => s.text) : ((_o = part.content) != null ? _o : []).map((c) => c.text);
2315
2380
  const reasoningText = texts.filter((text) => text && text.length > 0).join("");
2316
- if (reasoningText) {
2317
- if (part.encrypted_content || part.id) {
2318
- content.push({
2319
- type: "reasoning",
2320
- text: reasoningText,
2381
+ if (reasoningText || part.encrypted_content) {
2382
+ const hasMetadata = part.encrypted_content || part.id;
2383
+ content.push({
2384
+ type: "reasoning",
2385
+ text: reasoningText,
2386
+ ...hasMetadata && {
2321
2387
  providerMetadata: {
2322
2388
  xai: {
2323
2389
  ...part.encrypted_content && {
@@ -2326,13 +2392,8 @@ var XaiResponsesLanguageModel = class {
2326
2392
  ...part.id && { itemId: part.id }
2327
2393
  }
2328
2394
  }
2329
- });
2330
- } else {
2331
- content.push({
2332
- type: "reasoning",
2333
- text: reasoningText
2334
- });
2335
- }
2395
+ }
2396
+ });
2336
2397
  }
2337
2398
  break;
2338
2399
  }
@@ -2345,7 +2406,7 @@ var XaiResponsesLanguageModel = class {
2345
2406
  content,
2346
2407
  finishReason: {
2347
2408
  unified: hasFunctionCall ? "tool-calls" : mapXaiResponsesFinishReason(response.status),
2348
- raw: (_n = response.status) != null ? _n : void 0
2409
+ raw: (_p = response.status) != null ? _p : void 0
2349
2410
  },
2350
2411
  usage: response.usage ? convertXaiResponsesUsage(response.usage) : {
2351
2412
  inputTokens: { total: 0, noCache: 0, cacheRead: 0, cacheWrite: 0 },
@@ -2361,7 +2422,7 @@ var XaiResponsesLanguageModel = class {
2361
2422
  };
2362
2423
  }
2363
2424
  async doStream(options) {
2364
- var _a;
2425
+ var _a, _b, _c;
2365
2426
  const {
2366
2427
  args,
2367
2428
  warnings,
@@ -2377,7 +2438,7 @@ var XaiResponsesLanguageModel = class {
2377
2438
  };
2378
2439
  const { responseHeaders, value: response } = await postJsonToApi3({
2379
2440
  url: `${(_a = this.config.baseURL) != null ? _a : "https://api.x.ai/v1"}/responses`,
2380
- headers: combineHeaders3(this.config.headers(), options.headers),
2441
+ headers: combineHeaders3((_c = (_b = this.config).headers) == null ? void 0 : _c.call(_b), options.headers),
2381
2442
  body,
2382
2443
  failedResponseHandler: xaiFailedResponseHandler,
2383
2444
  successfulResponseHandler: createEventSourceResponseHandler2(
@@ -2405,7 +2466,7 @@ var XaiResponsesLanguageModel = class {
2405
2466
  controller.enqueue({ type: "stream-start", warnings });
2406
2467
  },
2407
2468
  transform(chunk, controller) {
2408
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
2469
+ var _a2, _b2, _c2, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o;
2409
2470
  if (options.includeRawChunks) {
2410
2471
  controller.enqueue({ type: "raw", rawValue: chunk.rawValue });
2411
2472
  }
@@ -2523,7 +2584,7 @@ var XaiResponsesLanguageModel = class {
2523
2584
  sourceType: "url",
2524
2585
  id: self.config.generateId(),
2525
2586
  url: annotation.url,
2526
- title: (_b = annotation.title) != null ? _b : annotation.url
2587
+ title: (_b2 = annotation.title) != null ? _b2 : annotation.url
2527
2588
  });
2528
2589
  }
2529
2590
  return;
@@ -2534,7 +2595,7 @@ var XaiResponsesLanguageModel = class {
2534
2595
  usage = convertXaiResponsesUsage(response2.usage);
2535
2596
  }
2536
2597
  if (event.type === "response.incomplete") {
2537
- const reason = "incomplete_details" in response2 ? (_c = response2.incomplete_details) == null ? void 0 : _c.reason : void 0;
2598
+ const reason = "incomplete_details" in response2 ? (_c2 = response2.incomplete_details) == null ? void 0 : _c2.reason : void 0;
2538
2599
  finishReason = {
2539
2600
  unified: reason ? mapXaiResponsesFinishReason(reason) : "other",
2540
2601
  raw: reason != null ? reason : "incomplete"
@@ -2851,7 +2912,7 @@ var xaiTools = {
2851
2912
  };
2852
2913
 
2853
2914
  // src/version.ts
2854
- var VERSION = true ? "4.0.0-beta.35" : "0.0.0-test";
2915
+ var VERSION = true ? "4.0.0-beta.37" : "0.0.0-test";
2855
2916
 
2856
2917
  // src/files/xai-files.ts
2857
2918
  import {