@ai-sdk/xai 3.0.103 → 3.0.105

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/dist/index.mjs CHANGED
@@ -18,18 +18,37 @@ import {
18
18
  createEventSourceResponseHandler,
19
19
  createJsonResponseHandler,
20
20
  extractResponseHeaders,
21
- parseProviderOptions,
21
+ parseProviderOptions as parseProviderOptions2,
22
22
  postJsonToApi,
23
23
  safeParseJSON
24
24
  } from "@ai-sdk/provider-utils";
25
- import { z as z3 } from "zod/v4";
25
+ import { z as z4 } from "zod/v4";
26
26
 
27
27
  // src/convert-to-xai-chat-messages.ts
28
28
  import {
29
29
  UnsupportedFunctionalityError
30
30
  } from "@ai-sdk/provider";
31
- import { convertToBase64 } from "@ai-sdk/provider-utils";
32
- function convertToXaiChatMessages(prompt) {
31
+ import { convertToBase64, parseProviderOptions } from "@ai-sdk/provider-utils";
32
+
33
+ // src/xai-file-part-options.ts
34
+ import { z } from "zod/v4";
35
+ var xaiFilePartProviderOptions = z.object({
36
+ /**
37
+ * Controls the resolution at which the model processes the image.
38
+ * `low` processes the image at reduced resolution and consumes fewer
39
+ * input tokens, `high` processes the image at full resolution, and
40
+ * `auto` lets the API decide. Defaults to full resolution when not set.
41
+ *
42
+ * Note: the xAI API silently ignores invalid values, so the value is
43
+ * validated client-side.
44
+ *
45
+ * @see https://docs.x.ai/developers/model-capabilities/images/understanding
46
+ */
47
+ imageDetail: z.enum(["low", "high", "auto"]).optional()
48
+ });
49
+
50
+ // src/convert-to-xai-chat-messages.ts
51
+ async function convertToXaiChatMessages(prompt) {
33
52
  var _a;
34
53
  const messages = [];
35
54
  const warnings = [];
@@ -44,31 +63,40 @@ function convertToXaiChatMessages(prompt) {
44
63
  messages.push({ role: "user", content: content[0].text });
45
64
  break;
46
65
  }
47
- messages.push({
48
- role: "user",
49
- content: content.map((part) => {
50
- switch (part.type) {
51
- case "text": {
52
- return { type: "text", text: part.text };
53
- }
54
- case "file": {
55
- if (part.mediaType.startsWith("image/")) {
56
- const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType;
57
- return {
58
- type: "image_url",
59
- image_url: {
60
- url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${convertToBase64(part.data)}`
66
+ const userContent = [];
67
+ for (const part of content) {
68
+ switch (part.type) {
69
+ case "text": {
70
+ userContent.push({ type: "text", text: part.text });
71
+ break;
72
+ }
73
+ case "file": {
74
+ if (part.mediaType.startsWith("image/")) {
75
+ const mediaType = part.mediaType === "image/*" ? "image/jpeg" : part.mediaType;
76
+ const filePartOptions = await parseProviderOptions({
77
+ provider: "xai",
78
+ providerOptions: part.providerOptions,
79
+ schema: xaiFilePartProviderOptions
80
+ });
81
+ userContent.push({
82
+ type: "image_url",
83
+ image_url: {
84
+ url: part.data instanceof URL ? part.data.toString() : `data:${mediaType};base64,${convertToBase64(part.data)}`,
85
+ ...(filePartOptions == null ? void 0 : filePartOptions.imageDetail) != null && {
86
+ detail: filePartOptions.imageDetail
61
87
  }
62
- };
63
- } else {
64
- throw new UnsupportedFunctionalityError({
65
- functionality: `file part media type ${part.mediaType}`
66
- });
67
- }
88
+ }
89
+ });
90
+ } else {
91
+ throw new UnsupportedFunctionalityError({
92
+ functionality: `file part media type ${part.mediaType}`
93
+ });
68
94
  }
95
+ break;
69
96
  }
70
- })
71
- });
97
+ }
98
+ }
99
+ messages.push({ role: "user", content: userContent });
72
100
  break;
73
101
  }
74
102
  case "assistant": {
@@ -113,7 +141,7 @@ function convertToXaiChatMessages(prompt) {
113
141
  contentValue = output.value;
114
142
  break;
115
143
  case "execution-denied":
116
- contentValue = (_a = output.reason) != null ? _a : "Tool execution denied.";
144
+ contentValue = (_a = output.reason) != null ? _a : "Tool call execution denied.";
117
145
  break;
118
146
  case "content":
119
147
  case "json":
@@ -193,53 +221,53 @@ function mapXaiFinishReason(finishReason) {
193
221
  }
194
222
 
195
223
  // src/xai-chat-options.ts
196
- import { z } from "zod/v4";
197
- var webSourceSchema = z.object({
198
- type: z.literal("web"),
199
- country: z.string().length(2).optional(),
200
- excludedWebsites: z.array(z.string()).max(5).optional(),
201
- allowedWebsites: z.array(z.string()).max(5).optional(),
202
- safeSearch: z.boolean().optional()
224
+ import { z as z2 } from "zod/v4";
225
+ var webSourceSchema = z2.object({
226
+ type: z2.literal("web"),
227
+ country: z2.string().length(2).optional(),
228
+ excludedWebsites: z2.array(z2.string()).max(5).optional(),
229
+ allowedWebsites: z2.array(z2.string()).max(5).optional(),
230
+ safeSearch: z2.boolean().optional()
203
231
  });
204
- var xSourceSchema = z.object({
205
- type: z.literal("x"),
206
- excludedXHandles: z.array(z.string()).optional(),
207
- includedXHandles: z.array(z.string()).optional(),
208
- postFavoriteCount: z.number().int().optional(),
209
- postViewCount: z.number().int().optional(),
232
+ var xSourceSchema = z2.object({
233
+ type: z2.literal("x"),
234
+ excludedXHandles: z2.array(z2.string()).optional(),
235
+ includedXHandles: z2.array(z2.string()).optional(),
236
+ postFavoriteCount: z2.number().int().optional(),
237
+ postViewCount: z2.number().int().optional(),
210
238
  /**
211
239
  * @deprecated use `includedXHandles` instead
212
240
  */
213
- xHandles: z.array(z.string()).optional()
241
+ xHandles: z2.array(z2.string()).optional()
214
242
  });
215
- var newsSourceSchema = z.object({
216
- type: z.literal("news"),
217
- country: z.string().length(2).optional(),
218
- excludedWebsites: z.array(z.string()).max(5).optional(),
219
- safeSearch: z.boolean().optional()
243
+ var newsSourceSchema = z2.object({
244
+ type: z2.literal("news"),
245
+ country: z2.string().length(2).optional(),
246
+ excludedWebsites: z2.array(z2.string()).max(5).optional(),
247
+ safeSearch: z2.boolean().optional()
220
248
  });
221
- var rssSourceSchema = z.object({
222
- type: z.literal("rss"),
223
- links: z.array(z.string().url()).max(1)
249
+ var rssSourceSchema = z2.object({
250
+ type: z2.literal("rss"),
251
+ links: z2.array(z2.string().url()).max(1)
224
252
  // currently only supports one RSS link
225
253
  });
226
- var searchSourceSchema = z.discriminatedUnion("type", [
254
+ var searchSourceSchema = z2.discriminatedUnion("type", [
227
255
  webSourceSchema,
228
256
  xSourceSchema,
229
257
  newsSourceSchema,
230
258
  rssSourceSchema
231
259
  ]);
232
- var xaiLanguageModelChatOptions = z.object({
233
- reasoningEffort: z.enum(["none", "low", "medium", "high"]).optional(),
234
- logprobs: z.boolean().optional(),
235
- topLogprobs: z.number().int().min(0).max(8).optional(),
260
+ var xaiLanguageModelChatOptions = z2.object({
261
+ reasoningEffort: z2.enum(["none", "low", "medium", "high"]).optional(),
262
+ logprobs: z2.boolean().optional(),
263
+ topLogprobs: z2.number().int().min(0).max(8).optional(),
236
264
  /**
237
265
  * Whether to enable parallel function calling during tool use.
238
266
  * When true, the model can call multiple functions in parallel.
239
267
  * When false, the model will call functions sequentially.
240
268
  * Defaults to true.
241
269
  */
242
- parallel_function_calling: z.boolean().optional(),
270
+ parallel_function_calling: z2.boolean().optional(),
243
271
  /**
244
272
  * @deprecated xAI has deprecated Live Search (`search_parameters`) in favor
245
273
  * of the Agent Tools API. Requests using this option now return a "Live
@@ -249,32 +277,32 @@ var xaiLanguageModelChatOptions = z.object({
249
277
  *
250
278
  * @see https://docs.x.ai/docs/guides/tools/overview
251
279
  */
252
- searchParameters: z.object({
280
+ searchParameters: z2.object({
253
281
  /**
254
282
  * search mode preference
255
283
  * - "off": disables search completely
256
284
  * - "auto": model decides whether to search (default)
257
285
  * - "on": always enables search
258
286
  */
259
- mode: z.enum(["off", "auto", "on"]),
287
+ mode: z2.enum(["off", "auto", "on"]),
260
288
  /**
261
289
  * whether to return citations in the response
262
290
  * defaults to true
263
291
  */
264
- returnCitations: z.boolean().optional(),
292
+ returnCitations: z2.boolean().optional(),
265
293
  /**
266
294
  * start date for search data (ISO8601 format: YYYY-MM-DD)
267
295
  */
268
- fromDate: z.string().optional(),
296
+ fromDate: z2.string().optional(),
269
297
  /**
270
298
  * end date for search data (ISO8601 format: YYYY-MM-DD)
271
299
  */
272
- toDate: z.string().optional(),
300
+ toDate: z2.string().optional(),
273
301
  /**
274
302
  * maximum number of search results to consider
275
303
  * defaults to 20
276
304
  */
277
- maxSearchResults: z.number().min(1).max(50).optional(),
305
+ maxSearchResults: z2.number().min(1).max(50).optional(),
278
306
  /**
279
307
  * data sources to search from.
280
308
  * defaults to [{ type: 'web' }, { type: 'x' }] if not specified.
@@ -282,26 +310,26 @@ var xaiLanguageModelChatOptions = z.object({
282
310
  * @example
283
311
  * sources: [{ type: 'web', country: 'US' }, { type: 'x' }]
284
312
  */
285
- sources: z.array(searchSourceSchema).optional()
313
+ sources: z2.array(searchSourceSchema).optional()
286
314
  }).optional()
287
315
  });
288
316
 
289
317
  // src/xai-error.ts
290
318
  import { createJsonErrorResponseHandler } from "@ai-sdk/provider-utils";
291
- import { z as z2 } from "zod/v4";
292
- var chatCompletionsErrorSchema = z2.object({
293
- error: z2.object({
294
- message: z2.string(),
295
- type: z2.string().nullish(),
296
- param: z2.any().nullish(),
297
- code: z2.union([z2.string(), z2.number()]).nullish()
319
+ import { z as z3 } from "zod/v4";
320
+ var chatCompletionsErrorSchema = z3.object({
321
+ error: z3.object({
322
+ message: z3.string(),
323
+ type: z3.string().nullish(),
324
+ param: z3.any().nullish(),
325
+ code: z3.union([z3.string(), z3.number()]).nullish()
298
326
  })
299
327
  });
300
- var responsesErrorSchema = z2.object({
301
- code: z2.string(),
302
- error: z2.string()
328
+ var responsesErrorSchema = z3.object({
329
+ code: z3.string(),
330
+ error: z3.string()
303
331
  });
304
- var xaiErrorDataSchema = z2.union([
332
+ var xaiErrorDataSchema = z3.union([
305
333
  chatCompletionsErrorSchema,
306
334
  responsesErrorSchema
307
335
  ]);
@@ -420,7 +448,7 @@ var XaiChatLanguageModel = class {
420
448
  }) {
421
449
  var _a, _b, _c;
422
450
  const warnings = [];
423
- const options = (_a = await parseProviderOptions({
451
+ const options = (_a = await parseProviderOptions2({
424
452
  provider: "xai",
425
453
  providerOptions,
426
454
  schema: xaiLanguageModelChatOptions
@@ -437,7 +465,7 @@ var XaiChatLanguageModel = class {
437
465
  if (stopSequences != null) {
438
466
  warnings.push({ type: "unsupported", feature: "stopSequences" });
439
467
  }
440
- const { messages, warnings: messageWarnings } = convertToXaiChatMessages(prompt);
468
+ const { messages, warnings: messageWarnings } = await convertToXaiChatMessages(prompt);
441
469
  warnings.push(...messageWarnings);
442
470
  const {
443
471
  tools: xaiTools2,
@@ -825,85 +853,85 @@ var XaiChatLanguageModel = class {
825
853
  };
826
854
  }
827
855
  };
828
- var xaiUsageSchema = z3.object({
829
- prompt_tokens: z3.number(),
830
- completion_tokens: z3.number(),
831
- total_tokens: z3.number(),
832
- prompt_tokens_details: z3.object({
833
- text_tokens: z3.number().nullish(),
834
- audio_tokens: z3.number().nullish(),
835
- image_tokens: z3.number().nullish(),
836
- cached_tokens: z3.number().nullish()
856
+ var xaiUsageSchema = z4.object({
857
+ prompt_tokens: z4.number(),
858
+ completion_tokens: z4.number(),
859
+ total_tokens: z4.number(),
860
+ prompt_tokens_details: z4.object({
861
+ text_tokens: z4.number().nullish(),
862
+ audio_tokens: z4.number().nullish(),
863
+ image_tokens: z4.number().nullish(),
864
+ cached_tokens: z4.number().nullish()
837
865
  }).nullish(),
838
- completion_tokens_details: z3.object({
839
- reasoning_tokens: z3.number().nullish(),
840
- audio_tokens: z3.number().nullish(),
841
- accepted_prediction_tokens: z3.number().nullish(),
842
- rejected_prediction_tokens: z3.number().nullish()
866
+ completion_tokens_details: z4.object({
867
+ reasoning_tokens: z4.number().nullish(),
868
+ audio_tokens: z4.number().nullish(),
869
+ accepted_prediction_tokens: z4.number().nullish(),
870
+ rejected_prediction_tokens: z4.number().nullish()
843
871
  }).nullish()
844
872
  });
845
- var xaiChatResponseSchema = z3.object({
846
- id: z3.string().nullish(),
847
- created: z3.number().nullish(),
848
- model: z3.string().nullish(),
849
- choices: z3.array(
850
- z3.object({
851
- message: z3.object({
852
- role: z3.literal("assistant"),
853
- content: z3.string().nullish(),
854
- reasoning_content: z3.string().nullish(),
855
- tool_calls: z3.array(
856
- z3.object({
857
- id: z3.string(),
858
- type: z3.literal("function"),
859
- function: z3.object({
860
- name: z3.string(),
861
- arguments: z3.string()
873
+ var xaiChatResponseSchema = z4.object({
874
+ id: z4.string().nullish(),
875
+ created: z4.number().nullish(),
876
+ model: z4.string().nullish(),
877
+ choices: z4.array(
878
+ z4.object({
879
+ message: z4.object({
880
+ role: z4.literal("assistant"),
881
+ content: z4.string().nullish(),
882
+ reasoning_content: z4.string().nullish(),
883
+ tool_calls: z4.array(
884
+ z4.object({
885
+ id: z4.string(),
886
+ type: z4.literal("function"),
887
+ function: z4.object({
888
+ name: z4.string(),
889
+ arguments: z4.string()
862
890
  })
863
891
  })
864
892
  ).nullish()
865
893
  }),
866
- index: z3.number(),
867
- finish_reason: z3.string().nullish()
894
+ index: z4.number(),
895
+ finish_reason: z4.string().nullish()
868
896
  })
869
897
  ).nullish(),
870
- object: z3.literal("chat.completion").nullish(),
898
+ object: z4.literal("chat.completion").nullish(),
871
899
  usage: xaiUsageSchema.nullish(),
872
- citations: z3.array(z3.string().url()).nullish(),
873
- code: z3.string().nullish(),
874
- error: z3.string().nullish()
900
+ citations: z4.array(z4.string().url()).nullish(),
901
+ code: z4.string().nullish(),
902
+ error: z4.string().nullish()
875
903
  });
876
- var xaiChatChunkSchema = z3.object({
877
- id: z3.string().nullish(),
878
- created: z3.number().nullish(),
879
- model: z3.string().nullish(),
880
- choices: z3.array(
881
- z3.object({
882
- delta: z3.object({
883
- role: z3.enum(["assistant"]).optional(),
884
- content: z3.string().nullish(),
885
- reasoning_content: z3.string().nullish(),
886
- tool_calls: z3.array(
887
- z3.object({
888
- id: z3.string(),
889
- type: z3.literal("function"),
890
- function: z3.object({
891
- name: z3.string(),
892
- arguments: z3.string()
904
+ var xaiChatChunkSchema = z4.object({
905
+ id: z4.string().nullish(),
906
+ created: z4.number().nullish(),
907
+ model: z4.string().nullish(),
908
+ choices: z4.array(
909
+ z4.object({
910
+ delta: z4.object({
911
+ role: z4.enum(["assistant"]).optional(),
912
+ content: z4.string().nullish(),
913
+ reasoning_content: z4.string().nullish(),
914
+ tool_calls: z4.array(
915
+ z4.object({
916
+ id: z4.string(),
917
+ type: z4.literal("function"),
918
+ function: z4.object({
919
+ name: z4.string(),
920
+ arguments: z4.string()
893
921
  })
894
922
  })
895
923
  ).nullish()
896
924
  }),
897
- finish_reason: z3.string().nullish(),
898
- index: z3.number()
925
+ finish_reason: z4.string().nullish(),
926
+ index: z4.number()
899
927
  })
900
928
  ),
901
929
  usage: xaiUsageSchema.nullish(),
902
- citations: z3.array(z3.string().url()).nullish()
930
+ citations: z4.array(z4.string().url()).nullish()
903
931
  });
904
- var xaiStreamErrorSchema = z3.object({
905
- code: z3.string(),
906
- error: z3.string()
932
+ var xaiStreamErrorSchema = z4.object({
933
+ code: z4.string(),
934
+ error: z4.string()
907
935
  });
908
936
 
909
937
  // src/xai-image-model.ts
@@ -914,20 +942,20 @@ import {
914
942
  createJsonResponseHandler as createJsonResponseHandler2,
915
943
  createStatusCodeErrorResponseHandler,
916
944
  getFromApi,
917
- parseProviderOptions as parseProviderOptions2,
945
+ parseProviderOptions as parseProviderOptions3,
918
946
  postJsonToApi as postJsonToApi2
919
947
  } from "@ai-sdk/provider-utils";
920
- import { z as z5 } from "zod/v4";
948
+ import { z as z6 } from "zod/v4";
921
949
 
922
950
  // src/xai-image-options.ts
923
- import { z as z4 } from "zod/v4";
924
- var xaiImageModelOptions = z4.object({
925
- aspect_ratio: z4.string().optional(),
926
- output_format: z4.string().optional(),
927
- sync_mode: z4.boolean().optional(),
928
- resolution: z4.enum(["1k", "2k"]).optional(),
929
- quality: z4.enum(["low", "medium", "high"]).optional(),
930
- user: z4.string().optional()
951
+ import { z as z5 } from "zod/v4";
952
+ var xaiImageModelOptions = z5.object({
953
+ aspect_ratio: z5.string().optional(),
954
+ output_format: z5.string().optional(),
955
+ sync_mode: z5.boolean().optional(),
956
+ resolution: z5.enum(["1k", "2k"]).optional(),
957
+ quality: z5.enum(["low", "medium", "high"]).optional(),
958
+ user: z5.string().optional()
931
959
  });
932
960
 
933
961
  // src/xai-image-model.ts
@@ -974,7 +1002,7 @@ var XaiImageModel = class {
974
1002
  feature: "mask"
975
1003
  });
976
1004
  }
977
- const xaiOptions = await parseProviderOptions2({
1005
+ const xaiOptions = await parseProviderOptions3({
978
1006
  provider: "xai",
979
1007
  providerOptions,
980
1008
  schema: xaiImageModelOptions
@@ -1062,16 +1090,16 @@ var XaiImageModel = class {
1062
1090
  return value;
1063
1091
  }
1064
1092
  };
1065
- var xaiImageResponseSchema = z5.object({
1066
- data: z5.array(
1067
- z5.object({
1068
- url: z5.string().nullish(),
1069
- b64_json: z5.string().nullish(),
1070
- revised_prompt: z5.string().nullish()
1093
+ var xaiImageResponseSchema = z6.object({
1094
+ data: z6.array(
1095
+ z6.object({
1096
+ url: z6.string().nullish(),
1097
+ b64_json: z6.string().nullish(),
1098
+ revised_prompt: z6.string().nullish()
1071
1099
  })
1072
1100
  ),
1073
- usage: z5.object({
1074
- cost_in_usd_ticks: z5.number().nullish()
1101
+ usage: z6.object({
1102
+ cost_in_usd_ticks: z6.number().nullish()
1075
1103
  }).nullish()
1076
1104
  });
1077
1105
 
@@ -1080,7 +1108,7 @@ import {
1080
1108
  combineHeaders as combineHeaders3,
1081
1109
  createEventSourceResponseHandler as createEventSourceResponseHandler2,
1082
1110
  createJsonResponseHandler as createJsonResponseHandler3,
1083
- parseProviderOptions as parseProviderOptions3,
1111
+ parseProviderOptions as parseProviderOptions5,
1084
1112
  postJsonToApi as postJsonToApi3
1085
1113
  } from "@ai-sdk/provider-utils";
1086
1114
 
@@ -1088,7 +1116,7 @@ import {
1088
1116
  import {
1089
1117
  UnsupportedFunctionalityError as UnsupportedFunctionalityError3
1090
1118
  } from "@ai-sdk/provider";
1091
- import { convertToBase64 as convertToBase642 } from "@ai-sdk/provider-utils";
1119
+ import { convertToBase64 as convertToBase642, parseProviderOptions as parseProviderOptions4 } from "@ai-sdk/provider-utils";
1092
1120
  async function convertToXaiResponsesInput({
1093
1121
  prompt
1094
1122
  }) {
@@ -1116,7 +1144,18 @@ async function convertToXaiResponsesInput({
1116
1144
  if (block.mediaType.startsWith("image/")) {
1117
1145
  const mediaType = block.mediaType === "image/*" ? "image/jpeg" : block.mediaType;
1118
1146
  const imageUrl = block.data instanceof URL ? block.data.toString() : `data:${mediaType};base64,${convertToBase642(block.data)}`;
1119
- contentParts.push({ type: "input_image", image_url: imageUrl });
1147
+ const filePartOptions = await parseProviderOptions4({
1148
+ provider: "xai",
1149
+ providerOptions: block.providerOptions,
1150
+ schema: xaiFilePartProviderOptions
1151
+ });
1152
+ contentParts.push({
1153
+ type: "input_image",
1154
+ image_url: imageUrl,
1155
+ ...(filePartOptions == null ? void 0 : filePartOptions.imageDetail) != null && {
1156
+ detail: filePartOptions.imageDetail
1157
+ }
1158
+ });
1120
1159
  } else if (block.data instanceof URL) {
1121
1160
  contentParts.push({
1122
1161
  type: "input_file",
@@ -1314,460 +1353,461 @@ function mapXaiResponsesFinishReason(finishReason) {
1314
1353
  }
1315
1354
 
1316
1355
  // src/responses/xai-responses-api.ts
1317
- import { z as z6 } from "zod/v4";
1318
- var annotationSchema = z6.union([
1319
- z6.object({
1320
- type: z6.literal("url_citation"),
1321
- url: z6.string(),
1322
- title: z6.string().optional()
1356
+ import { z as z7 } from "zod/v4";
1357
+ var annotationSchema = z7.union([
1358
+ z7.object({
1359
+ type: z7.literal("url_citation"),
1360
+ url: z7.string(),
1361
+ title: z7.string().optional()
1323
1362
  }),
1324
- z6.object({
1325
- type: z6.string()
1363
+ z7.object({
1364
+ type: z7.string()
1326
1365
  })
1327
1366
  ]);
1328
- var messageContentPartSchema = z6.object({
1329
- type: z6.string(),
1330
- text: z6.string().optional(),
1331
- logprobs: z6.array(z6.any()).optional(),
1332
- annotations: z6.array(annotationSchema).optional()
1367
+ var messageContentPartSchema = z7.object({
1368
+ type: z7.string(),
1369
+ text: z7.string().optional(),
1370
+ logprobs: z7.array(z7.any()).optional(),
1371
+ annotations: z7.array(annotationSchema).optional()
1333
1372
  });
1334
- var reasoningSummaryPartSchema = z6.object({
1335
- type: z6.string(),
1336
- text: z6.string()
1373
+ var reasoningSummaryPartSchema = z7.object({
1374
+ type: z7.string(),
1375
+ text: z7.string()
1337
1376
  });
1338
- var toolCallSchema = z6.object({
1339
- name: z6.string().optional(),
1340
- arguments: z6.string().optional(),
1341
- input: z6.string().optional(),
1342
- call_id: z6.string().optional(),
1343
- id: z6.string(),
1344
- status: z6.string(),
1345
- action: z6.any().optional()
1377
+ var toolCallSchema = z7.object({
1378
+ name: z7.string().optional(),
1379
+ arguments: z7.string().optional(),
1380
+ input: z7.string().optional(),
1381
+ call_id: z7.string().optional(),
1382
+ id: z7.string(),
1383
+ status: z7.string(),
1384
+ action: z7.any().optional()
1346
1385
  });
1347
- var mcpCallSchema = z6.object({
1348
- name: z6.string().optional(),
1349
- arguments: z6.string().optional(),
1350
- output: z6.string().optional(),
1351
- error: z6.string().optional(),
1352
- id: z6.string(),
1353
- status: z6.string(),
1354
- server_label: z6.string().optional()
1386
+ var mcpCallSchema = z7.object({
1387
+ name: z7.string().optional(),
1388
+ arguments: z7.string().optional(),
1389
+ output: z7.string().optional(),
1390
+ error: z7.string().optional(),
1391
+ id: z7.string(),
1392
+ status: z7.string(),
1393
+ server_label: z7.string().optional()
1355
1394
  });
1356
- var outputItemSchema = z6.discriminatedUnion("type", [
1357
- z6.object({
1358
- type: z6.literal("web_search_call"),
1395
+ var outputItemSchema = z7.discriminatedUnion("type", [
1396
+ z7.object({
1397
+ type: z7.literal("web_search_call"),
1359
1398
  ...toolCallSchema.shape
1360
1399
  }),
1361
- z6.object({
1362
- type: z6.literal("x_search_call"),
1400
+ z7.object({
1401
+ type: z7.literal("x_search_call"),
1363
1402
  ...toolCallSchema.shape
1364
1403
  }),
1365
- z6.object({
1366
- type: z6.literal("code_interpreter_call"),
1404
+ z7.object({
1405
+ type: z7.literal("code_interpreter_call"),
1367
1406
  ...toolCallSchema.shape
1368
1407
  }),
1369
- z6.object({
1370
- type: z6.literal("code_execution_call"),
1408
+ z7.object({
1409
+ type: z7.literal("code_execution_call"),
1371
1410
  ...toolCallSchema.shape
1372
1411
  }),
1373
- z6.object({
1374
- type: z6.literal("view_image_call"),
1412
+ z7.object({
1413
+ type: z7.literal("view_image_call"),
1375
1414
  ...toolCallSchema.shape
1376
1415
  }),
1377
- z6.object({
1378
- type: z6.literal("view_x_video_call"),
1416
+ z7.object({
1417
+ type: z7.literal("view_x_video_call"),
1379
1418
  ...toolCallSchema.shape
1380
1419
  }),
1381
- z6.object({
1382
- type: z6.literal("file_search_call"),
1383
- id: z6.string(),
1384
- status: z6.string(),
1385
- queries: z6.array(z6.string()).optional(),
1386
- results: z6.array(
1387
- z6.object({
1388
- file_id: z6.string(),
1389
- filename: z6.string(),
1390
- score: z6.number(),
1391
- text: z6.string()
1420
+ z7.object({
1421
+ type: z7.literal("file_search_call"),
1422
+ id: z7.string(),
1423
+ status: z7.string(),
1424
+ queries: z7.array(z7.string()).optional(),
1425
+ results: z7.array(
1426
+ z7.object({
1427
+ file_id: z7.string(),
1428
+ filename: z7.string(),
1429
+ score: z7.number(),
1430
+ text: z7.string()
1392
1431
  })
1393
1432
  ).nullish()
1394
1433
  }),
1395
- z6.object({
1396
- type: z6.literal("custom_tool_call"),
1434
+ z7.object({
1435
+ type: z7.literal("custom_tool_call"),
1397
1436
  ...toolCallSchema.shape
1398
1437
  }),
1399
- z6.object({
1400
- type: z6.literal("mcp_call"),
1438
+ z7.object({
1439
+ type: z7.literal("mcp_call"),
1401
1440
  ...mcpCallSchema.shape
1402
1441
  }),
1403
- z6.object({
1404
- type: z6.literal("message"),
1405
- role: z6.string(),
1406
- content: z6.array(messageContentPartSchema),
1407
- id: z6.string(),
1408
- status: z6.string()
1442
+ z7.object({
1443
+ type: z7.literal("message"),
1444
+ role: z7.string(),
1445
+ content: z7.array(messageContentPartSchema),
1446
+ id: z7.string(),
1447
+ status: z7.string()
1409
1448
  }),
1410
- z6.object({
1411
- type: z6.literal("function_call"),
1412
- name: z6.string(),
1413
- arguments: z6.string(),
1414
- call_id: z6.string(),
1415
- id: z6.string()
1449
+ z7.object({
1450
+ type: z7.literal("function_call"),
1451
+ name: z7.string(),
1452
+ arguments: z7.string(),
1453
+ call_id: z7.string(),
1454
+ id: z7.string()
1416
1455
  }),
1417
- z6.object({
1418
- type: z6.literal("reasoning"),
1419
- id: z6.string(),
1420
- summary: z6.array(reasoningSummaryPartSchema),
1421
- status: z6.string(),
1422
- encrypted_content: z6.string().nullish()
1456
+ z7.object({
1457
+ type: z7.literal("reasoning"),
1458
+ id: z7.string(),
1459
+ summary: z7.array(reasoningSummaryPartSchema),
1460
+ content: z7.array(z7.object({ type: z7.string(), text: z7.string() })).nullish(),
1461
+ status: z7.string(),
1462
+ encrypted_content: z7.string().nullish()
1423
1463
  })
1424
1464
  ]);
1425
- var xaiResponsesUsageSchema = z6.object({
1426
- input_tokens: z6.number(),
1427
- output_tokens: z6.number(),
1428
- total_tokens: z6.number().optional(),
1429
- input_tokens_details: z6.object({
1430
- cached_tokens: z6.number().optional()
1465
+ var xaiResponsesUsageSchema = z7.object({
1466
+ input_tokens: z7.number(),
1467
+ output_tokens: z7.number(),
1468
+ total_tokens: z7.number().optional(),
1469
+ input_tokens_details: z7.object({
1470
+ cached_tokens: z7.number().optional()
1431
1471
  }).optional(),
1432
- output_tokens_details: z6.object({
1433
- reasoning_tokens: z6.number().optional()
1472
+ output_tokens_details: z7.object({
1473
+ reasoning_tokens: z7.number().optional()
1434
1474
  }).optional(),
1435
- num_sources_used: z6.number().optional(),
1436
- num_server_side_tools_used: z6.number().optional()
1475
+ num_sources_used: z7.number().optional(),
1476
+ num_server_side_tools_used: z7.number().optional()
1437
1477
  });
1438
- var xaiResponsesResponseSchema = z6.object({
1439
- id: z6.string().nullish(),
1440
- created_at: z6.number().nullish(),
1441
- model: z6.string().nullish(),
1442
- object: z6.literal("response"),
1443
- output: z6.array(outputItemSchema),
1478
+ var xaiResponsesResponseSchema = z7.object({
1479
+ id: z7.string().nullish(),
1480
+ created_at: z7.number().nullish(),
1481
+ model: z7.string().nullish(),
1482
+ object: z7.literal("response"),
1483
+ output: z7.array(outputItemSchema),
1444
1484
  usage: xaiResponsesUsageSchema.nullish(),
1445
- status: z6.string()
1485
+ status: z7.string()
1446
1486
  });
1447
- var xaiResponsesChunkSchema = z6.union([
1448
- z6.object({
1449
- type: z6.literal("response.created"),
1487
+ var xaiResponsesChunkSchema = z7.union([
1488
+ z7.object({
1489
+ type: z7.literal("response.created"),
1450
1490
  response: xaiResponsesResponseSchema.partial({ usage: true, status: true })
1451
1491
  }),
1452
- z6.object({
1453
- type: z6.literal("response.in_progress"),
1492
+ z7.object({
1493
+ type: z7.literal("response.in_progress"),
1454
1494
  response: xaiResponsesResponseSchema.partial({ usage: true, status: true })
1455
1495
  }),
1456
- z6.object({
1457
- type: z6.literal("response.output_item.added"),
1496
+ z7.object({
1497
+ type: z7.literal("response.output_item.added"),
1458
1498
  item: outputItemSchema,
1459
- output_index: z6.number()
1499
+ output_index: z7.number()
1460
1500
  }),
1461
- z6.object({
1462
- type: z6.literal("response.output_item.done"),
1501
+ z7.object({
1502
+ type: z7.literal("response.output_item.done"),
1463
1503
  item: outputItemSchema,
1464
- output_index: z6.number()
1504
+ output_index: z7.number()
1465
1505
  }),
1466
- z6.object({
1467
- type: z6.literal("response.content_part.added"),
1468
- item_id: z6.string(),
1469
- output_index: z6.number(),
1470
- content_index: z6.number(),
1506
+ z7.object({
1507
+ type: z7.literal("response.content_part.added"),
1508
+ item_id: z7.string(),
1509
+ output_index: z7.number(),
1510
+ content_index: z7.number(),
1471
1511
  part: messageContentPartSchema
1472
1512
  }),
1473
- z6.object({
1474
- type: z6.literal("response.content_part.done"),
1475
- item_id: z6.string(),
1476
- output_index: z6.number(),
1477
- content_index: z6.number(),
1513
+ z7.object({
1514
+ type: z7.literal("response.content_part.done"),
1515
+ item_id: z7.string(),
1516
+ output_index: z7.number(),
1517
+ content_index: z7.number(),
1478
1518
  part: messageContentPartSchema
1479
1519
  }),
1480
- z6.object({
1481
- type: z6.literal("response.output_text.delta"),
1482
- item_id: z6.string(),
1483
- output_index: z6.number(),
1484
- content_index: z6.number(),
1485
- delta: z6.string(),
1486
- logprobs: z6.array(z6.any()).optional()
1520
+ z7.object({
1521
+ type: z7.literal("response.output_text.delta"),
1522
+ item_id: z7.string(),
1523
+ output_index: z7.number(),
1524
+ content_index: z7.number(),
1525
+ delta: z7.string(),
1526
+ logprobs: z7.array(z7.any()).optional()
1487
1527
  }),
1488
- z6.object({
1489
- type: z6.literal("response.output_text.done"),
1490
- item_id: z6.string(),
1491
- output_index: z6.number(),
1492
- content_index: z6.number(),
1493
- text: z6.string(),
1494
- logprobs: z6.array(z6.any()).optional(),
1495
- annotations: z6.array(annotationSchema).optional()
1528
+ z7.object({
1529
+ type: z7.literal("response.output_text.done"),
1530
+ item_id: z7.string(),
1531
+ output_index: z7.number(),
1532
+ content_index: z7.number(),
1533
+ text: z7.string(),
1534
+ logprobs: z7.array(z7.any()).optional(),
1535
+ annotations: z7.array(annotationSchema).optional()
1496
1536
  }),
1497
- z6.object({
1498
- type: z6.literal("response.output_text.annotation.added"),
1499
- item_id: z6.string(),
1500
- output_index: z6.number(),
1501
- content_index: z6.number(),
1502
- annotation_index: z6.number(),
1537
+ z7.object({
1538
+ type: z7.literal("response.output_text.annotation.added"),
1539
+ item_id: z7.string(),
1540
+ output_index: z7.number(),
1541
+ content_index: z7.number(),
1542
+ annotation_index: z7.number(),
1503
1543
  annotation: annotationSchema
1504
1544
  }),
1505
- z6.object({
1506
- type: z6.literal("response.reasoning_summary_part.added"),
1507
- item_id: z6.string(),
1508
- output_index: z6.number(),
1509
- summary_index: z6.number(),
1545
+ z7.object({
1546
+ type: z7.literal("response.reasoning_summary_part.added"),
1547
+ item_id: z7.string(),
1548
+ output_index: z7.number(),
1549
+ summary_index: z7.number(),
1510
1550
  part: reasoningSummaryPartSchema
1511
1551
  }),
1512
- z6.object({
1513
- type: z6.literal("response.reasoning_summary_part.done"),
1514
- item_id: z6.string(),
1515
- output_index: z6.number(),
1516
- summary_index: z6.number(),
1552
+ z7.object({
1553
+ type: z7.literal("response.reasoning_summary_part.done"),
1554
+ item_id: z7.string(),
1555
+ output_index: z7.number(),
1556
+ summary_index: z7.number(),
1517
1557
  part: reasoningSummaryPartSchema
1518
1558
  }),
1519
- z6.object({
1520
- type: z6.literal("response.reasoning_summary_text.delta"),
1521
- item_id: z6.string(),
1522
- output_index: z6.number(),
1523
- summary_index: z6.number(),
1524
- delta: z6.string()
1559
+ z7.object({
1560
+ type: z7.literal("response.reasoning_summary_text.delta"),
1561
+ item_id: z7.string(),
1562
+ output_index: z7.number(),
1563
+ summary_index: z7.number(),
1564
+ delta: z7.string()
1525
1565
  }),
1526
- z6.object({
1527
- type: z6.literal("response.reasoning_summary_text.done"),
1528
- item_id: z6.string(),
1529
- output_index: z6.number(),
1530
- summary_index: z6.number(),
1531
- text: z6.string()
1566
+ z7.object({
1567
+ type: z7.literal("response.reasoning_summary_text.done"),
1568
+ item_id: z7.string(),
1569
+ output_index: z7.number(),
1570
+ summary_index: z7.number(),
1571
+ text: z7.string()
1532
1572
  }),
1533
- z6.object({
1534
- type: z6.literal("response.reasoning_text.delta"),
1535
- item_id: z6.string(),
1536
- output_index: z6.number(),
1537
- content_index: z6.number(),
1538
- delta: z6.string()
1573
+ z7.object({
1574
+ type: z7.literal("response.reasoning_text.delta"),
1575
+ item_id: z7.string(),
1576
+ output_index: z7.number(),
1577
+ content_index: z7.number(),
1578
+ delta: z7.string()
1539
1579
  }),
1540
- z6.object({
1541
- type: z6.literal("response.reasoning_text.done"),
1542
- item_id: z6.string(),
1543
- output_index: z6.number(),
1544
- content_index: z6.number(),
1545
- text: z6.string()
1580
+ z7.object({
1581
+ type: z7.literal("response.reasoning_text.done"),
1582
+ item_id: z7.string(),
1583
+ output_index: z7.number(),
1584
+ content_index: z7.number(),
1585
+ text: z7.string()
1546
1586
  }),
1547
- z6.object({
1548
- type: z6.literal("response.web_search_call.in_progress"),
1549
- item_id: z6.string(),
1550
- output_index: z6.number()
1587
+ z7.object({
1588
+ type: z7.literal("response.web_search_call.in_progress"),
1589
+ item_id: z7.string(),
1590
+ output_index: z7.number()
1551
1591
  }),
1552
- z6.object({
1553
- type: z6.literal("response.web_search_call.searching"),
1554
- item_id: z6.string(),
1555
- output_index: z6.number()
1592
+ z7.object({
1593
+ type: z7.literal("response.web_search_call.searching"),
1594
+ item_id: z7.string(),
1595
+ output_index: z7.number()
1556
1596
  }),
1557
- z6.object({
1558
- type: z6.literal("response.web_search_call.completed"),
1559
- item_id: z6.string(),
1560
- output_index: z6.number()
1597
+ z7.object({
1598
+ type: z7.literal("response.web_search_call.completed"),
1599
+ item_id: z7.string(),
1600
+ output_index: z7.number()
1561
1601
  }),
1562
- z6.object({
1563
- type: z6.literal("response.x_search_call.in_progress"),
1564
- item_id: z6.string(),
1565
- output_index: z6.number()
1602
+ z7.object({
1603
+ type: z7.literal("response.x_search_call.in_progress"),
1604
+ item_id: z7.string(),
1605
+ output_index: z7.number()
1566
1606
  }),
1567
- z6.object({
1568
- type: z6.literal("response.x_search_call.searching"),
1569
- item_id: z6.string(),
1570
- output_index: z6.number()
1607
+ z7.object({
1608
+ type: z7.literal("response.x_search_call.searching"),
1609
+ item_id: z7.string(),
1610
+ output_index: z7.number()
1571
1611
  }),
1572
- z6.object({
1573
- type: z6.literal("response.x_search_call.completed"),
1574
- item_id: z6.string(),
1575
- output_index: z6.number()
1612
+ z7.object({
1613
+ type: z7.literal("response.x_search_call.completed"),
1614
+ item_id: z7.string(),
1615
+ output_index: z7.number()
1576
1616
  }),
1577
- z6.object({
1578
- type: z6.literal("response.file_search_call.in_progress"),
1579
- item_id: z6.string(),
1580
- output_index: z6.number()
1617
+ z7.object({
1618
+ type: z7.literal("response.file_search_call.in_progress"),
1619
+ item_id: z7.string(),
1620
+ output_index: z7.number()
1581
1621
  }),
1582
- z6.object({
1583
- type: z6.literal("response.file_search_call.searching"),
1584
- item_id: z6.string(),
1585
- output_index: z6.number()
1622
+ z7.object({
1623
+ type: z7.literal("response.file_search_call.searching"),
1624
+ item_id: z7.string(),
1625
+ output_index: z7.number()
1586
1626
  }),
1587
- z6.object({
1588
- type: z6.literal("response.file_search_call.completed"),
1589
- item_id: z6.string(),
1590
- output_index: z6.number()
1627
+ z7.object({
1628
+ type: z7.literal("response.file_search_call.completed"),
1629
+ item_id: z7.string(),
1630
+ output_index: z7.number()
1591
1631
  }),
1592
- z6.object({
1593
- type: z6.literal("response.code_execution_call.in_progress"),
1594
- item_id: z6.string(),
1595
- output_index: z6.number()
1632
+ z7.object({
1633
+ type: z7.literal("response.code_execution_call.in_progress"),
1634
+ item_id: z7.string(),
1635
+ output_index: z7.number()
1596
1636
  }),
1597
- z6.object({
1598
- type: z6.literal("response.code_execution_call.executing"),
1599
- item_id: z6.string(),
1600
- output_index: z6.number()
1637
+ z7.object({
1638
+ type: z7.literal("response.code_execution_call.executing"),
1639
+ item_id: z7.string(),
1640
+ output_index: z7.number()
1601
1641
  }),
1602
- z6.object({
1603
- type: z6.literal("response.code_execution_call.completed"),
1604
- item_id: z6.string(),
1605
- output_index: z6.number()
1642
+ z7.object({
1643
+ type: z7.literal("response.code_execution_call.completed"),
1644
+ item_id: z7.string(),
1645
+ output_index: z7.number()
1606
1646
  }),
1607
- z6.object({
1608
- type: z6.literal("response.code_interpreter_call.in_progress"),
1609
- item_id: z6.string(),
1610
- output_index: z6.number()
1647
+ z7.object({
1648
+ type: z7.literal("response.code_interpreter_call.in_progress"),
1649
+ item_id: z7.string(),
1650
+ output_index: z7.number()
1611
1651
  }),
1612
- z6.object({
1613
- type: z6.literal("response.code_interpreter_call.executing"),
1614
- item_id: z6.string(),
1615
- output_index: z6.number()
1652
+ z7.object({
1653
+ type: z7.literal("response.code_interpreter_call.executing"),
1654
+ item_id: z7.string(),
1655
+ output_index: z7.number()
1616
1656
  }),
1617
- z6.object({
1618
- type: z6.literal("response.code_interpreter_call.interpreting"),
1619
- item_id: z6.string(),
1620
- output_index: z6.number()
1657
+ z7.object({
1658
+ type: z7.literal("response.code_interpreter_call.interpreting"),
1659
+ item_id: z7.string(),
1660
+ output_index: z7.number()
1621
1661
  }),
1622
- z6.object({
1623
- type: z6.literal("response.code_interpreter_call.completed"),
1624
- item_id: z6.string(),
1625
- output_index: z6.number()
1662
+ z7.object({
1663
+ type: z7.literal("response.code_interpreter_call.completed"),
1664
+ item_id: z7.string(),
1665
+ output_index: z7.number()
1626
1666
  }),
1627
1667
  // Code interpreter code streaming events
1628
- z6.object({
1629
- type: z6.literal("response.code_interpreter_call_code.delta"),
1630
- item_id: z6.string(),
1631
- output_index: z6.number(),
1632
- delta: z6.string()
1668
+ z7.object({
1669
+ type: z7.literal("response.code_interpreter_call_code.delta"),
1670
+ item_id: z7.string(),
1671
+ output_index: z7.number(),
1672
+ delta: z7.string()
1633
1673
  }),
1634
- z6.object({
1635
- type: z6.literal("response.code_interpreter_call_code.done"),
1636
- item_id: z6.string(),
1637
- output_index: z6.number(),
1638
- code: z6.string()
1674
+ z7.object({
1675
+ type: z7.literal("response.code_interpreter_call_code.done"),
1676
+ item_id: z7.string(),
1677
+ output_index: z7.number(),
1678
+ code: z7.string()
1639
1679
  }),
1640
- z6.object({
1641
- type: z6.literal("response.custom_tool_call_input.delta"),
1642
- item_id: z6.string(),
1643
- output_index: z6.number(),
1644
- delta: z6.string()
1680
+ z7.object({
1681
+ type: z7.literal("response.custom_tool_call_input.delta"),
1682
+ item_id: z7.string(),
1683
+ output_index: z7.number(),
1684
+ delta: z7.string()
1645
1685
  }),
1646
- z6.object({
1647
- type: z6.literal("response.custom_tool_call_input.done"),
1648
- item_id: z6.string(),
1649
- output_index: z6.number(),
1650
- input: z6.string()
1686
+ z7.object({
1687
+ type: z7.literal("response.custom_tool_call_input.done"),
1688
+ item_id: z7.string(),
1689
+ output_index: z7.number(),
1690
+ input: z7.string()
1651
1691
  }),
1652
1692
  // Function call arguments streaming events (standard function tools)
1653
- z6.object({
1654
- type: z6.literal("response.function_call_arguments.delta"),
1655
- item_id: z6.string(),
1656
- output_index: z6.number(),
1657
- delta: z6.string()
1693
+ z7.object({
1694
+ type: z7.literal("response.function_call_arguments.delta"),
1695
+ item_id: z7.string(),
1696
+ output_index: z7.number(),
1697
+ delta: z7.string()
1658
1698
  }),
1659
- z6.object({
1660
- type: z6.literal("response.function_call_arguments.done"),
1661
- item_id: z6.string(),
1662
- output_index: z6.number(),
1663
- arguments: z6.string()
1699
+ z7.object({
1700
+ type: z7.literal("response.function_call_arguments.done"),
1701
+ item_id: z7.string(),
1702
+ output_index: z7.number(),
1703
+ arguments: z7.string()
1664
1704
  }),
1665
- z6.object({
1666
- type: z6.literal("response.mcp_call.in_progress"),
1667
- item_id: z6.string(),
1668
- output_index: z6.number()
1705
+ z7.object({
1706
+ type: z7.literal("response.mcp_call.in_progress"),
1707
+ item_id: z7.string(),
1708
+ output_index: z7.number()
1669
1709
  }),
1670
- z6.object({
1671
- type: z6.literal("response.mcp_call.executing"),
1672
- item_id: z6.string(),
1673
- output_index: z6.number()
1710
+ z7.object({
1711
+ type: z7.literal("response.mcp_call.executing"),
1712
+ item_id: z7.string(),
1713
+ output_index: z7.number()
1674
1714
  }),
1675
- z6.object({
1676
- type: z6.literal("response.mcp_call.completed"),
1677
- item_id: z6.string(),
1678
- output_index: z6.number()
1715
+ z7.object({
1716
+ type: z7.literal("response.mcp_call.completed"),
1717
+ item_id: z7.string(),
1718
+ output_index: z7.number()
1679
1719
  }),
1680
- z6.object({
1681
- type: z6.literal("response.mcp_call.failed"),
1682
- item_id: z6.string(),
1683
- output_index: z6.number()
1720
+ z7.object({
1721
+ type: z7.literal("response.mcp_call.failed"),
1722
+ item_id: z7.string(),
1723
+ output_index: z7.number()
1684
1724
  }),
1685
- z6.object({
1686
- type: z6.literal("response.mcp_call_arguments.delta"),
1687
- item_id: z6.string(),
1688
- output_index: z6.number(),
1689
- delta: z6.string()
1725
+ z7.object({
1726
+ type: z7.literal("response.mcp_call_arguments.delta"),
1727
+ item_id: z7.string(),
1728
+ output_index: z7.number(),
1729
+ delta: z7.string()
1690
1730
  }),
1691
- z6.object({
1692
- type: z6.literal("response.mcp_call_arguments.done"),
1693
- item_id: z6.string(),
1694
- output_index: z6.number(),
1695
- arguments: z6.string().optional()
1731
+ z7.object({
1732
+ type: z7.literal("response.mcp_call_arguments.done"),
1733
+ item_id: z7.string(),
1734
+ output_index: z7.number(),
1735
+ arguments: z7.string().optional()
1696
1736
  }),
1697
- z6.object({
1698
- type: z6.literal("response.mcp_call_output.delta"),
1699
- item_id: z6.string(),
1700
- output_index: z6.number(),
1701
- delta: z6.string()
1737
+ z7.object({
1738
+ type: z7.literal("response.mcp_call_output.delta"),
1739
+ item_id: z7.string(),
1740
+ output_index: z7.number(),
1741
+ delta: z7.string()
1702
1742
  }),
1703
- z6.object({
1704
- type: z6.literal("response.mcp_call_output.done"),
1705
- item_id: z6.string(),
1706
- output_index: z6.number(),
1707
- output: z6.string().optional()
1743
+ z7.object({
1744
+ type: z7.literal("response.mcp_call_output.done"),
1745
+ item_id: z7.string(),
1746
+ output_index: z7.number(),
1747
+ output: z7.string().optional()
1708
1748
  }),
1709
- z6.object({
1710
- type: z6.literal("response.incomplete"),
1711
- response: z6.object({
1712
- incomplete_details: z6.object({ reason: z6.string() }).nullish(),
1749
+ z7.object({
1750
+ type: z7.literal("response.incomplete"),
1751
+ response: z7.object({
1752
+ incomplete_details: z7.object({ reason: z7.string() }).nullish(),
1713
1753
  usage: xaiResponsesUsageSchema.nullish()
1714
1754
  })
1715
1755
  }),
1716
- z6.object({
1717
- type: z6.literal("response.failed"),
1718
- response: z6.object({
1719
- error: z6.object({
1720
- code: z6.string().nullish(),
1721
- message: z6.string()
1756
+ z7.object({
1757
+ type: z7.literal("response.failed"),
1758
+ response: z7.object({
1759
+ error: z7.object({
1760
+ code: z7.string().nullish(),
1761
+ message: z7.string()
1722
1762
  }).nullish(),
1723
- incomplete_details: z6.object({ reason: z6.string() }).nullish(),
1763
+ incomplete_details: z7.object({ reason: z7.string() }).nullish(),
1724
1764
  usage: xaiResponsesUsageSchema.nullish()
1725
1765
  })
1726
1766
  }),
1727
- z6.object({
1728
- type: z6.literal("error"),
1729
- code: z6.string().nullish(),
1730
- message: z6.string(),
1731
- param: z6.string().nullish()
1767
+ z7.object({
1768
+ type: z7.literal("error"),
1769
+ code: z7.string().nullish(),
1770
+ message: z7.string(),
1771
+ param: z7.string().nullish()
1732
1772
  }),
1733
- z6.object({
1734
- type: z6.literal("response.done"),
1773
+ z7.object({
1774
+ type: z7.literal("response.done"),
1735
1775
  response: xaiResponsesResponseSchema
1736
1776
  }),
1737
- z6.object({
1738
- type: z6.literal("response.completed"),
1777
+ z7.object({
1778
+ type: z7.literal("response.completed"),
1739
1779
  response: xaiResponsesResponseSchema
1740
1780
  })
1741
1781
  ]);
1742
1782
 
1743
1783
  // src/responses/xai-responses-options.ts
1744
- import { z as z7 } from "zod/v4";
1745
- var xaiLanguageModelResponsesOptions = z7.object({
1784
+ import { z as z8 } from "zod/v4";
1785
+ var xaiLanguageModelResponsesOptions = z8.object({
1746
1786
  /**
1747
1787
  * Constrains how hard a reasoning model thinks before responding.
1748
1788
  * Possible values are `none` (disables reasoning), `low` (uses fewer reasoning
1749
1789
  * tokens), `medium` and `high` (uses more reasoning tokens). Not all models
1750
1790
  * support reasoning effort; see xAI's docs for the values each model accepts.
1751
1791
  */
1752
- reasoningEffort: z7.enum(["none", "low", "medium", "high"]).optional(),
1753
- logprobs: z7.boolean().optional(),
1754
- topLogprobs: z7.number().int().min(0).max(8).optional(),
1792
+ reasoningEffort: z8.enum(["none", "low", "medium", "high"]).optional(),
1793
+ logprobs: z8.boolean().optional(),
1794
+ topLogprobs: z8.number().int().min(0).max(8).optional(),
1755
1795
  /**
1756
1796
  * Whether to store the input message(s) and model response for later retrieval.
1757
1797
  * Must be set to `false` for teams with Zero Data Retention (ZDR) enabled,
1758
1798
  * otherwise the API will return an error.
1759
1799
  * @default true
1760
1800
  */
1761
- store: z7.boolean().optional(),
1801
+ store: z8.boolean().optional(),
1762
1802
  /**
1763
1803
  * The ID of the previous response from the model.
1764
1804
  */
1765
- previousResponseId: z7.string().optional(),
1805
+ previousResponseId: z8.string().optional(),
1766
1806
  /**
1767
1807
  * Specify additional output data to include in the model response.
1768
1808
  * Example values: 'file_search_call.results'.
1769
1809
  */
1770
- include: z7.array(z7.enum(["file_search_call.results"])).nullish()
1810
+ include: z8.array(z8.enum(["file_search_call.results"])).nullish()
1771
1811
  });
1772
1812
 
1773
1813
  // src/responses/xai-responses-prepare-tools.ts
@@ -1782,25 +1822,25 @@ import {
1782
1822
  lazySchema,
1783
1823
  zodSchema
1784
1824
  } from "@ai-sdk/provider-utils";
1785
- import { z as z8 } from "zod/v4";
1825
+ import { z as z9 } from "zod/v4";
1786
1826
  var fileSearchArgsSchema = lazySchema(
1787
1827
  () => zodSchema(
1788
- z8.object({
1789
- vectorStoreIds: z8.array(z8.string()),
1790
- maxNumResults: z8.number().optional()
1828
+ z9.object({
1829
+ vectorStoreIds: z9.array(z9.string()),
1830
+ maxNumResults: z9.number().optional()
1791
1831
  })
1792
1832
  )
1793
1833
  );
1794
1834
  var fileSearchOutputSchema = lazySchema(
1795
1835
  () => zodSchema(
1796
- z8.object({
1797
- queries: z8.array(z8.string()),
1798
- results: z8.array(
1799
- z8.object({
1800
- fileId: z8.string(),
1801
- filename: z8.string(),
1802
- score: z8.number().min(0).max(1),
1803
- text: z8.string()
1836
+ z9.object({
1837
+ queries: z9.array(z9.string()),
1838
+ results: z9.array(
1839
+ z9.object({
1840
+ fileId: z9.string(),
1841
+ filename: z9.string(),
1842
+ score: z9.number().min(0).max(1),
1843
+ text: z9.string()
1804
1844
  })
1805
1845
  ).nullable()
1806
1846
  })
@@ -1808,7 +1848,7 @@ var fileSearchOutputSchema = lazySchema(
1808
1848
  );
1809
1849
  var fileSearchToolFactory = createProviderToolFactoryWithOutputSchema({
1810
1850
  id: "xai.file_search",
1811
- inputSchema: lazySchema(() => zodSchema(z8.object({}))),
1851
+ inputSchema: lazySchema(() => zodSchema(z9.object({}))),
1812
1852
  outputSchema: fileSearchOutputSchema
1813
1853
  });
1814
1854
  var fileSearch = (args) => fileSearchToolFactory(args);
@@ -1819,31 +1859,31 @@ import {
1819
1859
  lazySchema as lazySchema2,
1820
1860
  zodSchema as zodSchema2
1821
1861
  } from "@ai-sdk/provider-utils";
1822
- import { z as z9 } from "zod/v4";
1862
+ import { z as z10 } from "zod/v4";
1823
1863
  var mcpServerArgsSchema = lazySchema2(
1824
1864
  () => zodSchema2(
1825
- z9.object({
1826
- serverUrl: z9.string().describe("The URL of the MCP server"),
1827
- serverLabel: z9.string().optional().describe("A label for the MCP server"),
1828
- serverDescription: z9.string().optional().describe("Description of the MCP server"),
1829
- allowedTools: z9.array(z9.string()).optional().describe("List of allowed tool names"),
1830
- headers: z9.record(z9.string(), z9.string()).optional().describe("Custom headers to send"),
1831
- authorization: z9.string().optional().describe("Authorization header value")
1865
+ z10.object({
1866
+ serverUrl: z10.string().describe("The URL of the MCP server"),
1867
+ serverLabel: z10.string().optional().describe("A label for the MCP server"),
1868
+ serverDescription: z10.string().optional().describe("Description of the MCP server"),
1869
+ allowedTools: z10.array(z10.string()).optional().describe("List of allowed tool names"),
1870
+ headers: z10.record(z10.string(), z10.string()).optional().describe("Custom headers to send"),
1871
+ authorization: z10.string().optional().describe("Authorization header value")
1832
1872
  })
1833
1873
  )
1834
1874
  );
1835
1875
  var mcpServerOutputSchema = lazySchema2(
1836
1876
  () => zodSchema2(
1837
- z9.object({
1838
- name: z9.string(),
1839
- arguments: z9.string(),
1840
- result: z9.unknown()
1877
+ z10.object({
1878
+ name: z10.string(),
1879
+ arguments: z10.string(),
1880
+ result: z10.unknown()
1841
1881
  })
1842
1882
  )
1843
1883
  );
1844
1884
  var mcpServerToolFactory = createProviderToolFactoryWithOutputSchema2({
1845
1885
  id: "xai.mcp",
1846
- inputSchema: lazySchema2(() => zodSchema2(z9.object({}))),
1886
+ inputSchema: lazySchema2(() => zodSchema2(z10.object({}))),
1847
1887
  outputSchema: mcpServerOutputSchema
1848
1888
  });
1849
1889
  var mcpServer = (args) => mcpServerToolFactory(args);
@@ -1854,26 +1894,26 @@ import {
1854
1894
  lazySchema as lazySchema3,
1855
1895
  zodSchema as zodSchema3
1856
1896
  } from "@ai-sdk/provider-utils";
1857
- import { z as z10 } from "zod/v4";
1897
+ import { z as z11 } from "zod/v4";
1858
1898
  var webSearchArgsSchema = lazySchema3(
1859
1899
  () => zodSchema3(
1860
- z10.object({
1861
- allowedDomains: z10.array(z10.string()).max(5).optional(),
1862
- excludedDomains: z10.array(z10.string()).max(5).optional(),
1863
- enableImageSearch: z10.boolean().optional(),
1864
- enableImageUnderstanding: z10.boolean().optional()
1900
+ z11.object({
1901
+ allowedDomains: z11.array(z11.string()).max(5).optional(),
1902
+ excludedDomains: z11.array(z11.string()).max(5).optional(),
1903
+ enableImageSearch: z11.boolean().optional(),
1904
+ enableImageUnderstanding: z11.boolean().optional()
1865
1905
  })
1866
1906
  )
1867
1907
  );
1868
1908
  var webSearchOutputSchema = lazySchema3(
1869
1909
  () => zodSchema3(
1870
- z10.object({
1871
- query: z10.string(),
1872
- sources: z10.array(
1873
- z10.object({
1874
- title: z10.string(),
1875
- url: z10.string(),
1876
- snippet: z10.string()
1910
+ z11.object({
1911
+ query: z11.string(),
1912
+ sources: z11.array(
1913
+ z11.object({
1914
+ title: z11.string(),
1915
+ url: z11.string(),
1916
+ snippet: z11.string()
1877
1917
  })
1878
1918
  )
1879
1919
  })
@@ -1881,7 +1921,7 @@ var webSearchOutputSchema = lazySchema3(
1881
1921
  );
1882
1922
  var webSearchToolFactory = createProviderToolFactoryWithOutputSchema3({
1883
1923
  id: "xai.web_search",
1884
- inputSchema: lazySchema3(() => zodSchema3(z10.object({}))),
1924
+ inputSchema: lazySchema3(() => zodSchema3(z11.object({}))),
1885
1925
  outputSchema: webSearchOutputSchema
1886
1926
  });
1887
1927
  var webSearch = (args = {}) => webSearchToolFactory(args);
@@ -1892,29 +1932,29 @@ import {
1892
1932
  lazySchema as lazySchema4,
1893
1933
  zodSchema as zodSchema4
1894
1934
  } from "@ai-sdk/provider-utils";
1895
- import { z as z11 } from "zod/v4";
1935
+ import { z as z12 } from "zod/v4";
1896
1936
  var xSearchArgsSchema = lazySchema4(
1897
1937
  () => zodSchema4(
1898
- z11.object({
1899
- allowedXHandles: z11.array(z11.string()).max(10).optional(),
1900
- excludedXHandles: z11.array(z11.string()).max(10).optional(),
1901
- fromDate: z11.string().optional(),
1902
- toDate: z11.string().optional(),
1903
- enableImageUnderstanding: z11.boolean().optional(),
1904
- enableVideoUnderstanding: z11.boolean().optional()
1938
+ z12.object({
1939
+ allowedXHandles: z12.array(z12.string()).max(10).optional(),
1940
+ excludedXHandles: z12.array(z12.string()).max(10).optional(),
1941
+ fromDate: z12.string().optional(),
1942
+ toDate: z12.string().optional(),
1943
+ enableImageUnderstanding: z12.boolean().optional(),
1944
+ enableVideoUnderstanding: z12.boolean().optional()
1905
1945
  })
1906
1946
  )
1907
1947
  );
1908
1948
  var xSearchOutputSchema = lazySchema4(
1909
1949
  () => zodSchema4(
1910
- z11.object({
1911
- query: z11.string(),
1912
- posts: z11.array(
1913
- z11.object({
1914
- author: z11.string(),
1915
- text: z11.string(),
1916
- url: z11.string(),
1917
- likes: z11.number()
1950
+ z12.object({
1951
+ query: z12.string(),
1952
+ posts: z12.array(
1953
+ z12.object({
1954
+ author: z12.string(),
1955
+ text: z12.string(),
1956
+ url: z12.string(),
1957
+ likes: z12.number()
1918
1958
  })
1919
1959
  )
1920
1960
  })
@@ -1922,7 +1962,7 @@ var xSearchOutputSchema = lazySchema4(
1922
1962
  );
1923
1963
  var xSearchToolFactory = createProviderToolFactoryWithOutputSchema4({
1924
1964
  id: "xai.x_search",
1925
- inputSchema: lazySchema4(() => zodSchema4(z11.object({}))),
1965
+ inputSchema: lazySchema4(() => zodSchema4(z12.object({}))),
1926
1966
  outputSchema: xSearchOutputSchema
1927
1967
  });
1928
1968
  var xSearch = (args = {}) => xSearchToolFactory(args);
@@ -2110,7 +2150,7 @@ var XaiResponsesLanguageModel = class {
2110
2150
  }) {
2111
2151
  var _a, _b, _c, _d, _e, _f, _g, _h;
2112
2152
  const warnings = [];
2113
- const options = (_a = await parseProviderOptions3({
2153
+ const options = (_a = await parseProviderOptions5({
2114
2154
  provider: "xai",
2115
2155
  providerOptions,
2116
2156
  schema: xaiLanguageModelResponsesOptions
@@ -2205,7 +2245,7 @@ var XaiResponsesLanguageModel = class {
2205
2245
  };
2206
2246
  }
2207
2247
  async doGenerate(options) {
2208
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
2248
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n;
2209
2249
  const {
2210
2250
  args: body,
2211
2251
  warnings,
@@ -2326,8 +2366,8 @@ var XaiResponsesLanguageModel = class {
2326
2366
  break;
2327
2367
  }
2328
2368
  case "reasoning": {
2329
- const summaryTexts = part.summary.map((s) => s.text).filter((text) => text && text.length > 0);
2330
- const reasoningText = summaryTexts.join("");
2369
+ const texts = part.summary.length > 0 ? part.summary.map((s) => s.text) : ((_m = part.content) != null ? _m : []).map((c) => c.text);
2370
+ const reasoningText = texts.filter((text) => text && text.length > 0).join("");
2331
2371
  if (reasoningText || part.encrypted_content) {
2332
2372
  const hasMetadata = part.encrypted_content || part.id;
2333
2373
  content.push({
@@ -2356,7 +2396,7 @@ var XaiResponsesLanguageModel = class {
2356
2396
  content,
2357
2397
  finishReason: {
2358
2398
  unified: hasFunctionCall ? "tool-calls" : mapXaiResponsesFinishReason(response.status),
2359
- raw: (_m = response.status) != null ? _m : void 0
2399
+ raw: (_n = response.status) != null ? _n : void 0
2360
2400
  },
2361
2401
  usage: response.usage ? convertXaiResponsesUsage(response.usage) : {
2362
2402
  inputTokens: { total: 0, noCache: 0, cacheRead: 0, cacheWrite: 0 },
@@ -2819,43 +2859,43 @@ var XaiResponsesLanguageModel = class {
2819
2859
 
2820
2860
  // src/tool/code-execution.ts
2821
2861
  import { createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema5 } from "@ai-sdk/provider-utils";
2822
- import { z as z12 } from "zod/v4";
2823
- var codeExecutionOutputSchema = z12.object({
2824
- output: z12.string().describe("the output of the code execution"),
2825
- error: z12.string().optional().describe("any error that occurred")
2862
+ import { z as z13 } from "zod/v4";
2863
+ var codeExecutionOutputSchema = z13.object({
2864
+ output: z13.string().describe("the output of the code execution"),
2865
+ error: z13.string().optional().describe("any error that occurred")
2826
2866
  });
2827
2867
  var codeExecutionToolFactory = createProviderToolFactoryWithOutputSchema5({
2828
2868
  id: "xai.code_execution",
2829
- inputSchema: z12.object({}).describe("no input parameters"),
2869
+ inputSchema: z13.object({}).describe("no input parameters"),
2830
2870
  outputSchema: codeExecutionOutputSchema
2831
2871
  });
2832
2872
  var codeExecution = (args = {}) => codeExecutionToolFactory(args);
2833
2873
 
2834
2874
  // src/tool/view-image.ts
2835
2875
  import { createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema6 } from "@ai-sdk/provider-utils";
2836
- import { z as z13 } from "zod/v4";
2837
- var viewImageOutputSchema = z13.object({
2838
- description: z13.string().describe("description of the image"),
2839
- objects: z13.array(z13.string()).optional().describe("objects detected in the image")
2876
+ import { z as z14 } from "zod/v4";
2877
+ var viewImageOutputSchema = z14.object({
2878
+ description: z14.string().describe("description of the image"),
2879
+ objects: z14.array(z14.string()).optional().describe("objects detected in the image")
2840
2880
  });
2841
2881
  var viewImageToolFactory = createProviderToolFactoryWithOutputSchema6({
2842
2882
  id: "xai.view_image",
2843
- inputSchema: z13.object({}).describe("no input parameters"),
2883
+ inputSchema: z14.object({}).describe("no input parameters"),
2844
2884
  outputSchema: viewImageOutputSchema
2845
2885
  });
2846
2886
  var viewImage = (args = {}) => viewImageToolFactory(args);
2847
2887
 
2848
2888
  // src/tool/view-x-video.ts
2849
2889
  import { createProviderToolFactoryWithOutputSchema as createProviderToolFactoryWithOutputSchema7 } from "@ai-sdk/provider-utils";
2850
- import { z as z14 } from "zod/v4";
2851
- var viewXVideoOutputSchema = z14.object({
2852
- transcript: z14.string().optional().describe("transcript of the video"),
2853
- description: z14.string().describe("description of the video content"),
2854
- duration: z14.number().optional().describe("duration in seconds")
2890
+ import { z as z15 } from "zod/v4";
2891
+ var viewXVideoOutputSchema = z15.object({
2892
+ transcript: z15.string().optional().describe("transcript of the video"),
2893
+ description: z15.string().describe("description of the video content"),
2894
+ duration: z15.number().optional().describe("duration in seconds")
2855
2895
  });
2856
2896
  var viewXVideoToolFactory = createProviderToolFactoryWithOutputSchema7({
2857
2897
  id: "xai.view_x_video",
2858
- inputSchema: z14.object({}).describe("no input parameters"),
2898
+ inputSchema: z15.object({}).describe("no input parameters"),
2859
2899
  outputSchema: viewXVideoOutputSchema
2860
2900
  });
2861
2901
  var viewXVideo = (args = {}) => viewXVideoToolFactory(args);
@@ -2872,7 +2912,7 @@ var xaiTools = {
2872
2912
  };
2873
2913
 
2874
2914
  // src/version.ts
2875
- var VERSION = true ? "3.0.103" : "0.0.0-test";
2915
+ var VERSION = true ? "3.0.105" : "0.0.0-test";
2876
2916
 
2877
2917
  // src/xai-video-model.ts
2878
2918
  import {
@@ -2884,56 +2924,56 @@ import {
2884
2924
  createJsonResponseHandler as createJsonResponseHandler4,
2885
2925
  delay,
2886
2926
  getFromApi as getFromApi2,
2887
- parseProviderOptions as parseProviderOptions4,
2927
+ parseProviderOptions as parseProviderOptions6,
2888
2928
  postJsonToApi as postJsonToApi4
2889
2929
  } from "@ai-sdk/provider-utils";
2890
- import { z as z16 } from "zod/v4";
2930
+ import { z as z17 } from "zod/v4";
2891
2931
 
2892
2932
  // src/xai-video-options.ts
2893
2933
  import { lazySchema as lazySchema5, zodSchema as zodSchema5 } from "@ai-sdk/provider-utils";
2894
- import { z as z15 } from "zod/v4";
2895
- var nonEmptyStringSchema = z15.string().min(1);
2896
- var resolutionSchema = z15.enum(["480p", "720p"]);
2897
- var modeSchema = z15.enum(["edit-video", "extend-video", "reference-to-video"]);
2934
+ import { z as z16 } from "zod/v4";
2935
+ var nonEmptyStringSchema = z16.string().min(1);
2936
+ var resolutionSchema = z16.enum(["480p", "720p"]);
2937
+ var modeSchema = z16.enum(["edit-video", "extend-video", "reference-to-video"]);
2898
2938
  var baseFields = {
2899
- pollIntervalMs: z15.number().positive().nullish(),
2900
- pollTimeoutMs: z15.number().positive().nullish(),
2939
+ pollIntervalMs: z16.number().positive().nullish(),
2940
+ pollTimeoutMs: z16.number().positive().nullish(),
2901
2941
  resolution: resolutionSchema.nullish()
2902
2942
  };
2903
- var editVideoSchema = z15.object({
2943
+ var editVideoSchema = z16.object({
2904
2944
  ...baseFields,
2905
- mode: z15.literal("edit-video"),
2945
+ mode: z16.literal("edit-video"),
2906
2946
  videoUrl: nonEmptyStringSchema,
2907
- referenceImageUrls: z15.undefined().optional()
2947
+ referenceImageUrls: z16.undefined().optional()
2908
2948
  });
2909
- var extendVideoSchema = z15.object({
2949
+ var extendVideoSchema = z16.object({
2910
2950
  ...baseFields,
2911
- mode: z15.literal("extend-video"),
2951
+ mode: z16.literal("extend-video"),
2912
2952
  videoUrl: nonEmptyStringSchema,
2913
- referenceImageUrls: z15.undefined().optional()
2953
+ referenceImageUrls: z16.undefined().optional()
2914
2954
  });
2915
- var referenceToVideoSchema = z15.object({
2955
+ var referenceToVideoSchema = z16.object({
2916
2956
  ...baseFields,
2917
- mode: z15.literal("reference-to-video"),
2918
- referenceImageUrls: z15.array(nonEmptyStringSchema).min(1).max(7),
2919
- videoUrl: z15.undefined().optional()
2957
+ mode: z16.literal("reference-to-video"),
2958
+ referenceImageUrls: z16.array(nonEmptyStringSchema).min(1).max(7),
2959
+ videoUrl: z16.undefined().optional()
2920
2960
  });
2921
- var autoDetectSchema = z15.object({
2961
+ var autoDetectSchema = z16.object({
2922
2962
  ...baseFields,
2923
- mode: z15.undefined().optional(),
2963
+ mode: z16.undefined().optional(),
2924
2964
  videoUrl: nonEmptyStringSchema.optional(),
2925
- referenceImageUrls: z15.array(nonEmptyStringSchema).min(1).max(7).optional()
2965
+ referenceImageUrls: z16.array(nonEmptyStringSchema).min(1).max(7).optional()
2926
2966
  });
2927
- var xaiVideoModelOptions = z15.union([
2967
+ var xaiVideoModelOptions = z16.union([
2928
2968
  editVideoSchema,
2929
2969
  extendVideoSchema,
2930
2970
  referenceToVideoSchema,
2931
2971
  autoDetectSchema
2932
2972
  ]);
2933
- var runtimeSchema = z15.object({
2973
+ var runtimeSchema = z16.object({
2934
2974
  mode: modeSchema.optional(),
2935
2975
  videoUrl: nonEmptyStringSchema.optional(),
2936
- referenceImageUrls: z15.array(nonEmptyStringSchema).min(1).max(7).optional(),
2976
+ referenceImageUrls: z16.array(nonEmptyStringSchema).min(1).max(7).optional(),
2937
2977
  ...baseFields
2938
2978
  }).passthrough();
2939
2979
  var xaiVideoModelOptionsSchema = lazySchema5(
@@ -3006,7 +3046,7 @@ var XaiVideoModel = class {
3006
3046
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
3007
3047
  const currentDate = (_c = (_b = (_a = this.config._internal) == null ? void 0 : _a.currentDate) == null ? void 0 : _b.call(_a)) != null ? _c : /* @__PURE__ */ new Date();
3008
3048
  const warnings = [];
3009
- const xaiOptions = await parseProviderOptions4({
3049
+ const xaiOptions = await parseProviderOptions6({
3010
3050
  provider: "xai",
3011
3051
  providerOptions: options.providerOptions,
3012
3052
  schema: xaiVideoModelOptionsSchema
@@ -3245,24 +3285,24 @@ var XaiVideoModel = class {
3245
3285
  }
3246
3286
  }
3247
3287
  };
3248
- var xaiCreateVideoResponseSchema = z16.object({
3249
- request_id: z16.string().nullish()
3288
+ var xaiCreateVideoResponseSchema = z17.object({
3289
+ request_id: z17.string().nullish()
3250
3290
  });
3251
- var xaiVideoStatusResponseSchema = z16.object({
3252
- status: z16.string().nullish(),
3253
- video: z16.object({
3254
- url: z16.string(),
3255
- duration: z16.number().nullish(),
3256
- respect_moderation: z16.boolean().nullish()
3291
+ var xaiVideoStatusResponseSchema = z17.object({
3292
+ status: z17.string().nullish(),
3293
+ video: z17.object({
3294
+ url: z17.string(),
3295
+ duration: z17.number().nullish(),
3296
+ respect_moderation: z17.boolean().nullish()
3257
3297
  }).nullish(),
3258
- model: z16.string().nullish(),
3259
- usage: z16.object({
3260
- cost_in_usd_ticks: z16.number().nullish()
3298
+ model: z17.string().nullish(),
3299
+ usage: z17.object({
3300
+ cost_in_usd_ticks: z17.number().nullish()
3261
3301
  }).nullish(),
3262
- progress: z16.number().nullish(),
3263
- error: z16.object({
3264
- code: z16.string().nullish(),
3265
- message: z16.string().nullish()
3302
+ progress: z17.number().nullish(),
3303
+ error: z17.object({
3304
+ code: z17.string().nullish(),
3305
+ message: z17.string().nullish()
3266
3306
  }).nullish()
3267
3307
  });
3268
3308